linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] down i_data_sem only for read when walking tree for fiemap
@ 2009-05-15 21:07 Eric Sandeen
  2009-05-18  3:37 ` Theodore Tso
  0 siblings, 1 reply; 2+ messages in thread
From: Eric Sandeen @ 2009-05-15 21:07 UTC (permalink / raw)
  To: ext4 development

Not sure why I put this in as down_write originally; all we are
doing is walking the tree, nothing will change under us and
concurrent reads should be no problem.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

Index: linux-2.6/fs/ext4/extents.c
===================================================================
--- linux-2.6.orig/fs/ext4/extents.c
+++ linux-2.6/fs/ext4/extents.c
@@ -3309,10 +3309,10 @@ int ext4_fiemap(struct inode *inode, str
 		 * Walk the extent tree gathering extent information.
 		 * ext4_ext_fiemap_cb will push extents back to user.
 		 */
-		down_write(&EXT4_I(inode)->i_data_sem);
+		down_read(&EXT4_I(inode)->i_data_sem);
 		error = ext4_ext_walk_space(inode, start_blk, len_blks,
 					  ext4_ext_fiemap_cb, fieinfo);
-		up_write(&EXT4_I(inode)->i_data_sem);
+		up_read(&EXT4_I(inode)->i_data_sem);
 	}
 
 	return error;



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

end of thread, other threads:[~2009-05-18  3:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-05-15 21:07 [PATCH] down i_data_sem only for read when walking tree for fiemap Eric Sandeen
2009-05-18  3:37 ` Theodore Tso

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).