ewmscp  ..
gpfsFcntlHandler.h
Go to the documentation of this file.
1 #ifndef __gpfsFcntlHandler_h_
2 #define __gpfsFcntlHandler_h_
3 #include <gpfs_fcntl.h>
4 
7  public:
8  union {
9  gpfsFcntlHeader_t header;
10  char justCharsProvidingSpace[GPFS_MAX_FCNTL_LENGTH];
11  template <typename T> T& element(int index) {
12  size_t offset = sizeof(header);
13  for (int i = 0; i < index; i++) {
14  offset += *reinterpret_cast<int*>(&justCharsProvidingSpace[offset]);
15  }
16  return *reinterpret_cast<T*>(&justCharsProvidingSpace[offset]);
17  };
18  template <typename T> T& add(int structType) {
19  auto item = reinterpret_cast<T*>(&justCharsProvidingSpace[header.totalLength]);
20  item->structLen = sizeof(T);
21  item->structType = structType;
22  header.totalLength += item->structLen;
23  return *item;
24  };
25  } buffer;
27  void call(int fd, const std::string& path);
28  void dump() const;
29 };
30 
31 
34  union {
35  char justTheSpace[0x10000];
36  gpfs_acl_t acl;
37  } buffer;
38  public:
40  gpfs_acl_handler(gpfs_aclCount_t nEntries);
41  gpfs_acl_t& acl() {
42  return buffer.acl;
43  }
44  size_t size() const {
45  return buffer.acl.acl_nace;
46  };
47 
48  const gpfs_ace_v4_t* begin() const;
49  const gpfs_ace_v4_t* end() const;
50  gpfs_ace_v4_t* begin();
51  gpfs_ace_v4_t* end();
52  void get(int fd, const std::string& path);
53  void set(int fd, const std::string& path);
54 };
55 inline bool operator==(const gpfs_ace_v4_t& lhs,
56  const gpfs_ace_v4_t& rhs) {
57  return lhs.aceType == rhs.aceType &&
58  lhs.aceFlags == rhs.aceFlags &&
59  lhs.aceIFlags == rhs.aceIFlags &&
60  lhs.aceMask == rhs.aceMask &&
61  lhs.aceWho == rhs.aceWho;
62 }
63 
64 
65 #endif
gpfs_fcntl_handler::gpfs_fcntl_handler
gpfs_fcntl_handler()
Definition: gpfsFcntlHandler.cpp:8
operator==
bool operator==(const gpfs_ace_v4_t &lhs, const gpfs_ace_v4_t &rhs)
Definition: gpfsFcntlHandler.h:55
gpfs_acl_handler::begin
const gpfs_ace_v4_t * begin() const
Definition: gpfsFcntlHandler.cpp:70
gpfs_acl_handler::buffer
union gpfs_acl_handler::@3 buffer
gpfs_acl_handler
class for handling non-opaque gpfs acls
Definition: gpfsFcntlHandler.h:33
gpfs_acl_handler::justTheSpace
char justTheSpace[0x10000]
Definition: gpfsFcntlHandler.h:35
gpfs_fcntl_handler
class for handling gpfs_fcnt calls with their very special parameter handling
Definition: gpfsFcntlHandler.h:6
gpfs_acl_handler::get
void get(int fd, const std::string &path)
Definition: gpfsFcntlHandler.cpp:99
gpfs_fcntl_handler::buffer
union gpfs_fcntl_handler::@2 buffer
gpfs_acl_handler::size
size_t size() const
Definition: gpfsFcntlHandler.h:44
gpfs_acl_handler::set
void set(int fd, const std::string &path)
Definition: gpfsFcntlHandler.cpp:123
gpfs_acl_handler::acl
gpfs_acl_t & acl()
Definition: gpfsFcntlHandler.h:41
gpfs_fcntl_handler::call
void call(int fd, const std::string &path)
Definition: gpfsFcntlHandler.cpp:15
gpfs_acl_handler::gpfs_acl_handler
gpfs_acl_handler()
creates struct for getAcl
Definition: gpfsFcntlHandler.cpp:52
gpfs_fcntl_handler::header
gpfsFcntlHeader_t header
Definition: gpfsFcntlHandler.h:9
gpfs_fcntl_handler::justCharsProvidingSpace
char justCharsProvidingSpace[GPFS_MAX_FCNTL_LENGTH]
Definition: gpfsFcntlHandler.h:10
gpfs_acl_handler::acl
gpfs_acl_t acl
Definition: gpfsFcntlHandler.h:36
gpfs_fcntl_handler::dump
void dump() const
Definition: gpfsFcntlHandler.cpp:45
gpfs_acl_handler::end
const gpfs_ace_v4_t * end() const
Definition: gpfsFcntlHandler.cpp:77