linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
	apw@canonical.com, nbd@openwrt.org, neilb@suse.de
Subject: Re: [PATCH 1/6 v7] vfs: add i_op->open()
Date: Tue, 22 Mar 2011 11:37:06 -0700	[thread overview]
Message-ID: <AANLkTi=dyEoBVAPLMfuG4_jVencSW00PeE3_z+APsL=t@mail.gmail.com> (raw)
In-Reply-To: <E1Q264S-0001Fy-HU@pomaz-ex.szeredi.hu>

On Tue, Mar 22, 2011 at 11:12 AM, Miklos Szeredi <miklos@szeredi.hu> wrote:
>>
>> Why don't you just pass in the filp to the ->open routine, and drop
>> that "flags" argument. Maybe other filesystems want to use ->open, but
>> don't want to put_filp() on the filp we already allocated, only to
>> allocate a new one?
>
> Maybe, although I don't see the reason to do that.  Why keep the
> original one?  It doesn't contain any information besides the flags
> and the dentry/vfsmount.

Umm? Because that way you can avoid allocating a new one?

So let's turn your questions on its head: why do you insist on
free'ing the old one, WHEN YOU KNOW THAT THE ->open ROUTINE NEEDS TO
ALLOCATE A NEW ONE?

Sure, in _your_ case, you'll get a new filp because you're going to do
a whole new open of a lower-level filesystem, but if the ->open
routine is all about just your case, then I don't want it as a VFS
layer operation. So for your filesystem, you will always discard the
old one as useless. But that's purely an implementation detail for
you. It has nothing to do with the VFS interfaces.

So why do that idiotic free, only to force the callee to then
re-allocate a new "struct file"?

                           Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2011-03-22 18:37 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-22 15:26 [PATCH 0/6 v7] overlay filesystem - request for inclusion Miklos Szeredi
2011-03-22 15:26 ` [PATCH 1/6 v7] vfs: add i_op->open() Miklos Szeredi
2011-03-22 17:18   ` Linus Torvalds
2011-03-22 18:12     ` Miklos Szeredi
2011-03-22 18:37       ` Linus Torvalds [this message]
2011-03-22 15:26 ` [PATCH 2/6 v7] vfs: export do_splice_direct() to modules Miklos Szeredi
2011-03-22 15:26 ` [PATCH 3/6 v7] vfs: introduce clone_private_mount() Miklos Szeredi
2011-03-22 15:26 ` [PATCH 4/6 v7] overlay filesystem prototype Miklos Szeredi
2011-03-22 17:30   ` Linus Torvalds
2011-03-22 18:15     ` Miklos Szeredi
2011-03-22 15:26 ` [PATCH 5/6 v7] overlayfs: add statfs support Miklos Szeredi
2011-03-22 15:26 ` [PATCH 6/6 v7] overlay: overlay filesystem documentation Miklos Szeredi
2011-03-22 17:36 ` [PATCH 0/6 v7] overlay filesystem - request for inclusion Linus Torvalds
2011-03-22 18:22   ` Felix Fietkau
2011-03-22 18:27     ` Linus Torvalds
2011-03-22 18:39   ` Al Viro
2011-03-22 18:48     ` Linus Torvalds
2011-03-22 18:58       ` Miklos Szeredi
2011-03-22 19:00         ` Al Viro
2011-03-22 19:43           ` Miklos Szeredi
2011-03-22 19:53             ` Al Viro
2011-03-22 20:06               ` Miklos Szeredi
2011-03-22 20:11                 ` Al Viro
2011-03-22 20:31                   ` Miklos Szeredi
2011-03-22 20:40                     ` Miklos Szeredi
2011-03-23 10:03                     ` Miklos Szeredi
2011-03-22 19:38         ` Al Viro
2011-03-22 19:56           ` Miklos Szeredi

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='AANLkTi=dyEoBVAPLMfuG4_jVencSW00PeE3_z+APsL=t@mail.gmail.com' \
    --to=torvalds@linux-foundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=apw@canonical.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=miklos@szeredi.hu \
    --cc=nbd@openwrt.org \
    --cc=neilb@suse.de \
    --cc=viro@zeniv.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;
as well as URLs for NNTP newsgroup(s).