Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933217AbXBES1b (ORCPT ); Mon, 5 Feb 2007 13:27:31 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S933189AbXBES1I (ORCPT ); Mon, 5 Feb 2007 13:27:08 -0500 Received: from mail.suse.de ([195.135.220.2]:43508 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933216AbXBES1D (ORCPT ); Mon, 5 Feb 2007 13:27:03 -0500 From: Tony Jones To: linux-kernel@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org, chrisw@sous-sol.org, Tony Jones , linux-security-module@vger.kernel.org, agruen@suse.de Date: Mon, 05 Feb 2007 10:26:05 -0800 Message-Id: <20070205182605.12164.22468.sendpatchset@ermintrude.int.wirex.com> In-Reply-To: <20070205182213.12164.40927.sendpatchset@ermintrude.int.wirex.com> References: <20070205182213.12164.40927.sendpatchset@ermintrude.int.wirex.com> Subject: [RFC 25/28] Add a struct vfsmount parameter to vfs_listxattr() Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3392 Lines: 101 Add a struct vfsmount parameter to vfs_listxattr() Signed-off-by: Tony Jones Signed-off-by: Andreas Gruenbacher Index: linux-2.6/fs/xattr.c =================================================================== --- linux-2.6.orig/fs/xattr.c +++ linux-2.6/fs/xattr.c @@ -144,18 +144,20 @@ vfs_getxattr(struct dentry *dentry, stru EXPORT_SYMBOL_GPL(vfs_getxattr); ssize_t -vfs_listxattr(struct dentry *d, char *list, size_t size) +vfs_listxattr(struct dentry *dentry, struct vfsmount *mnt, char *list, + size_t size) { + struct inode *inode = dentry->d_inode; ssize_t error; - error = security_inode_listxattr(d); + error = security_inode_listxattr(dentry); if (error) return error; error = -EOPNOTSUPP; - if (d->d_inode->i_op && d->d_inode->i_op->listxattr) { - error = d->d_inode->i_op->listxattr(d, list, size); - } else { - error = security_inode_listsecurity(d->d_inode, list, size); + if (inode->i_op && inode->i_op->listxattr) + error = inode->i_op->listxattr(dentry, list, size); + else { + error = security_inode_listsecurity(inode, list, size); if (size && error > size) error = -ERANGE; } @@ -362,7 +364,8 @@ sys_fgetxattr(int fd, char __user *name, * Extended attribute LIST operations */ static ssize_t -listxattr(struct dentry *d, char __user *list, size_t size) +listxattr(struct dentry *dentry, struct vfsmount *mnt, char __user *list, + size_t size) { ssize_t error; char *klist = NULL; @@ -375,7 +378,7 @@ listxattr(struct dentry *d, char __user return -ENOMEM; } - error = vfs_listxattr(d, klist, size); + error = vfs_listxattr(dentry, mnt, klist, size); if (error > 0) { if (size && copy_to_user(list, klist, error)) error = -EFAULT; @@ -397,7 +400,7 @@ sys_listxattr(char __user *path, char __ error = user_path_walk(path, &nd); if (error) return error; - error = listxattr(nd.dentry, list, size); + error = listxattr(nd.dentry, nd.mnt, list, size); path_release(&nd); return error; } @@ -411,7 +414,7 @@ sys_llistxattr(char __user *path, char _ error = user_path_walk_link(path, &nd); if (error) return error; - error = listxattr(nd.dentry, list, size); + error = listxattr(nd.dentry, nd.mnt, list, size); path_release(&nd); return error; } @@ -425,7 +428,7 @@ sys_flistxattr(int fd, char __user *list f = fget(fd); if (!f) return error; - error = listxattr(f->f_path.dentry, list, size); + error = listxattr(f->f_path.dentry, f->f_path.mnt, list, size); fput(f); return error; } Index: linux-2.6/include/linux/xattr.h =================================================================== --- linux-2.6.orig/include/linux/xattr.h +++ linux-2.6/include/linux/xattr.h @@ -42,7 +42,8 @@ struct xattr_handler { ssize_t vfs_getxattr(struct dentry *, struct vfsmount *, char *, void *, size_t); -ssize_t vfs_listxattr(struct dentry *d, char *list, size_t size); +ssize_t vfs_listxattr(struct dentry *d, struct vfsmount *, char *list, + size_t size); int vfs_setxattr(struct dentry *, struct vfsmount *, char *, void *, size_t, int); int vfs_removexattr(struct dentry *, char *); - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/