From a70e65df8812c52252fa07a2eb92a46451a4427f Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Fri, 15 Feb 2008 14:37:28 -0800 Subject: [PATCH] merge open_namei() and do_filp_open() open_namei() will, in the future, need to take mount write counts over its creation and truncation (via may_open()) operations. It needs to keep these write counts until any potential filp that is created gets __fput()'d. This gets complicated in the error handling and becomes very murky as to how far open_namei() actually got, and whether or not that mount write count was taken. That makes it a bad interface. All that the current do_filp_open() really does is allocate the nameidata on the stack, then call open_namei(). So, this merges those two functions and moves filp_open() over to namei.c so it can be close to its buddy: do_filp_open(). It also gets a kerneldoc comment in the process. Acked-by: Al Viro Signed-off-by: Christoph Hellwig Signed-off-by: Andrew Morton Signed-off-by: Dave Hansen Signed-off-by: Al Viro --- fs/open.c | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'fs/open.c') diff --git a/fs/open.c b/fs/open.c index 5ab3f3f079c0..8111947905d8 100644 --- a/fs/open.c +++ b/fs/open.c @@ -796,25 +796,6 @@ cleanup_file: return ERR_PTR(error); } -static struct file *do_filp_open(int dfd, const char *filename, int flags, - int mode) -{ - int error; - struct nameidata nd; - - error = open_namei(dfd, filename, flags, mode, &nd); - if (!error) - return nameidata_to_filp(&nd, flags); - - return ERR_PTR(error); -} - -struct file *filp_open(const char *filename, int flags, int mode) -{ - return do_filp_open(AT_FDCWD, filename, flags, mode); -} -EXPORT_SYMBOL(filp_open); - /** * lookup_instantiate_filp - instantiates the open intent filp * @nd: pointer to nameidata -- cgit v1.2.1