aboutsummaryrefslogtreecommitdiffstats
path: root/fs/open.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2008-02-15 17:37:28 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2008-04-19 00:25:32 -0400
commita70e65df8812c52252fa07a2eb92a46451a4427f (patch)
treeb8154bebeb898743e89aeeea5971b410c7e49bf7 /fs/open.c
parentd57999e1527f0b0c818846dcba5a23015beb4823 (diff)
[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 <viro@ZenIV.linux.org.uk> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Dave Hansen <haveblue@us.ibm.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/open.c')
-rw-r--r--fs/open.c19
1 files changed, 0 insertions, 19 deletions
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:
796 return ERR_PTR(error); 796 return ERR_PTR(error);
797} 797}
798 798
799static struct file *do_filp_open(int dfd, const char *filename, int flags,
800 int mode)
801{
802 int error;
803 struct nameidata nd;
804
805 error = open_namei(dfd, filename, flags, mode, &nd);
806 if (!error)
807 return nameidata_to_filp(&nd, flags);
808
809 return ERR_PTR(error);
810}
811
812struct file *filp_open(const char *filename, int flags, int mode)
813{
814 return do_filp_open(AT_FDCWD, filename, flags, mode);
815}
816EXPORT_SYMBOL(filp_open);
817
818/** 799/**
819 * lookup_instantiate_filp - instantiates the open intent filp 800 * lookup_instantiate_filp - instantiates the open intent filp
820 * @nd: pointer to nameidata 801 * @nd: pointer to nameidata