diff options
Diffstat (limited to 'fs/gfs2/eattr.h')
-rw-r--r-- | fs/gfs2/eattr.h | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/fs/gfs2/eattr.h b/fs/gfs2/eattr.h index 19fb1dc4ddc4..ae199692e51d 100644 --- a/fs/gfs2/eattr.h +++ b/fs/gfs2/eattr.h | |||
@@ -18,9 +18,6 @@ ALIGN(sizeof(struct gfs2_ea_header) + (ea)->ea_name_len + \ | |||
18 | ((GFS2_EA_IS_STUFFED(ea)) ? GFS2_EA_DATA_LEN(ea) : \ | 18 | ((GFS2_EA_IS_STUFFED(ea)) ? GFS2_EA_DATA_LEN(ea) : \ |
19 | (sizeof(uint64_t) * (ea)->ea_num_ptrs)), 8) | 19 | (sizeof(uint64_t) * (ea)->ea_num_ptrs)), 8) |
20 | 20 | ||
21 | #define GFS2_EA_STRLEN(ea) \ | ||
22 | ((((ea)->ea_type == GFS2_EATYPE_USR) ? 5 : 7) + (ea)->ea_name_len + 1) | ||
23 | |||
24 | #define GFS2_EA_IS_STUFFED(ea) (!(ea)->ea_num_ptrs) | 21 | #define GFS2_EA_IS_STUFFED(ea) (!(ea)->ea_num_ptrs) |
25 | #define GFS2_EA_IS_LAST(ea) ((ea)->ea_flags & GFS2_EAFLAG_LAST) | 22 | #define GFS2_EA_IS_LAST(ea) ((ea)->ea_flags & GFS2_EAFLAG_LAST) |
26 | 23 | ||
@@ -83,4 +80,18 @@ int gfs2_ea_get_copy(struct gfs2_inode *ip, | |||
83 | int gfs2_ea_acl_chmod(struct gfs2_inode *ip, struct gfs2_ea_location *el, | 80 | int gfs2_ea_acl_chmod(struct gfs2_inode *ip, struct gfs2_ea_location *el, |
84 | struct iattr *attr, char *data); | 81 | struct iattr *attr, char *data); |
85 | 82 | ||
83 | static inline unsigned int gfs2_ea_strlen(struct gfs2_ea_header *ea) | ||
84 | { | ||
85 | switch (ea->ea_type) { | ||
86 | case GFS2_EATYPE_USR: | ||
87 | return (5 + (ea->ea_name_len + 1)); | ||
88 | case GFS2_EATYPE_SYS: | ||
89 | return (7 + (ea->ea_name_len + 1)); | ||
90 | case GFS2_EATYPE_SECURITY: | ||
91 | return (9 + (ea->ea_name_len + 1)); | ||
92 | default: | ||
93 | return (0); | ||
94 | } | ||
95 | } | ||
96 | |||
86 | #endif /* __EATTR_DOT_H__ */ | 97 | #endif /* __EATTR_DOT_H__ */ |