All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Gruenbacher <agruen@suse.de>
To: Andrew Morton <akpm@digeo.com>, "Theodore Ts'o" <tytso@mit.edu>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] linux-2.5.43-mm1: Further xattr/acl cleanups
Date: Wed, 16 Oct 2002 23:15:32 +0200	[thread overview]
Message-ID: <200210162315.32574.agruen@suse.de> (raw)
In-Reply-To: <200210162232.00441.agruen@suse.de>

[-- Attachment #1: Type: text/plain, Size: 198 bytes --]

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.

[-- Attachment #2: mm1-incr2.diff --]
[-- Type: text/x-diff, Size: 1241 bytes --]

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

      reply	other threads:[~2002-10-16 21:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-15 22:20 [PATCH 2/3] Add extended attributes to ext2/3 tytso
2002-10-16  9:38 ` Henning P. Schmiedehausen
2002-10-16 16:16   ` Theodore Ts'o
2002-10-16 17:05     ` Andreas Dilger
2002-10-16 19:30       ` Theodore Ts'o
2002-10-19 18:36         ` Jan Kara
2002-10-16 17:50     ` Lorenzo Allegrucci
2002-10-16 18:32       ` Andreas Dilger
     [not found] ` <200210161336.27935.agruen@suse.de>
     [not found]   ` <3DAD8D5E.31E177BA@digeo.com>
2002-10-16 20:32     ` [PATCH] linux-2.5.43-mm1: Further xattr/acl cleanups Andreas Gruenbacher
2002-10-16 21:15       ` Andreas Gruenbacher [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200210162315.32574.agruen@suse.de \
    --to=agruen@suse.de \
    --cc=akpm@digeo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.