From: Lukas Czerner <lczerner@redhat.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Boaz Harrosh <bharrosh@panasas.com>,
Lukas Czerner <lczerner@redhat.com>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
"Theodore Ts'o" <tytso@mit.edu>
Subject: Re: fs: Add FITRIM ioctl
Date: Fri, 29 Oct 2010 11:50:15 +0200 (CEST) [thread overview]
Message-ID: <alpine.LFD.2.00.1010291123010.3009@dhcp-lab-213.englab.brq.redhat.com> (raw)
In-Reply-To: <20101028112538.GA16435@infradead.org>
Hi Christoph,
On Thu, 28 Oct 2010, Christoph Hellwig wrote:
> On Thu, Oct 28, 2010 at 12:30:45PM +0200, Boaz Harrosh wrote:
> > I've just noticed this patch. Was it posted to linux-fsdevel? Sorry
> > for missing it.
>
> It has been, but only very recently.
>
>
> I can't say I overly like it. There's no real point in dispatching this
> out to a separate vector instead of just through ->ioctl. It's got
> rather useless special case for ommiting the argument, and the whole
> thing just doesn't seem generic enough to do it in the VFS.
Well, learning from examples, that's what I am doing and ioctl_fiemap()
is doing the same thing so I was using that as an example. And, of
course, I am returning the amount of really discarded Bytes to the user
and I just can not simply use user-space pointer, or maybe I do not
understand you correctly.
About the special case I am not entirely sure that it is useless, since
there is no point in allocating the structure and setting range when you
just want to discard the whole thing (in user-space of course). But the
reason why to do it in ioctl_fstrim() is that otherwise some filesystems
might decide to return EINVAL when no argument has been passed and some
may handle it differently, hence it would not be consistent.
>
> Why did this common code go in through the ext4 tree as a start, and
> without hitting linux-next before the merge window?
I have posted it on both linux-fsdevel and linux-ext4 and we needed it
for batched discard implementation in ext4 so that is probably why it
went through ext4 tree. Unfortunately, I can not answer the second
question...
>
> > What is the point of that? sb->s_bdev is not used anywhere in this code.
> > If an FS published an sb->s_op->trim_fs, it should know what it wants
> > No? Note that the FS in question does not even need to check. It already
> > knows if it's block based or not.
>
> Indeed. Looks like copied from freeze/thaw which used to be block
> device based, but don't really need this anymore either.
>
You're right.
Thanks!
-Lukas
next prev parent reply other threads:[~2010-10-29 9:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-28 10:30 fs: Add FITRIM ioctl Boaz Harrosh
2010-10-28 11:25 ` Christoph Hellwig
2010-10-29 9:50 ` Lukas Czerner [this message]
2010-10-29 8:58 ` Lukas Czerner
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=alpine.LFD.2.00.1010291123010.3009@dhcp-lab-213.englab.brq.redhat.com \
--to=lczerner@redhat.com \
--cc=bharrosh@panasas.com \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=tytso@mit.edu \
/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).