diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-03-17 01:03:10 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-03-20 21:29:42 -0400 |
commit | a3063ab88fcbe5249f841cb95dfd626b8bf2674f (patch) | |
tree | bb3304f3317a4075cee2926b39867336cae708b0 /fs/reiserfs | |
parent | c45ac8887e778c4fa2b572c51a94a681a0955d4d (diff) |
move reiserfs_acl.h to fs/reiserfs/acl.h
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/reiserfs')
-rw-r--r-- | fs/reiserfs/acl.h | 76 | ||||
-rw-r--r-- | fs/reiserfs/file.c | 2 | ||||
-rw-r--r-- | fs/reiserfs/inode.c | 2 | ||||
-rw-r--r-- | fs/reiserfs/namei.c | 2 | ||||
-rw-r--r-- | fs/reiserfs/super.c | 2 | ||||
-rw-r--r-- | fs/reiserfs/xattr.c | 2 | ||||
-rw-r--r-- | fs/reiserfs/xattr_acl.c | 2 |
7 files changed, 82 insertions, 6 deletions
diff --git a/fs/reiserfs/acl.h b/fs/reiserfs/acl.h new file mode 100644 index 000000000000..f096b80e73d8 --- /dev/null +++ b/fs/reiserfs/acl.h | |||
@@ -0,0 +1,76 @@ | |||
1 | #include <linux/init.h> | ||
2 | #include <linux/posix_acl.h> | ||
3 | |||
4 | #define REISERFS_ACL_VERSION 0x0001 | ||
5 | |||
6 | typedef struct { | ||
7 | __le16 e_tag; | ||
8 | __le16 e_perm; | ||
9 | __le32 e_id; | ||
10 | } reiserfs_acl_entry; | ||
11 | |||
12 | typedef struct { | ||
13 | __le16 e_tag; | ||
14 | __le16 e_perm; | ||
15 | } reiserfs_acl_entry_short; | ||
16 | |||
17 | typedef struct { | ||
18 | __le32 a_version; | ||
19 | } reiserfs_acl_header; | ||
20 | |||
21 | static inline size_t reiserfs_acl_size(int count) | ||
22 | { | ||
23 | if (count <= 4) { | ||
24 | return sizeof(reiserfs_acl_header) + | ||
25 | count * sizeof(reiserfs_acl_entry_short); | ||
26 | } else { | ||
27 | return sizeof(reiserfs_acl_header) + | ||
28 | 4 * sizeof(reiserfs_acl_entry_short) + | ||
29 | (count - 4) * sizeof(reiserfs_acl_entry); | ||
30 | } | ||
31 | } | ||
32 | |||
33 | static inline int reiserfs_acl_count(size_t size) | ||
34 | { | ||
35 | ssize_t s; | ||
36 | size -= sizeof(reiserfs_acl_header); | ||
37 | s = size - 4 * sizeof(reiserfs_acl_entry_short); | ||
38 | if (s < 0) { | ||
39 | if (size % sizeof(reiserfs_acl_entry_short)) | ||
40 | return -1; | ||
41 | return size / sizeof(reiserfs_acl_entry_short); | ||
42 | } else { | ||
43 | if (s % sizeof(reiserfs_acl_entry)) | ||
44 | return -1; | ||
45 | return s / sizeof(reiserfs_acl_entry) + 4; | ||
46 | } | ||
47 | } | ||
48 | |||
49 | #ifdef CONFIG_REISERFS_FS_POSIX_ACL | ||
50 | struct posix_acl *reiserfs_get_acl(struct inode *inode, int type); | ||
51 | int reiserfs_acl_chmod(struct inode *inode); | ||
52 | int reiserfs_inherit_default_acl(struct reiserfs_transaction_handle *th, | ||
53 | struct inode *dir, struct dentry *dentry, | ||
54 | struct inode *inode); | ||
55 | int reiserfs_cache_default_acl(struct inode *dir); | ||
56 | extern const struct xattr_handler reiserfs_posix_acl_default_handler; | ||
57 | extern const struct xattr_handler reiserfs_posix_acl_access_handler; | ||
58 | |||
59 | #else | ||
60 | |||
61 | #define reiserfs_cache_default_acl(inode) 0 | ||
62 | #define reiserfs_get_acl NULL | ||
63 | |||
64 | static inline int reiserfs_acl_chmod(struct inode *inode) | ||
65 | { | ||
66 | return 0; | ||
67 | } | ||
68 | |||
69 | static inline int | ||
70 | reiserfs_inherit_default_acl(struct reiserfs_transaction_handle *th, | ||
71 | const struct inode *dir, struct dentry *dentry, | ||
72 | struct inode *inode) | ||
73 | { | ||
74 | return 0; | ||
75 | } | ||
76 | #endif | ||
diff --git a/fs/reiserfs/file.c b/fs/reiserfs/file.c index e26ee4988e78..3fa5915dea6e 100644 --- a/fs/reiserfs/file.c +++ b/fs/reiserfs/file.c | |||
@@ -4,7 +4,7 @@ | |||
4 | 4 | ||
5 | #include <linux/time.h> | 5 | #include <linux/time.h> |
6 | #include <linux/reiserfs_fs.h> | 6 | #include <linux/reiserfs_fs.h> |
7 | #include <linux/reiserfs_acl.h> | 7 | #include "acl.h" |
8 | #include "xattr.h" | 8 | #include "xattr.h" |
9 | #include <asm/uaccess.h> | 9 | #include <asm/uaccess.h> |
10 | #include <linux/pagemap.h> | 10 | #include <linux/pagemap.h> |
diff --git a/fs/reiserfs/inode.c b/fs/reiserfs/inode.c index 894c7316e9c6..b696493d6b66 100644 --- a/fs/reiserfs/inode.c +++ b/fs/reiserfs/inode.c | |||
@@ -5,7 +5,7 @@ | |||
5 | #include <linux/time.h> | 5 | #include <linux/time.h> |
6 | #include <linux/fs.h> | 6 | #include <linux/fs.h> |
7 | #include <linux/reiserfs_fs.h> | 7 | #include <linux/reiserfs_fs.h> |
8 | #include <linux/reiserfs_acl.h> | 8 | #include "acl.h" |
9 | #include "xattr.h" | 9 | #include "xattr.h" |
10 | #include <linux/exportfs.h> | 10 | #include <linux/exportfs.h> |
11 | #include <linux/pagemap.h> | 11 | #include <linux/pagemap.h> |
diff --git a/fs/reiserfs/namei.c b/fs/reiserfs/namei.c index cb67ebf882a9..34bdab29883b 100644 --- a/fs/reiserfs/namei.c +++ b/fs/reiserfs/namei.c | |||
@@ -15,7 +15,7 @@ | |||
15 | #include <linux/bitops.h> | 15 | #include <linux/bitops.h> |
16 | #include <linux/slab.h> | 16 | #include <linux/slab.h> |
17 | #include <linux/reiserfs_fs.h> | 17 | #include <linux/reiserfs_fs.h> |
18 | #include <linux/reiserfs_acl.h> | 18 | #include "acl.h" |
19 | #include "xattr.h" | 19 | #include "xattr.h" |
20 | #include <linux/quotaops.h> | 20 | #include <linux/quotaops.h> |
21 | 21 | ||
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c index a67fc7d28de5..cf68a6ba0ec6 100644 --- a/fs/reiserfs/super.c +++ b/fs/reiserfs/super.c | |||
@@ -17,7 +17,7 @@ | |||
17 | #include <linux/time.h> | 17 | #include <linux/time.h> |
18 | #include <asm/uaccess.h> | 18 | #include <asm/uaccess.h> |
19 | #include <linux/reiserfs_fs.h> | 19 | #include <linux/reiserfs_fs.h> |
20 | #include <linux/reiserfs_acl.h> | 20 | #include "acl.h" |
21 | #include "xattr.h" | 21 | #include "xattr.h" |
22 | #include <linux/init.h> | 22 | #include <linux/init.h> |
23 | #include <linux/blkdev.h> | 23 | #include <linux/blkdev.h> |
diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c index ead5d8aab440..61c9b5633e27 100644 --- a/fs/reiserfs/xattr.c +++ b/fs/reiserfs/xattr.c | |||
@@ -44,7 +44,7 @@ | |||
44 | #include <linux/pagemap.h> | 44 | #include <linux/pagemap.h> |
45 | #include <linux/xattr.h> | 45 | #include <linux/xattr.h> |
46 | #include "xattr.h" | 46 | #include "xattr.h" |
47 | #include <linux/reiserfs_acl.h> | 47 | #include "acl.h" |
48 | #include <asm/uaccess.h> | 48 | #include <asm/uaccess.h> |
49 | #include <net/checksum.h> | 49 | #include <net/checksum.h> |
50 | #include <linux/stat.h> | 50 | #include <linux/stat.h> |
diff --git a/fs/reiserfs/xattr_acl.c b/fs/reiserfs/xattr_acl.c index c0a8c519b2e1..f09094057eaa 100644 --- a/fs/reiserfs/xattr_acl.c +++ b/fs/reiserfs/xattr_acl.c | |||
@@ -8,7 +8,7 @@ | |||
8 | #include <linux/slab.h> | 8 | #include <linux/slab.h> |
9 | #include <linux/posix_acl_xattr.h> | 9 | #include <linux/posix_acl_xattr.h> |
10 | #include "xattr.h" | 10 | #include "xattr.h" |
11 | #include <linux/reiserfs_acl.h> | 11 | #include "acl.h" |
12 | #include <asm/uaccess.h> | 12 | #include <asm/uaccess.h> |
13 | 13 | ||
14 | static int reiserfs_set_acl(struct reiserfs_transaction_handle *th, | 14 | static int reiserfs_set_acl(struct reiserfs_transaction_handle *th, |