diff options
author | Andrew Morton <akpm@digeo.com> | 2003-02-14 20:23:09 -0800 |
---|---|---|
committer | Jens Axboe <axboe@suse.de> | 2003-02-14 20:23:09 -0800 |
commit | 36bc191be20a215b258d28ee451682717186f172 (patch) | |
tree | 383d20766f120107efacf1cb1e6405dc6f92f5ff /fs/ext3/xattr.c | |
parent | af8e38c781986180d4d751106c969e846772c487 (diff) | |
download | history-36bc191be20a215b258d28ee451682717186f172.tar.gz |
[PATCH] xattr: infrastructure for permission overrides
Patch from Andreas Gruenbacher <agruen@suse.de>
This adds flags parameters to the getxattr, listxattr, and removexattr inode
operations. This is in preparation for the next patch, which allows
in-kernel code (i.e., modules) to override extended attribute permission
restrictions (which in turn is used by HSM implementations and the like).
Diffstat (limited to 'fs/ext3/xattr.c')
-rw-r--r-- | fs/ext3/xattr.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/fs/ext3/xattr.c b/fs/ext3/xattr.c index 672715bd7560e5..7c1c40f687b6e2 100644 --- a/fs/ext3/xattr.c +++ b/fs/ext3/xattr.c @@ -195,7 +195,7 @@ ext3_xattr_handler(int name_index) */ ssize_t ext3_getxattr(struct dentry *dentry, const char *name, - void *buffer, size_t size) + void *buffer, size_t size, int flags) { struct ext3_xattr_handler *handler; struct inode *inode = dentry->d_inode; @@ -203,7 +203,7 @@ ext3_getxattr(struct dentry *dentry, const char *name, handler = ext3_xattr_resolve_name(&name); if (!handler) return -EOPNOTSUPP; - return handler->get(inode, name, buffer, size); + return handler->get(inode, name, buffer, size, flags); } /* @@ -212,9 +212,9 @@ ext3_getxattr(struct dentry *dentry, const char *name, * dentry->d_inode->i_sem down */ ssize_t -ext3_listxattr(struct dentry *dentry, char *buffer, size_t size) +ext3_listxattr(struct dentry *dentry, char *buffer, size_t size, int flags) { - return ext3_xattr_list(dentry->d_inode, buffer, size); + return ext3_xattr_list(dentry->d_inode, buffer, size, flags); } /* @@ -243,7 +243,7 @@ ext3_setxattr(struct dentry *dentry, const char *name, * dentry->d_inode->i_sem down */ int -ext3_removexattr(struct dentry *dentry, const char *name) +ext3_removexattr(struct dentry *dentry, const char *name, int flags) { struct ext3_xattr_handler *handler; struct inode *inode = dentry->d_inode; @@ -251,7 +251,7 @@ ext3_removexattr(struct dentry *dentry, const char *name) handler = ext3_xattr_resolve_name(&name); if (!handler) return -EOPNOTSUPP; - return handler->set(inode, name, NULL, 0, XATTR_REPLACE); + return handler->set(inode, name, NULL, 0, flags | XATTR_REPLACE); } /* @@ -364,7 +364,8 @@ cleanup: * used / required on success. */ int -ext3_xattr_list(struct inode *inode, char *buffer, size_t buffer_size) +ext3_xattr_list(struct inode *inode, char *buffer, size_t buffer_size, + int flags) { struct buffer_head *bh = NULL; struct ext3_xattr_entry *entry; @@ -404,7 +405,7 @@ bad_block: ext3_error(inode->i_sb, "ext3_xattr_list", handler = ext3_xattr_handler(entry->e_name_index); if (handler) size += handler->list(NULL, inode, entry->e_name, - entry->e_name_len); + entry->e_name_len, flags); } if (ext3_xattr_cache_insert(bh)) @@ -427,7 +428,7 @@ bad_block: ext3_error(inode->i_sb, "ext3_xattr_list", handler = ext3_xattr_handler(entry->e_name_index); if (handler) buf += handler->list(buf, inode, entry->e_name, - entry->e_name_len); + entry->e_name_len, flags); } error = size; |