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) |
[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 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__ */ |