diff options
author | Christoph Hellwig <hch@infradead.org> | 2013-12-20 08:16:42 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2014-01-25 23:58:18 -0500 |
commit | 37bc15392a2363ca822b2c2828e0ccafbea32f75 (patch) | |
tree | 66ed7ab55227b74ad0af9d79bde0e95bb49e13ed /include/linux/posix_acl.h | |
parent | 5bf3258fd2acd8515450ab8efcd97c9d3b69f7f9 (diff) |
fs: make posix_acl_create more useful
Rename the current posix_acl_created to __posix_acl_create and add
a fully featured helper to set up the ACLs on file creation that
uses get_acl().
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/posix_acl.h')
-rw-r--r-- | include/linux/posix_acl.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/include/linux/posix_acl.h b/include/linux/posix_acl.h index 8b64e7899989..f7e6f6cb214a 100644 --- a/include/linux/posix_acl.h +++ b/include/linux/posix_acl.h | |||
@@ -88,14 +88,16 @@ extern int posix_acl_valid(const struct posix_acl *); | |||
88 | extern int posix_acl_permission(struct inode *, const struct posix_acl *, int); | 88 | extern int posix_acl_permission(struct inode *, const struct posix_acl *, int); |
89 | extern struct posix_acl *posix_acl_from_mode(umode_t, gfp_t); | 89 | extern struct posix_acl *posix_acl_from_mode(umode_t, gfp_t); |
90 | extern int posix_acl_equiv_mode(const struct posix_acl *, umode_t *); | 90 | extern int posix_acl_equiv_mode(const struct posix_acl *, umode_t *); |
91 | extern int posix_acl_create(struct posix_acl **, gfp_t, umode_t *); | 91 | extern int __posix_acl_create(struct posix_acl **, gfp_t, umode_t *); |
92 | extern int __posix_acl_chmod(struct posix_acl **, gfp_t, umode_t); | 92 | extern int __posix_acl_chmod(struct posix_acl **, gfp_t, umode_t); |
93 | 93 | ||
94 | extern struct posix_acl *get_posix_acl(struct inode *, int); | 94 | extern struct posix_acl *get_posix_acl(struct inode *, int); |
95 | extern int set_posix_acl(struct inode *, int, struct posix_acl *); | 95 | extern int set_posix_acl(struct inode *, int, struct posix_acl *); |
96 | 96 | ||
97 | #ifdef CONFIG_FS_POSIX_ACL | 97 | #ifdef CONFIG_FS_POSIX_ACL |
98 | extern int posix_acl_chmod(struct inode *); | 98 | extern int posix_acl_chmod(struct inode *, umode_t); |
99 | extern int posix_acl_create(struct inode *, umode_t *, struct posix_acl **, | ||
100 | struct posix_acl **); | ||
99 | 101 | ||
100 | static inline struct posix_acl **acl_by_type(struct inode *inode, int type) | 102 | static inline struct posix_acl **acl_by_type(struct inode *inode, int type) |
101 | { | 103 | { |
@@ -174,7 +176,7 @@ static inline void cache_no_acl(struct inode *inode) | |||
174 | inode->i_default_acl = NULL; | 176 | inode->i_default_acl = NULL; |
175 | } | 177 | } |
176 | #else | 178 | #else |
177 | static inline int posix_acl_chmod(struct inode *inode) | 179 | static inline int posix_acl_chmod(struct inode *inode, umode_t mode) |
178 | { | 180 | { |
179 | return 0; | 181 | return 0; |
180 | } | 182 | } |
@@ -182,6 +184,13 @@ static inline int posix_acl_chmod(struct inode *inode) | |||
182 | static inline void cache_no_acl(struct inode *inode) | 184 | static inline void cache_no_acl(struct inode *inode) |
183 | { | 185 | { |
184 | } | 186 | } |
187 | |||
188 | static inline int posix_acl_create(struct inode *inode, umode_t *mode, | ||
189 | struct posix_acl **default_acl, struct posix_acl **acl) | ||
190 | { | ||
191 | *default_acl = *acl = NULL; | ||
192 | return 0; | ||
193 | } | ||
185 | #endif /* CONFIG_FS_POSIX_ACL */ | 194 | #endif /* CONFIG_FS_POSIX_ACL */ |
186 | 195 | ||
187 | struct posix_acl *get_acl(struct inode *inode, int type); | 196 | struct posix_acl *get_acl(struct inode *inode, int type); |