public inbox for linux-ext4@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH, RFC] ext4-use-generic-discard-reservations-call
@ 2008-08-14 19:54 Theodore Ts'o
  2008-08-14 23:09 ` Mingming Cao
  0 siblings, 1 reply; 2+ messages in thread
From: Theodore Ts'o @ 2008-08-14 19:54 UTC (permalink / raw)
  To: linux-ext4


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

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.

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-08-14 23:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-14 19:54 [PATCH, RFC] ext4-use-generic-discard-reservations-call Theodore Ts'o
2008-08-14 23:09 ` Mingming Cao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox