diff options
author | Ryan O'Hara <rohara@redhat.com> | 2006-05-22 10:08:35 -0400 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2006-05-22 10:08:35 -0400 |
commit | 639b6d79b8c20cce4079fb035640c65456324d1c (patch) | |
tree | ef3cf33f8b7f3d943ced0e461e1987cd34fc8c42 /fs/gfs2/eattr.h | |
parent | d2f222e6310b073ae3d91b8d3d676621fae1314e (diff) | |
download | op-kernel-dev-639b6d79b8c20cce4079fb035640c65456324d1c.zip op-kernel-dev-639b6d79b8c20cce4079fb035640c65456324d1c.tar.gz |
[GFS2] selinux support
This adds support to GFS2 for selinux extended attributes. There is a
known bug in gfs2_ea_get() which is believed to be independant of this
patch. Further patches will follow once that bug is fixed in order to
make GFS2 use as much of the generic eattr infrastructure as possible.
Signed-off-by: Ryan O'Hara <rohara@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
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 19fb1dc4..ae19969 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__ */ |