LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Dave Hansen <haveblue@us.ibm.com>
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org, miklos@szeredi.hu,
	hch@infradead.org, Dave Hansen <haveblue@us.ibm.com>
Subject: [PATCH 05/27] rename open_namei() to open_pathname()
Date: Thu, 01 Nov 2007 16:08:32 -0700	[thread overview]
Message-ID: <20071101230832.9835ED1E@kernel> (raw)
In-Reply-To: <20071101230826.9A4F6E00@kernel>


open_namei() no longer touches namei's.  rename it
to something more appropriate: open_pathname().

Signed-off-by: Dave Hansen <haveblue@us.ibm.com>
---

 linux-2.6.git-dave/drivers/usb/gadget/file_storage.c |    4 ++--
 linux-2.6.git-dave/fs/exec.c                         |    2 +-
 linux-2.6.git-dave/fs/namei.c                        |    8 ++++----
 linux-2.6.git-dave/fs/open.c                         |    6 ------
 linux-2.6.git-dave/fs/reiserfs/journal.c             |    2 +-
 linux-2.6.git-dave/kernel/acct.c                     |    2 +-
 linux-2.6.git-dave/mm/swapfile.c                     |    4 ++--
 linux-2.6.git-dave/sound/sound_firmware.c            |    2 +-
 8 files changed, 12 insertions(+), 18 deletions(-)

