Blame view
fs/ext4/acl.h
1.5 KB
ac27a0ec1 [PATCH] ext4: ini... |
1 |
/* |
617ba13b3 [PATCH] ext4: ren... |
2 |
File: fs/ext4/acl.h |
ac27a0ec1 [PATCH] ext4: ini... |
3 4 5 6 7 |
(C) 2001 Andreas Gruenbacher, <a.gruenbacher@computer.org> */ #include <linux/posix_acl_xattr.h> |
617ba13b3 [PATCH] ext4: ren... |
8 |
#define EXT4_ACL_VERSION 0x0001 |
ac27a0ec1 [PATCH] ext4: ini... |
9 10 11 12 13 |
typedef struct { __le16 e_tag; __le16 e_perm; __le32 e_id; |
617ba13b3 [PATCH] ext4: ren... |
14 |
} ext4_acl_entry; |
ac27a0ec1 [PATCH] ext4: ini... |
15 16 17 18 |
typedef struct { __le16 e_tag; __le16 e_perm; |
617ba13b3 [PATCH] ext4: ren... |
19 |
} ext4_acl_entry_short; |
ac27a0ec1 [PATCH] ext4: ini... |
20 21 22 |
typedef struct { __le32 a_version; |
617ba13b3 [PATCH] ext4: ren... |
23 |
} ext4_acl_header; |
ac27a0ec1 [PATCH] ext4: ini... |
24 |
|
617ba13b3 [PATCH] ext4: ren... |
25 |
static inline size_t ext4_acl_size(int count) |
ac27a0ec1 [PATCH] ext4: ini... |
26 27 |
{ if (count <= 4) { |
617ba13b3 [PATCH] ext4: ren... |
28 29 |
return sizeof(ext4_acl_header) + count * sizeof(ext4_acl_entry_short); |
ac27a0ec1 [PATCH] ext4: ini... |
30 |
} else { |
617ba13b3 [PATCH] ext4: ren... |
31 32 33 |
return sizeof(ext4_acl_header) + 4 * sizeof(ext4_acl_entry_short) + (count - 4) * sizeof(ext4_acl_entry); |
ac27a0ec1 [PATCH] ext4: ini... |
34 35 |
} } |
617ba13b3 [PATCH] ext4: ren... |
36 |
static inline int ext4_acl_count(size_t size) |
ac27a0ec1 [PATCH] ext4: ini... |
37 38 |
{ ssize_t s; |
617ba13b3 [PATCH] ext4: ren... |
39 40 |
size -= sizeof(ext4_acl_header); s = size - 4 * sizeof(ext4_acl_entry_short); |
ac27a0ec1 [PATCH] ext4: ini... |
41 |
if (s < 0) { |
617ba13b3 [PATCH] ext4: ren... |
42 |
if (size % sizeof(ext4_acl_entry_short)) |
ac27a0ec1 [PATCH] ext4: ini... |
43 |
return -1; |
617ba13b3 [PATCH] ext4: ren... |
44 |
return size / sizeof(ext4_acl_entry_short); |
ac27a0ec1 [PATCH] ext4: ini... |
45 |
} else { |
617ba13b3 [PATCH] ext4: ren... |
46 |
if (s % sizeof(ext4_acl_entry)) |
ac27a0ec1 [PATCH] ext4: ini... |
47 |
return -1; |
617ba13b3 [PATCH] ext4: ren... |
48 |
return s / sizeof(ext4_acl_entry) + 4; |
ac27a0ec1 [PATCH] ext4: ini... |
49 50 |
} } |
03010a335 ext4: Rename ext4... |
51 |
#ifdef CONFIG_EXT4_FS_POSIX_ACL |
ac27a0ec1 [PATCH] ext4: ini... |
52 |
|
ac27a0ec1 [PATCH] ext4: ini... |
53 |
/* acl.c */ |
4e34e719e fs: take the ACL ... |
54 |
struct posix_acl *ext4_get_acl(struct inode *inode, int type); |
64e178a71 ext2/3/4: use gen... |
55 |
int ext4_set_acl(struct inode *inode, struct posix_acl *acl, int type); |
af5bc92dd ext4: Fix whitesp... |
56 |
extern int ext4_init_acl(handle_t *, struct inode *, struct inode *); |
ac27a0ec1 [PATCH] ext4: ini... |
57 |
|
03010a335 ext4: Rename ext4... |
58 |
#else /* CONFIG_EXT4_FS_POSIX_ACL */ |
ac27a0ec1 [PATCH] ext4: ini... |
59 |
#include <linux/sched.h> |
4e34e719e fs: take the ACL ... |
60 |
#define ext4_get_acl NULL |
64e178a71 ext2/3/4: use gen... |
61 |
#define ext4_set_acl NULL |
ac27a0ec1 [PATCH] ext4: ini... |
62 63 |
static inline int |
617ba13b3 [PATCH] ext4: ren... |
64 |
ext4_init_acl(handle_t *handle, struct inode *inode, struct inode *dir) |
ac27a0ec1 [PATCH] ext4: ini... |
65 66 67 |
{ return 0; } |
03010a335 ext4: Rename ext4... |
68 |
#endif /* CONFIG_EXT4_FS_POSIX_ACL */ |
ac27a0ec1 [PATCH] ext4: ini... |
69 |