mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: tytso@mit.edu
Cc: linux-kernel@vger.kernel.org, ext2-devel@sourceforge.net
Subject: Re: [Ext2-devel] [RFC] [PATCH 1/5] ACL support for ext2/3
Date: Thu, 10 Oct 2002 19:34:33 +0100	[thread overview]
Message-ID: <20021010193433.A26873@infradead.org> (raw)
In-Reply-To: <E17zVaD-00069Y-00@snap.thunk.org>; from tytso@mit.edu on Thu, Oct 10, 2002 at 01:10:01AM -0400

> +#include <linux/version.h>

shouldn't be needed

> +#include <linux/kernel.h>
> +#include <linux/slab.h>
> +#include <asm/atomic.h>
> +#include <linux/fs.h>
> +#include <linux/posix_acl.h>
> +#include <linux/module.h>
> +
> +#include <linux/smp_lock.h>

not needed

> +MODULE_AUTHOR("Andreas Gruenbacher <a.gruenbacher@computer.org>");
> +MODULE_DESCRIPTION("Generic Posix Access Control List (ACL) Manipulation");
> +MODULE_LICENSE("GPL");

looks pretty pointless as this can't be a module.. :)

> +struct posix_acl *
> +get_posix_acl(struct inode *inode, int type)
> +{
> +	struct posix_acl *acl;
> +
> +	if (!inode->i_op->get_posix_acl)
> +		return ERR_PTR(-EOPNOTSUPP);
> +	down(&inode->i_sem);
> +	acl = inode->i_op->get_posix_acl(inode, type);
> +	up(&inode->i_sem);
> +
> +	return acl;
> +}
> +
> +/*
> + * Set the POSIX ACL of an inode.
> + */
> +int
> +set_posix_acl(struct inode *inode, int type, struct posix_acl *acl)
> +{
> +	int error;
> +
> +	if (!inode->i_op->set_posix_acl)
> +		return -EOPNOTSUPP;
> +	down(&inode->i_sem);
> +	error = inode->i_op->set_posix_acl(inode, type, acl);
> +	up(&inode->i_sem);
> +
> +	return error;
> +}
> diff -Nru a/include/linux/fs.h b/include/linux/fs.h
> --- a/include/linux/fs.h	Wed Oct  9 23:53:33 2002
> +++ b/include/linux/fs.h	Wed Oct  9 23:53:33 2002
> @@ -770,6 +770,9 @@
>  	unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
>  };
>  
> +/* posix_acl.h */
> +struct posix_acl;
> +
>  struct inode_operations {
>  	int (*create) (struct inode *,struct dentry *,int);
>  	struct dentry * (*lookup) (struct inode *,struct dentry *);
> @@ -791,6 +794,8 @@
>  	ssize_t (*getxattr) (struct dentry *, const char *, void *, size_t);
>  	ssize_t (*listxattr) (struct dentry *, char *, size_t);
>  	int (*removexattr) (struct dentry *, const char *);
> +	struct posix_acl *(*get_posix_acl) (struct inode *, int);
> +	int (*set_posix_acl) (struct inode *, int, struct posix_acl *);

Either you make all setting/retrieving of ACLs go through this interface or
just rip it.  We don't need more than one way to fiddle with ACLs.

Also they should take dentries..


  reply	other threads:[~2002-10-10 18:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-10  5:10 tytso
2002-10-10 18:34 ` Christoph Hellwig [this message]
2002-10-10 18:53   ` [Ext2-devel] " Andreas Gruenbacher

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=20021010193433.A26873@infradead.org \
    --to=hch@infradead.org \
    --cc=ext2-devel@sourceforge.net \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®