head	1.1;
access;
symbols
	LKML-branch:1.1.0.2;
locks; strict;
comment	@# @;


1.1
date	2006.10.07.21.50.04;	author jsipek;	state dead;
branches
	1.1.2.1;
next	;

1.1.2.1
date	2006.10.07.21.50.04;	author jsipek;	state Exp;
branches;
next	1.1.2.2;

1.1.2.2
date	2006.10.07.23.03.14;	author jsipek;	state Exp;
branches;
next	1.1.2.3;

1.1.2.3
date	2006.10.09.23.36.03;	author jsipek;	state dead;
branches;
next	;


desc
@@


1.1
log
@file vfs_listxattr was initially added on branch LKML-branch.
@
text
@@


1.1.2.1
log
@Reintroduce xattr code
@
text
@a0 68
diff -r 0231458fbb78 fs/xattr.c
--- a/fs/xattr.c	Sat Oct 07 16:46:17 2006 -0400
+++ b/fs/xattr.c	Sat Oct 07 17:36:18 2006 -0400
@@@@ -135,6 +135,26 @@@@ vfs_getxattr(struct dentry *dentry, char
 }
 EXPORT_SYMBOL_GPL(vfs_getxattr);
 
+ssize_t
+vfs_listxattr(struct dentry *d, char *list, size_t size)
+{
+	ssize_t error;
+
+	error = security_inode_listxattr(d);
+	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 (size && error > size)
+			error = -ERANGE;
+	}
+	return error;
+}
+EXPORT_SYMBOL_GPL(vfs_listxattr);
+
 int
 vfs_removexattr(struct dentry *dentry, char *name)
 {
@@@@ -346,17 +366,7 @@@@ listxattr(struct dentry *d, char __user 
 			return -ENOMEM;
 	}
 
-	error = security_inode_listxattr(d);
-	if (error)
-		goto out;
-	error = -EOPNOTSUPP;
-	if (d->d_inode->i_op && d->d_inode->i_op->listxattr) {
-		error = d->d_inode->i_op->listxattr(d, klist, size);
-	} else {
-		error = security_inode_listsecurity(d->d_inode, klist, size);
-		if (size && error > size)
-			error = -ERANGE;
-	}
+	error = vfs_listxattr(d, klist, size);
 	if (error > 0) {
 		if (size && copy_to_user(list, klist, error))
 			error = -EFAULT;
@@@@ -365,7 +375,6 @@@@ listxattr(struct dentry *d, char __user 
 		   than XATTR_LIST_MAX bytes. Not possible. */
 		error = -E2BIG;
 	}
-out:
 	kfree(klist);
 	return error;
 }
diff -r 0231458fbb78 include/linux/xattr.h
--- a/include/linux/xattr.h	Sat Oct 07 16:46:17 2006 -0400
+++ b/include/linux/xattr.h	Sat Oct 07 17:32:43 2006 -0400
@@@@ -41,6 +41,7 @@@@ struct xattr_handler {
 };
 
 ssize_t vfs_getxattr(struct dentry *, char *, void *, size_t);
+ssize_t vfs_listxattr(struct dentry *d, char *list, size_t size);
 int vfs_setxattr(struct dentry *, char *, void *, size_t, int);
 int vfs_removexattr(struct dentry *, char *);
 
@


1.1.2.2
log
@header/email portion for the vfs_listxattr patch
@
text
@a0 12
vfs_listxattr

Cc: Bill Nottingham <notting@@redhat.com>

From: Bill Nottingham <notting@@redhat.com>

This patch moves code out of fs/xattr.c:listxattr into a new function -
vfs_listxattr. The code for vfs_listxattr was originally submitted by Bill
Nottingham <notting@@redhat.com> to Unionfs.

Signed-off-by: Josef "Jeff" Sipek <jsipek@@cs.sunysb.edu>

@


1.1.2.3
log
@vfs_listxattr is upstream
@
text
@@


