linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marco Stornelli <marco.stornelli@gmail.com>
To: "Lukáš Czerner" <lczerner@redhat.com>
Cc: Linux FS Devel <linux-fsdevel@vger.kernel.org>,
	linux-mm@kvack.org, Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 00/21] drop vmtruncate
Date: Fri, 7 Sep 2012 08:29:28 +0200	[thread overview]
Message-ID: <CANGUGtB9-DuypSnT0zobd9CK88SW8x=FGCnwaHZEDjtkJ33doQ@mail.gmail.com> (raw)
In-Reply-To: <alpine.LFD.2.00.1209061255530.509@new-host-2>

2012/9/6 Lukáš Czerner <lczerner@redhat.com>:
> On Fri, 31 Aug 2012, Marco Stornelli wrote:
>
>> Date: Fri, 31 Aug 2012 15:50:20 +0200
>> From: Marco Stornelli <marco.stornelli@gmail.com>
>> To: Linux FS Devel <linux-fsdevel@vger.kernel.org>, linux-mm@kvack.org
>> Cc: Linux Kernel <linux-kernel@vger.kernel.org>
>> Subject: [PATCH 00/21] drop vmtruncate
>>
>> Hi all,
>>
>> with this patch series I try to clean the vmtruncate code. The theory of
>> operation:
>>
>> old               new
>> vmtruncate() =>   inode_newsize_ok+truncate_setsize+fs truncate
>>
>> Where vmtruncate was used without any error check, the code now is:
>>
>> if (inode_newsize_ok() == 0) {
>>       truncate_setsize();
>>       fs truncate();
>> }
>>
>> So, performance and semantic nothing change at all. I think that maybe in some
>> point we can skip inode_newsize_ok (where the error check of vmtruncate wasn't
>> used) but since there is a swap check in case of no-extension, maybe it's
>> better to avoid regressions. After this clean, of course, each fs can clean in
>> a deeply way.
>>
>> With these patches even the inode truncate callback is deleted.
>>
>> Any comments/feedback/bugs are welcome.
>
> Could you explain the reason behind this change a little bit more ?
> This does not make any sense to me since you're replacing
> vmtruncate() which does basically
>
> if (inode_newsize_ok() == 0) {
>         truncate_setsize();
>         fs truncate();
> }
>
> as you mentioned above by exactly the same thing but doing it within
> the file system. It does not seem like an improvement to me ... how
> is this a clean up ?
>
> Thanks!
> -Lukas
>

First of all we have one function less in our stack :) Vmtruncate (see
comments) is deprecated, so it's better to remove it completly. In
this way we can remove even the truncate call back in inode operations
(so save 4byte/8byte per struct for the pointer). The first goal of
this cleaning activity, however, is remove a "deprecated" function to
have a code much more readable. As I said, this patch series is only a
*first* cleanup, each fs can of course clean its code in a deeply way.
As you can see, the patch span over several fs, to be *safe* I
preferred to use a conservative approach. Where vmtruncate was called
without error check, as I said, maybe we can remove
inode_newsize_ok(), but since in this way we skip a check, I preferred
that approach. It seems that for NTFS and Raiserfs it's ok.

Marco

Marco

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2012-09-07  6:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-31 13:50 [PATCH 00/21] drop vmtruncate Marco Stornelli
2012-09-06 17:04 ` Lukáš Czerner
2012-09-07  6:29   ` Marco Stornelli [this message]

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='CANGUGtB9-DuypSnT0zobd9CK88SW8x=FGCnwaHZEDjtkJ33doQ@mail.gmail.com' \
    --to=marco.stornelli@gmail.com \
    --cc=lczerner@redhat.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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).