diff options
Diffstat (limited to 'fs/gfs2/eattr.h')
-rw-r--r-- | fs/gfs2/eattr.h | 52 |
1 files changed, 12 insertions, 40 deletions
diff --git a/fs/gfs2/eattr.h b/fs/gfs2/eattr.h index c82dbe01d713..4040a188f63b 100644 --- a/fs/gfs2/eattr.h +++ b/fs/gfs2/eattr.h | |||
@@ -27,10 +27,6 @@ ALIGN(sizeof(struct gfs2_ea_header) + (ea)->ea_name_len + \ | |||
27 | #define GFS2_EAREQ_SIZE_STUFFED(er) \ | 27 | #define GFS2_EAREQ_SIZE_STUFFED(er) \ |
28 | ALIGN(sizeof(struct gfs2_ea_header) + (er)->er_name_len + (er)->er_data_len, 8) | 28 | ALIGN(sizeof(struct gfs2_ea_header) + (er)->er_name_len + (er)->er_data_len, 8) |
29 | 29 | ||
30 | #define GFS2_EAREQ_SIZE_UNSTUFFED(sdp, er) \ | ||
31 | ALIGN(sizeof(struct gfs2_ea_header) + (er)->er_name_len + \ | ||
32 | sizeof(__be64) * DIV_ROUND_UP((er)->er_data_len, (sdp)->sd_jbsize), 8) | ||
33 | |||
34 | #define GFS2_EA2NAME(ea) ((char *)((struct gfs2_ea_header *)(ea) + 1)) | 30 | #define GFS2_EA2NAME(ea) ((char *)((struct gfs2_ea_header *)(ea) + 1)) |
35 | #define GFS2_EA2DATA(ea) (GFS2_EA2NAME(ea) + (ea)->ea_name_len) | 31 | #define GFS2_EA2DATA(ea) (GFS2_EA2NAME(ea) + (ea)->ea_name_len) |
36 | 32 | ||
@@ -43,16 +39,12 @@ ALIGN(sizeof(struct gfs2_ea_header) + (er)->er_name_len + \ | |||
43 | #define GFS2_EA_BH2FIRST(bh) \ | 39 | #define GFS2_EA_BH2FIRST(bh) \ |
44 | ((struct gfs2_ea_header *)((bh)->b_data + sizeof(struct gfs2_meta_header))) | 40 | ((struct gfs2_ea_header *)((bh)->b_data + sizeof(struct gfs2_meta_header))) |
45 | 41 | ||
46 | #define GFS2_ERF_MODE 0x80000000 | ||
47 | |||
48 | struct gfs2_ea_request { | 42 | struct gfs2_ea_request { |
49 | const char *er_name; | 43 | const char *er_name; |
50 | char *er_data; | 44 | char *er_data; |
51 | unsigned int er_name_len; | 45 | unsigned int er_name_len; |
52 | unsigned int er_data_len; | 46 | unsigned int er_data_len; |
53 | unsigned int er_type; /* GFS2_EATYPE_... */ | 47 | unsigned int er_type; /* GFS2_EATYPE_... */ |
54 | int er_flags; | ||
55 | mode_t er_mode; | ||
56 | }; | 48 | }; |
57 | 49 | ||
58 | struct gfs2_ea_location { | 50 | struct gfs2_ea_location { |
@@ -61,40 +53,20 @@ struct gfs2_ea_location { | |||
61 | struct gfs2_ea_header *el_prev; | 53 | struct gfs2_ea_header *el_prev; |
62 | }; | 54 | }; |
63 | 55 | ||
64 | int gfs2_ea_get_i(struct gfs2_inode *ip, struct gfs2_ea_request *er); | 56 | extern int gfs2_xattr_get(struct inode *inode, int type, const char *name, |
65 | int gfs2_ea_set_i(struct gfs2_inode *ip, struct gfs2_ea_request *er); | 57 | void *buffer, size_t size); |
66 | int gfs2_ea_remove_i(struct gfs2_inode *ip, struct gfs2_ea_request *er); | 58 | extern int gfs2_xattr_set(struct inode *inode, int type, const char *name, |
67 | 59 | const void *value, size_t size, int flags); | |
68 | int gfs2_ea_list(struct gfs2_inode *ip, struct gfs2_ea_request *er); | 60 | extern ssize_t gfs2_listxattr(struct dentry *dentry, char *buffer, size_t size); |
69 | int gfs2_ea_get(struct gfs2_inode *ip, struct gfs2_ea_request *er); | 61 | extern int gfs2_ea_dealloc(struct gfs2_inode *ip); |
70 | int gfs2_ea_set(struct gfs2_inode *ip, struct gfs2_ea_request *er); | ||
71 | int gfs2_ea_remove(struct gfs2_inode *ip, struct gfs2_ea_request *er); | ||
72 | |||
73 | int gfs2_ea_dealloc(struct gfs2_inode *ip); | ||
74 | 62 | ||
75 | /* Exported to acl.c */ | 63 | /* Exported to acl.c */ |
76 | 64 | ||
77 | int gfs2_ea_find(struct gfs2_inode *ip, | 65 | extern int gfs2_ea_find(struct gfs2_inode *ip, int type, const char *name, |
78 | struct gfs2_ea_request *er, | 66 | struct gfs2_ea_location *el); |
79 | struct gfs2_ea_location *el); | 67 | extern int gfs2_ea_get_copy(struct gfs2_inode *ip, struct gfs2_ea_location *el, |
80 | int gfs2_ea_get_copy(struct gfs2_inode *ip, | 68 | char *data, size_t size); |
81 | struct gfs2_ea_location *el, | 69 | extern int gfs2_ea_acl_chmod(struct gfs2_inode *ip, struct gfs2_ea_location *el, |
82 | char *data); | 70 | struct iattr *attr, char *data); |
83 | int gfs2_ea_acl_chmod(struct gfs2_inode *ip, struct gfs2_ea_location *el, | ||
84 | struct iattr *attr, char *data); | ||
85 | |||
86 | static inline unsigned int gfs2_ea_strlen(struct gfs2_ea_header *ea) | ||
87 | { | ||
88 | switch (ea->ea_type) { | ||
89 | case GFS2_EATYPE_USR: | ||
90 | return 5 + ea->ea_name_len + 1; | ||
91 | case GFS2_EATYPE_SYS: | ||
92 | return 7 + ea->ea_name_len + 1; | ||
93 | case GFS2_EATYPE_SECURITY: | ||
94 | return 9 + ea->ea_name_len + 1; | ||
95 | default: | ||
96 | return 0; | ||
97 | } | ||
98 | } | ||
99 | 71 | ||
100 | #endif /* __EATTR_DOT_H__ */ | 72 | #endif /* __EATTR_DOT_H__ */ |