summaryrefslogtreecommitdiffstats
path: root/fs/gfs2/eattr.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/gfs2/eattr.h')
-rw-r--r--fs/gfs2/eattr.h17
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 + \
((GFS2_EA_IS_STUFFED(ea)) ? GFS2_EA_DATA_LEN(ea) : \
(sizeof(uint64_t) * (ea)->ea_num_ptrs)), 8)
-#define GFS2_EA_STRLEN(ea) \
-((((ea)->ea_type == GFS2_EATYPE_USR) ? 5 : 7) + (ea)->ea_name_len + 1)
-
#define GFS2_EA_IS_STUFFED(ea) (!(ea)->ea_num_ptrs)
#define GFS2_EA_IS_LAST(ea) ((ea)->ea_flags & GFS2_EAFLAG_LAST)
@@ -83,4 +80,18 @@ int gfs2_ea_get_copy(struct gfs2_inode *ip,
int gfs2_ea_acl_chmod(struct gfs2_inode *ip, struct gfs2_ea_location *el,
struct iattr *attr, char *data);
+static inline unsigned int gfs2_ea_strlen(struct gfs2_ea_header *ea)
+{
+ switch (ea->ea_type) {
+ case GFS2_EATYPE_USR:
+ return (5 + (ea->ea_name_len + 1));
+ case GFS2_EATYPE_SYS:
+ return (7 + (ea->ea_name_len + 1));
+ case GFS2_EATYPE_SECURITY:
+ return (9 + (ea->ea_name_len + 1));
+ default:
+ return (0);
+ }
+}
+
#endif /* __EATTR_DOT_H__ */