public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
From: Mingming Cao <cmm@us.ibm.com>
To: "Theodore Ts'o" <tytso@mit.edu>
Cc: linux-ext4@vger.kernel.org
Subject: Re: [PATCH, RFC] ext4-use-generic-discard-reservations-call
Date: Thu, 14 Aug 2008 16:09:40 -0700	[thread overview]
Message-ID: <1218755380.6362.43.camel@mingming-laptop> (raw)
In-Reply-To: <E1KTiuD-0000ej-JZ@closure.thunk.org>


在 2008-08-14四的 15:54 -0400,Theodore Ts'o写道:
> Does this patch make sense?  I noticed that in the extents version of
> the truncate, we call the mballoc-specific version of
> ext4_discard_reservation(), instead of ext4_discard_reservation()
> directly.  As a result, if the filesystem is mounted -o nomballoc, we
> won't throw away the reservation window when truncating or unlinking an
> extents-based file.   We are using ext4_discard_reservation() in
> non-extent truncate code, which is what made me notice this.
> 
> 	   	    	  	   	- Ted
> 

Agreed.

Reviewed-by: Mingming Cao <cmm@us.ibm.com>

> ext4: Use ext4_discard_reservations instead of mballoc-specific call
> 
> In ext4_ext_truncate(), we should use the more generic
> ext4_discard_reservations() call so we do the right thing when the
> filesystem is mounted with the nomballoc option.
> 
> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
> diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
> index 3c82ab1..30a59b8 100644
> --- a/fs/ext4/extents.c
> +++ b/fs/ext4/extents.c
> @@ -2963,7 +2963,7 @@ void ext4_ext_truncate(struct inode *inode)
>  	down_write(&EXT4_I(inode)->i_data_sem);
>  	ext4_ext_invalidate_cache(inode);
> 
> -	ext4_mb_discard_inode_preallocations(inode);
> +	ext4_discard_reservation(inode);
> 
>  	/*
>  	 * TODO: optimization is possible here.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" 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:[~2008-08-14 23:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-14 19:54 [PATCH, RFC] ext4-use-generic-discard-reservations-call Theodore Ts'o
2008-08-14 23:09 ` Mingming Cao [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=1218755380.6362.43.camel@mingming-laptop \
    --to=cmm@us.ibm.com \
    --cc=linux-ext4@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