Blame view

include/linux/reiserfs_acl.h 1.8 KB
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
1
2
  #include <linux/init.h>
  #include <linux/posix_acl.h>
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
3
4
5
6
  
  #define REISERFS_ACL_VERSION	0x0001
  
  typedef struct {
bd4c625c0   Linus Torvalds   reiserfs: run scr...
7
8
9
  	__le16 e_tag;
  	__le16 e_perm;
  	__le32 e_id;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
10
11
12
  } reiserfs_acl_entry;
  
  typedef struct {
bd4c625c0   Linus Torvalds   reiserfs: run scr...
13
14
  	__le16 e_tag;
  	__le16 e_perm;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
15
16
17
  } reiserfs_acl_entry_short;
  
  typedef struct {
bd4c625c0   Linus Torvalds   reiserfs: run scr...
18
  	__le32 a_version;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
19
20
21
22
23
24
  } reiserfs_acl_header;
  
  static inline size_t reiserfs_acl_size(int count)
  {
  	if (count <= 4) {
  		return sizeof(reiserfs_acl_header) +
bd4c625c0   Linus Torvalds   reiserfs: run scr...
25
  		    count * sizeof(reiserfs_acl_entry_short);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
26
27
  	} else {
  		return sizeof(reiserfs_acl_header) +
bd4c625c0   Linus Torvalds   reiserfs: run scr...
28
29
  		    4 * sizeof(reiserfs_acl_entry_short) +
  		    (count - 4) * sizeof(reiserfs_acl_entry);
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
  	}
  }
  
  static inline int reiserfs_acl_count(size_t size)
  {
  	ssize_t s;
  	size -= sizeof(reiserfs_acl_header);
  	s = size - 4 * sizeof(reiserfs_acl_entry_short);
  	if (s < 0) {
  		if (size % sizeof(reiserfs_acl_entry_short))
  			return -1;
  		return size / sizeof(reiserfs_acl_entry_short);
  	} else {
  		if (s % sizeof(reiserfs_acl_entry))
  			return -1;
  		return s / sizeof(reiserfs_acl_entry) + 4;
  	}
  }
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
48
  #ifdef CONFIG_REISERFS_FS_POSIX_ACL
bd4c625c0   Linus Torvalds   reiserfs: run scr...
49
50
  struct posix_acl *reiserfs_get_acl(struct inode *inode, int type);
  int reiserfs_acl_chmod(struct inode *inode);
0ab2621eb   Jeff Mahoney   reiserfs: journal...
51
52
  int reiserfs_inherit_default_acl(struct reiserfs_transaction_handle *th,
  				 struct inode *dir, struct dentry *dentry,
bd4c625c0   Linus Torvalds   reiserfs: run scr...
53
54
  				 struct inode *inode);
  int reiserfs_cache_default_acl(struct inode *dir);
94d09a98c   Stephen Hemminger   reiserfs: constif...
55
56
  extern const struct xattr_handler reiserfs_posix_acl_default_handler;
  extern const struct xattr_handler reiserfs_posix_acl_access_handler;
cfe14677f   Alexey Dobriyan   [PATCH] reiserfs:...
57

1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
58
  #else
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
59
  #define reiserfs_cache_default_acl(inode) 0
4e34e719e   Christoph Hellwig   fs: take the ACL ...
60
  #define reiserfs_get_acl NULL
bc5e483da   Andrew Morton   [PATCH] reiserfs_...
61

bd4c625c0   Linus Torvalds   reiserfs: run scr...
62
  static inline int reiserfs_acl_chmod(struct inode *inode)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
63
  {
bd4c625c0   Linus Torvalds   reiserfs: run scr...
64
  	return 0;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
65
66
67
  }
  
  static inline int
77e465867   Alexander Beregalov   reiserfs: fix bui...
68
69
  reiserfs_inherit_default_acl(struct reiserfs_transaction_handle *th,
  			     const struct inode *dir, struct dentry *dentry,
bd4c625c0   Linus Torvalds   reiserfs: run scr...
70
  			     struct inode *inode)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
71
  {
bd4c625c0   Linus Torvalds   reiserfs: run scr...
72
  	return 0;
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
73
  }
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
74
  #endif