Messages in this thread Patch in this message | | | From | Andreas Gruenbacher <> | Subject | Re: [PATCH] linux-2.5.43-mm1: Further xattr/acl cleanups | Date | Wed, 16 Oct 2002 23:15:32 +0200 |
| |
This should do for now as a replacement for nfsd_get_posix_acl(), the only caller of ->[gs]et_posix_acl(). Please add along with the other NFS patches. (Did Ted port them already?)
--Andreas.This version of nfsd_get_posix_acl uses getxattr instead of the discarded get_posix_acl inode operation.
diff -Nur linux-2.5.43-mm1+/fs/nfsd/vfs.c linux-2.5.43-mm1++/fs/nfsd/vfs.c --- linux-2.5.43-mm1+/fs/nfsd/vfs.c 2002-10-16 05:27:53.000000000 +0200 +++ linux-2.5.43-mm1++/fs/nfsd/vfs.c 2002-10-16 23:02:39.000000000 +0200 @@ -42,6 +42,7 @@ #endif /* CONFIG_NFSD_V3 */ #include <linux/nfsd/nfsfh.h> #include <linux/quotaops.h> +#include <linux/xattr_acl.h> #include <asm/uaccess.h> @@ -1609,3 +1610,29 @@ nfsdstats.ra_size = cache_size; return 0; } + +#ifdef CONFIG_FS_POSIX_ACL +struct posix_acl * +nfsd_get_posix_acl(struct svc_fh *fhp, int type) +{ + struct inode *inode = fhp->fh_dentry->d_inode; + struct posix_acl *acl = NULL; + + if (IS_POSIXACL(inode)) { + int err, size = xattr_acl_size(64); /* reasonable max.size */ + void *buffer = kmalloc(size, GFP_KERNEL); + if (!buffer) + return ERR_PTR(-ENOMEM); + if (!fhp->fh_locked) + fh_lock(fhp); /* automatic unlocking */ + err = inode->i_op->getxattr(fhp->fh_dentry, + XATTR_NAME_ACL_ACCESS, + buffer, size); + acl = ERR_PTR(err); + if (err >= 0) + acl = posix_acl_from_xattr(buffer, err); + kfree(buffer); + } + return acl; +} +#endif | |