Re: [PATCH 04/27] kill filp_open()

Dave Hansen
2008-01-16T17:05:23Z

On Wed, 2008-01-16 at 00:52 -0800, Andrew Morton wrote:
> On Thu, 01 Nov 2007 16:08:31 -0700 Dave Hansen <haveblue@us.ibm.com> wrote:
> > Replace all callers with open_namei() directly, and move the
> > nameidata stack allocation into open_namei().
>
> ftp://ftp.kernel.org/pub/linux/kernel/people/agk/patches/2.6/editing/dm-loop.patch
> is using filp_open() and hence doesn't work very well.
>
> A shall revert dm-loop.patch and run away.

This one's pretty easy, thank goodness. Just replace filp_open() with
open_namei():

/filp_open(/open_namei(AT_FDCWD, /

BTW, why do we need this on top of the existing loopback driver? Can
they really share no code?

linux-2.6.git-dave/drivers/md/dm-loop.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/md/dm-loop.c~fix-dm-loop drivers/md/dm-loop.c
--- linux-2.6.git/drivers/md/dm-loop.c~fix-dm-loop 2008-01-16 09:02:06.000000000 -0800
+++ linux-2.6.git-dave/drivers/md/dm-loop.c 2008-01-16 09:02:06.000000000 -0800
@@ -757,7 +757,7 @@ static int loop_get_file(struct dm_targe
int r = 0;

ti->error = "could not open backing file";
- filp = filp_open(lc->path, flags, 0);
+ filp = open_namei(AT_FDCWD, lc->path, flags, 0);
if (IS_ERR(filp))
return PTR_ERR(filp);
lc->filp = filp;
_

-- Dave