mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Howells <dhowells@redhat.com>
To: viro@ftp.linux.org.uk
Cc: kwc@citi.umich.edu, Trond.Myklebust@netapp.com,
	linux-kernel@vger.kernel.org, dhowells@redhat.com
Subject: [PATCH 28/52] CRED: Give the link() inode op a credentials pointer
Date: Fri, 12 Oct 2007 17:07:42 +0100	[thread overview]
Message-ID: <20071012160742.15119.31887.stgit@warthog.procyon.org.uk> (raw)
In-Reply-To: <20071012160519.15119.69608.stgit@warthog.procyon.org.uk>

Give the link() inode op a credentials pointer.

Signed-off-by: David Howells <dhowells@redhat.com>
---

 fs/afs/dir.c       |    4 ++--
 fs/bad_inode.c     |    2 +-
 fs/ext3/namei.c    |    3 +--
 fs/libfs.c         |    3 ++-
 fs/namei.c         |    3 ++-
 fs/nfs/dir.c       |    7 ++++---
 include/linux/fs.h |    6 ++++--
 mm/shmem.c         |    3 ++-
 8 files changed, 18 insertions(+), 13 deletions(-)

diff --git a/fs/afs/dir.c b/fs/afs/dir.c
index e495269..48f2759 100644
--- a/fs/afs/dir.c
+++ b/fs/afs/dir.c
@@ -35,7 +35,7 @@ static int afs_mkdir(struct inode *dir, struct dentry *dentry, int mode,
 static int afs_rmdir(struct inode *dir, struct dentry *dentry);
 static int afs_unlink(struct inode *dir, struct dentry *dentry);
 static int afs_link(struct dentry *from, struct inode *dir,
-		    struct dentry *dentry);
+		    struct dentry *dentry, struct cred *cred);
 static int afs_symlink(struct inode *dir, struct dentry *dentry,
 		       const char *content);
 static int afs_rename(struct inode *old_dir, struct dentry *old_dentry,
@@ -979,7 +979,7 @@ error:
  * create a hard link between files in an AFS filesystem
  */
 static int afs_link(struct dentry *from, struct inode *dir,
-		    struct dentry *dentry)
+		    struct dentry *dentry, struct cred *cred)
 {
 	struct afs_vnode *dvnode, *vnode;
 	struct key *key;
diff --git a/fs/bad_inode.c b/fs/bad_inode.c
index 3895f7d..a13970d 100644
--- a/fs/bad_inode.c
+++ b/fs/bad_inode.c
@@ -198,7 +198,7 @@ static struct dentry *bad_inode_lookup(struct inode *dir,
 }
 
 static int bad_inode_link (struct dentry *old_dentry, struct inode *dir,
-		struct dentry *dentry)
+		struct dentry *dentry, struct cred *cred)
 {
 	return -EIO;
 }
diff --git a/fs/ext3/namei.c b/fs/ext3/namei.c
index c007ef2..4c19acf 100644
--- a/fs/ext3/namei.c
+++ b/fs/ext3/namei.c
@@ -2254,9 +2254,8 @@ out_stop:
 }
 
 static int ext3_link (struct dentry * old_dentry,
-		struct inode * dir, struct dentry *dentry)
+		struct inode * dir, struct dentry *dentry, struct cred *cred)
 {
-	struct cred *cred = current->cred;
 	handle_t *handle;
 	struct inode *inode = old_dentry->d_inode;
 	int err, retries = 0;
diff --git a/fs/libfs.c b/fs/libfs.c
index 5294de1..d82eaaa 100644
--- a/fs/libfs.c
+++ b/fs/libfs.c
@@ -250,7 +250,8 @@ Enomem:
 	return -ENOMEM;
 }
 