diff -puN drivers/usb/gadget/file_storage.c~rename-open_namei drivers/usb/gadget/file_storage.c
--- linux-2.6.git/drivers/usb/gadget/file_storage.c~rename-open_namei	2007-11-01 14:46:07.000000000 -0700
+++ linux-2.6.git-dave/drivers/usb/gadget/file_storage.c	2007-11-01 14:46:07.000000000 -0700
@@ -3473,12 +3473,12 @@ static int open_backing_file(struct lun 
 	/* R/W if we can, R/O if we must */
 	ro = curlun->ro;
 	if (!ro) {
-		filp = open_namei(AT_FDCWD, filename, O_RDWR | mode, 0);
+		filp = open_pathname(AT_FDCWD, filename, O_RDWR | mode, 0);
 		if (-EROFS == PTR_ERR(filp))
 			ro = 1;
 	}
 	if (ro)
-		filp = open_namei(AT_FDCWD, filename, O_RDONLY | mode, 0);
+		filp = open_pathname(AT_FDCWD, filename, O_RDONLY | mode, 0);
 	if (IS_ERR(filp)) {
 		LINFO(curlun, "unable to open backing file: %s\n", filename);
 		return PTR_ERR(filp);
diff -puN fs/exec.c~rename-open_namei fs/exec.c
--- linux-2.6.git/fs/exec.c~rename-open_namei	2007-11-01 14:46:07.000000000 -0700
+++ linux-2.6.git-dave/fs/exec.c	2007-11-01 14:46:07.000000000 -0700
@@ -1763,7 +1763,7 @@ int do_coredump(long signr, int exit_cod
  			goto fail_unlock;
  		}
  	} else
-		file = open_namei(AT_FDCWD, corename,
+		file = open_pathname(AT_FDCWD, corename,
 				 O_CREAT | 2 | O_NOFOLLOW | O_LARGEFILE | flag,
 				 0600);
 	if (IS_ERR(file))
diff -puN fs/namei.c~rename-open_namei fs/namei.c
--- linux-2.6.git/fs/namei.c~rename-open_namei	2007-11-01 14:46:07.000000000 -0700
+++ linux-2.6.git-dave/fs/namei.c	2007-11-01 14:46:07.000000000 -0700
@@ -81,7 +81,7 @@
  */
 
 /* [16-Dec-97 Kevin Buhr] For security reasons, we change some symlink
- * semantics.  See the comments in "open_namei" and "do_link" below.
+ * semantics.  See the comments in "open_pathname" and "do_link" below.
  *
  * [10-Sep-98 Alan Modra] Another symlink change.
  */
@@ -571,7 +571,7 @@ out:
 	if (nd->depth || res || nd->last_type!=LAST_NORM)
 		return res;
 	/*
-	 * If it is an iterative symlinks resolution in open_namei() we
+	 * If it is an iterative symlinks resolution in open_pathname() we
 	 * have to copy the last component. And all that crap because of
 	 * bloody create() on broken symlinks. Furrfu...
 	 */
@@ -1708,7 +1708,7 @@ static int __open_namei_create(struct na
  *	01 - read-permission
  *	10 - write-permission
  *	11 - read-write
- * for the internal routines (ie open_namei()/follow_link() etc)
+ * for the internal routines (ie open_pathname()/follow_link() etc)
  * This is more logical, and also allows the 00 "no perm needed"
  * to be used for symlinks (where the permissions are checked
  * later).
@@ -1722,7 +1722,7 @@ static inline int sys_open_flags_to_name
 }
 
 /*
- *	open_namei()
+ *	open_pathname()
  *
  * namei for open - this is in fact almost the whole open-routine.
  *
diff -puN fs/open.c~rename-open_namei fs/open.c
--- linux-2.6.git/fs/open.c~rename-open_namei	2007-11-01 14:46:07.000000000 -0700
+++ linux-2.6.git-dave/fs/open.c	2007-11-01 14:46:07.000000000 -0700
@@ -800,12 +800,6 @@ cleanup_file:
 	return ERR_PTR(error);
 }
 
-struct file *filp_open(const char *filename, int flags, int mode)
-{
-	return open_namei(AT_FDCWD, filename, flags, mode);
-}
-EXPORT_SYMBOL(filp_open);
-
 /**
  * lookup_instantiate_filp - instantiates the open intent filp
  * @nd: pointer to nameidata
diff -puN fs/reiserfs/journal.c~rename-open_namei fs/reiserfs/journal.c
--- linux-2.6.git/fs/reiserfs/journal.c~rename-open_namei	2007-11-01 14:46:07.000000000 -0700
+++ linux-2.6.git-dave/fs/reiserfs/journal.c	2007-11-01 14:46:07.000000000 -0700
@@ -2625,7 +2625,7 @@ static int journal_init_dev(struct super
 		return 0;
 	}
 
-	journal->j_dev_file = open_namei(AT_FDCWD, jdev_name, 0, 0);
+	journal->j_dev_file = open_pathname(AT_FDCWD, jdev_name, 0, 0);
 	if (!IS_ERR(journal->j_dev_file)) {
 		struct inode *jdev_inode = journal->j_dev_file->f_mapping->host;
 		if (!S_ISBLK(jdev_inode->i_mode)) {
diff -puN kernel/acct.c~rename-open_namei kernel/acct.c
--- linux-2.6.git/kernel/acct.c~rename-open_namei	2007-11-01 14:46:07.000000000 -0700
+++ linux-2.6.git-dave/kernel/acct.c	2007-11-01 14:46:07.000000000 -0700
@@ -208,7 +208,7 @@ static int acct_on(char *name)
 	int error;
 
 	/* Difference from BSD - they don't do O_APPEND */
-	file = open_namei(AT_FDCWD, name, O_WRONLY|O_APPEND|O_LARGEFILE, 0);
+	file = open_pathname(AT_FDCWD, name, O_WRONLY|O_APPEND|O_LARGEFILE, 0);
 	if (IS_ERR(file))
 		return PTR_ERR(file);
 
diff -puN mm/swapfile.c~rename-open_namei mm/swapfile.c
--- linux-2.6.git/mm/swapfile.c~rename-open_namei	2007-11-01 14:46:07.000000000 -0700
+++ linux-2.6.git-dave/mm/swapfile.c	2007-11-01 14:46:07.000000000 -0700
@@ -1191,7 +1191,7 @@ asmlinkage long sys_swapoff(const char _
 	if (IS_ERR(pathname))
 		goto out;
 
-	victim = open_namei(AT_FDCWD, pathname, O_RDWR|O_LARGEFILE, 0);
+	victim = open_pathname(AT_FDCWD, pathname, O_RDWR|O_LARGEFILE, 0);
 	putname(pathname);
 	err = PTR_ERR(victim);
 	if (IS_ERR(victim))
@@ -1470,7 +1470,7 @@ asmlinkage long sys_swapon(const char __
 		name = NULL;
 		goto bad_swap_2;
 	}
-	swap_file = open_namei(AT_FDCWD, name, O_RDWR|O_LARGEFILE, 0);
+	swap_file = open_pathname(AT_FDCWD, name, O_RDWR|O_LARGEFILE, 0);
 	error = PTR_ERR(swap_file);
 	if (IS_ERR(swap_file)) {
 		swap_file = NULL;
diff -puN sound/sound_firmware.c~rename-open_namei sound/sound_firmware.c
--- linux-2.6.git/sound/sound_firmware.c~rename-open_namei	2007-11-01 14:46:07.000000000 -0700
+++ linux-2.6.git-dave/sound/sound_firmware.c	2007-11-01 14:46:07.000000000 -0700
@@ -14,7 +14,7 @@ static int do_mod_firmware_load(const ch
 	char *dp;
 	loff_t pos;
 
-	filp = open_namei(AT_FDCWD, fn, 0, 0);
+	filp = open_pathname(AT_FDCWD, fn, 0, 0);
 	if (IS_ERR(filp))
 	{
 		printk(KERN_INFO "Unable to load '%s'.\n", fn);
_

  parent reply	other threads:[~2007-11-01 23:09 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-01 23:08 [PATCH 00/27] Read-only bind mounts (-mm resend) Dave Hansen
2007-11-01 23:08 ` [PATCH 01/27] do namei_flags calculation inside open_namei() Dave Hansen
2007-11-01 23:08 ` [PATCH 02/27] make open_namei() return a filp Dave Hansen
2007-11-01 23:08 ` [PATCH 03/27] kill do_filp_open() Dave Hansen
2007-11-01 23:08 ` [PATCH 04/27] kill filp_open() Dave Hansen
2008-01-16  8:52   ` Andrew Morton
2008-01-16 17:04     ` Dave Hansen
2008-01-16 17:10       ` Christoph Hellwig
2008-01-16 17:41         ` Dave Hansen
2008-01-16 17:47           ` Christoph Hellwig
2008-01-16 17:12       ` Bryn M. Reeves
2007-11-01 23:08 ` Dave Hansen [this message]
2007-11-26 14:33   ` [PATCH 05/27] rename open_namei() to open_pathname() Christoph Hellwig
2007-11-01 23:08 ` [PATCH 06/27] r-o-bind-mounts-stub-functions Dave Hansen
2007-11-01 23:08 ` [PATCH 07/27] r-o-bind-mounts-do_rmdir-elevate-write-count Dave Hansen
2007-11-01 23:08 ` [PATCH 08/27] r-o-bind-mounts-elevate-mnt-writers-for-callers-of-vfs_mkdir Dave Hansen
2007-11-01 23:08 ` [PATCH 09/27] r-o-bind-mounts-elevate-mnt-writers-for-vfs_unlink-callers Dave Hansen
2007-11-01 23:08 ` [PATCH 10/27] r-o-bind-mounts-elevate-mount-count-for-extended-attributes Dave Hansen
2007-11-01 23:08 ` [PATCH 11/27] r-o-bind-mounts-elevate-write-count-during-entire-ncp_ioctl Dave Hansen
2007-11-01 23:08 ` [PATCH 12/27] r-o-bind-mounts-elevate-write-count-for-do_sys_utime-and-touch_atime Dave Hansen
2007-11-01 23:08 ` [PATCH 13/27] r-o-bind-mounts-elevate-write-count-for-do_utimes Dave Hansen
2007-11-01 23:08 ` [PATCH 14/27] r-o-bind-mounts-elevate-write-count-for-file_update_time Dave Hansen
2007-11-01 23:08 ` [PATCH 15/27] r-o-bind-mounts-elevate-write-count-for-link-and-symlink-calls Dave Hansen
2007-11-01 23:08 ` [PATCH 16/27] r-o-bind-mounts-elevate-write-count-for-some-ioctls Dave Hansen
2007-11-05 23:23   ` Andrew Morton
2007-11-06  9:01     ` Jan Kara
2007-11-06  9:12       ` Andrew Morton
2007-11-01 23:08 ` [PATCH 17/27] r-o-bind-mounts-elevate-write-count-opend-files Dave Hansen
2007-11-01 23:08 ` [PATCH 18/27] r-o-bind-mounts-elevate-write-count-over-calls-to-vfs_rename Dave Hansen
2007-11-01 23:08 ` [PATCH 19/27] r-o-bind-mounts-elevate-writer-count-for-chown-and-friends Dave Hansen
2007-11-01 23:08 ` [PATCH 20/27] r-o-bind-mounts-elevate-writer-count-for-do_sys_truncate Dave Hansen
2007-11-01 23:08 ` [PATCH 21/27] r-o-bind-mounts-make-access-use-mnt-check Dave Hansen
2007-11-01 23:08 ` [PATCH 22/27] r-o-bind-mounts-nfs-check-mnt-instead-of-superblock-directly Dave Hansen
2007-11-01 23:08 ` [PATCH 23/27] r-o-bind-mounts-sys_mknodat-elevate-write-count-for-vfs_mknod-create Dave Hansen
2007-11-01 23:08 ` [PATCH 24/27] r-o-bind-mounts-track-number-of-mount-writers Dave Hansen
2007-11-01 23:09 ` [PATCH 25/27] r-o-bind-mounts-track-number-of-mount-writers-make-lockdep-happy-with-r-o-bind-mounts Dave Hansen
2007-11-05 23:35   ` Andrew Morton
2007-11-01 23:09 ` [PATCH 26/27] r-o-bind-mounts-honor-r-w-changes-at-do_remount-time Dave Hansen
2007-11-01 23:09 ` [PATCH 27/27] keep track of mnt_writer state of struct file Dave Hansen

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=20071101230832.9835ED1E@kernel \
    --to=haveblue@us.ibm.com \
    --cc=akpm@osdl.org \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    /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;
as well as URLs for NNTP newsgroup(s).