-int simple_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry)
+int simple_link(struct dentry *old_dentry, struct inode *dir,
+		struct dentry *dentry, struct cred *cred)
 {
 	struct inode *inode = old_dentry->d_inode;
 
diff --git a/fs/namei.c b/fs/namei.c
index ef6041a..51e0322 100644
--- a/fs/namei.c
+++ b/fs/namei.c
@@ -2300,6 +2300,7 @@ asmlinkage long sys_symlink(const char __user *oldname, const char __user *newna
 
 int vfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *new_dentry)
 {
+	struct cred *cred = current->cred;
 	struct inode *inode = old_dentry->d_inode;
 	int error;
 
@@ -2329,7 +2330,7 @@ int vfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *new_de
 
 	mutex_lock(&old_dentry->d_inode->i_mutex);
 	DQUOT_INIT(dir);
-	error = dir->i_op->link(old_dentry, dir, new_dentry);
+	error = dir->i_op->link(old_dentry, dir, new_dentry, cred);
 	mutex_unlock(&old_dentry->d_inode->i_mutex);
 	if (!error)
 		fsnotify_create(dir, new_dentry);
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 833351e..4e12cf7 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -50,7 +50,8 @@ static int nfs_mkdir(struct inode *, struct dentry *, int, struct cred *);
 static int nfs_rmdir(struct inode *, struct dentry *);
 static int nfs_unlink(struct inode *, struct dentry *);
 static int nfs_symlink(struct inode *, struct dentry *, const char *);
-static int nfs_link(struct dentry *, struct inode *, struct dentry *);
+static int nfs_link(struct dentry *, struct inode *, struct dentry *,
+		    struct cred *);
 static int nfs_mknod(struct inode *, struct dentry *, int, dev_t,
 		     struct cred *);
 static int nfs_rename(struct inode *, struct dentry *,
@@ -1604,9 +1605,9 @@ static int nfs_symlink(struct inode *dir, struct dentry *dentry, const char *sym
 }
 
 static int 
-nfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry)
+nfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry,
+	 struct cred *acred)
 {
-	struct cred *acred = current->cred;
 	struct inode *inode = old_dentry->d_inode;
 	int error;
 
diff --git a/include/linux/fs.h b/include/linux/fs.h
index cb09038..d8cecd4 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -1138,7 +1138,8 @@ struct inode_operations {
 	int (*create) (struct inode *,struct dentry *,int, struct nameidata *,
 		       struct cred *);
 	struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *);
-	int (*link) (struct dentry *,struct inode *,struct dentry *);
+	int (*link) (struct dentry *,struct inode *,struct dentry *,
+		     struct cred *);
 	int (*unlink) (struct inode *,struct dentry *);
 	int (*symlink) (struct inode *,struct dentry *,const char *);
 	int (*mkdir) (struct inode *,struct dentry *,int, struct cred *);
@@ -1794,7 +1795,8 @@ extern loff_t dcache_dir_lseek(struct file *, loff_t, int);
 extern int dcache_readdir(struct file *, void *, filldir_t);
 extern int simple_getattr(struct vfsmount *, struct dentry *, struct kstat *);
 extern int simple_statfs(struct dentry *, struct kstatfs *);
-extern int simple_link(struct dentry *, struct inode *, struct dentry *);
+extern int simple_link(struct dentry *, struct inode *, struct dentry *,
+		       struct cred *);
 extern int simple_unlink(struct inode *, struct dentry *);
 extern int simple_rmdir(struct inode *, struct dentry *);
 extern int simple_rename(struct inode *, struct dentry *, struct inode *, struct dentry *);
diff --git a/mm/shmem.c b/mm/shmem.c
index 3fff09b..7358d14 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -1760,7 +1760,8 @@ static int shmem_create(struct inode *dir, struct dentry *dentry, int mode,
 /*
  * Link a file..
  */
-static int shmem_link(struct dentry *old_dentry, struct inode *dir, struct dentry *dentry)
+static int shmem_link(struct dentry *old_dentry, struct inode *dir,
+		      struct dentry *dentry, struct cred *cred)
 {
 	struct inode *inode = old_dentry->d_inode;
 	struct shmem_sb_info *sbinfo = SHMEM_SB(inode->i_sb);


  parent reply	other threads:[~2007-10-12 16:20 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-12 16:05 [PATCH 00/52] Introduce credential record David Howells
2007-10-12 16:05 ` [PATCH 01/52] CRED: Introduce a COW credentials record David Howells
2007-10-15  1:53   ` David Chinner
2007-10-12 16:05 ` [PATCH 02/52] CRED: Give in_group_p() a cred pointer David Howells
2007-10-12 16:05 ` [PATCH 03/52] CRED: Pass credentials down to ext3 block allocator David Howells
2007-10-12 16:05 ` [PATCH 04/52] CRED: Pass credentials down to ext3 inode allocator David Howells
2007-10-12 16:05 ` [PATCH 05/52] CRED: Prepare TMPFS for cred passing David Howells
2007-10-12 16:05 ` [PATCH 06/52] CRED: Prepare RAMFS " David Howells
2007-10-12 16:05 ` [PATCH 07/52] CRED: Pass credentials down to ext2 block allocator David Howells
2007-10-12 16:06 ` [PATCH 08/52] CRED: Pass credentials down to ext2 inode allocator David Howells
2007-10-12 16:06 ` [PATCH 09/52] CRED: Pass credentials down to ext4 block allocator David Howells
2007-10-12 16:06 ` [PATCH 10/52] CRED: Pass credentials down to ext4 inode allocator David Howells
2007-10-12 16:06 ` [PATCH 11/52] CRED: Give the get_block() callback a credentials pointer David Howells
2007-10-12 16:06 ` [PATCH 12/52] CRED: Make mpage read functions take " David Howells
2007-10-12 16:06 ` [PATCH 13/52] CRED: Make block_prepare_write() and co " David Howells
2007-10-12 16:06 ` [PATCH 14/52] CRED: Provide a writeback credentials record David Howells
2007-10-12 16:06 ` [PATCH 15/52] CRED: Make Ext3 use the writeback credentials David Howells
2007-10-12 16:06 ` [PATCH 16/52] CRED: Pass credentials through the internals of ext3 truncation David Howells
2007-10-12 16:06 ` [PATCH 17/52] CRED: Make rpcauth_lookupcred() take a credentials pointer David Howells
2007-10-12 16:06 ` [PATCH 18/52] CRED: Make rpcauth_bindcred() " David Howells
2007-10-12 16:06 ` [PATCH 19/52] CRED: Add a credentials pointer to struct rpc_task David Howells
2007-10-12 16:07 ` [PATCH 20/52] CRED: Pass credentials into rpc_init_task() David Howells
2007-10-12 16:07 ` [PATCH 21/52] CRED: Pass credentials through the truncate() inode operation David Howells
2007-10-12 16:07 ` [PATCH 22/52] CRED: Pass credentials to nfs_setattr_update_inode() David Howells
2007-10-12 16:07 ` [PATCH 23/52] CRED: Pass credentials to the setattr() inode operation David Howells
2007-10-12 16:07 ` [PATCH 24/52] CRED: Pass credentials through inode_setattr() David Howells
2007-10-12 16:07 ` [PATCH 25/52] CRED: Give the mknod() inode op a credentials pointer David Howells
2007-10-12 16:07 ` [PATCH 26/52] CRED: Give the mkdir() " David Howells
2007-10-12 16:07 ` [PATCH 27/52] CRED: Give the create() " David Howells
2007-10-12 16:07 ` David Howells [this message]
2007-10-12 16:07 ` [PATCH 29/52] CRED: Give the unlink() " David Howells
2007-10-12 16:07 ` [PATCH 30/52] CRED: Give the rmdir() " David Howells
2007-10-12 16:07 ` [PATCH 31/52] CRED: Give the rename() " David Howells
2007-10-12 16:08 ` [PATCH 32/52] CRED: Give the symlink() " David Howells
2007-10-12 16:08 ` [PATCH 33/52] CRED: Make the get_parent() export op take a credential pointer David Howells
2007-10-12 16:08 ` [PATCH 34/52] CRED: Make Ext3 ACL set handlers pass credentials down David Howells
2007-10-12 16:08 ` [PATCH 35/52] CRED: Make the ACL set() handler take a credentials pointer David Howells
2007-10-12 16:08 ` [PATCH 36/52] CRED: Make ext3_fill_super() pass credentials down David Howells
2007-10-12 16:08 ` [PATCH 37/52] CRED: Pass credentials to the get_sb() op and various fill_super() ops David Howells
2007-10-12 16:08 ` [PATCH 38/52] CRED: Pass credentials through the quota_read() op David Howells
2007-10-12 16:08 ` [PATCH 39/52] CRED: Pass credentials through the quota_write() op David Howells
2007-10-12 16:08 ` [PATCH 40/52] CRED: Give the lookup() inode op a credentials pointer David Howells
2007-10-12 16:08 ` [PATCH 41/52] CRED: Pass credentials through d_revalidate() David Howells
2007-10-12 16:08 ` [PATCH 42/52] CRED: Pass credentials through the permission() inode op David Howells
2007-10-12 16:08 ` [PATCH 43/52] CRED: Pass credentials through the statfs() superblock op David Howells
2007-10-12 16:09 ` [PATCH 44/52] CRED: Pass credentials through the follow_link() inode op David Howells
2007-10-12 16:09 ` [PATCH 45/52] CRED: Pass credentials through the getattr() " David Howells
2007-10-12 16:09 ` [PATCH 46/52] CRED: Pass credentials through the setxattr() " David Howells
2007-10-12 16:09 ` [PATCH 47/52] CRED: Pass credentials through the xattr get() handler David Howells
2007-10-12 16:09 ` [PATCH 48/52] CRED: Pass credentials through the getxattr() inode op David Howells
2007-10-12 16:09 ` [PATCH 49/52] CRED: Pass credentials through the xattr list() handler David Howells
2007-10-12 16:09 ` [PATCH 50/52] CRED: Pass credentials through the listxattr() inode op David Howells
2007-10-12 16:09 ` [PATCH 51/52] CRED: Pass credentials through the removexattr() " David Howells
2007-10-12 16:09 ` [PATCH 52/52] CRED: Pass credentials through vfs_mkdir() David Howells
2007-10-13 18:11 ` [PATCH 00/52] Introduce credential record Theodore Tso
2007-10-13 18:19   ` Al Viro
2007-10-13 21:46 ` David Howells

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=20071012160742.15119.31887.stgit@warthog.procyon.org.uk \
    --to=dhowells@redhat.com \
    --cc=Trond.Myklebust@netapp.com \
    --cc=kwc@citi.umich.edu \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@ftp.linux.org.uk \
    /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®