mtd/drivers/mtd/devices blkmtd.c,1.25,1.26 block2mtd.c,1.26,1.27

gleixner at infradead.org gleixner at infradead.org
Thu Mar 17 20:37:34 EST 2005


Update of /home/cvs/mtd/drivers/mtd/devices
In directory phoenix.infradead.org:/tmp/cvs-serv28287

Modified Files:
	blkmtd.c block2mtd.c 
Log Message:
Merge from mainline.

[PATCH] vmtrunc: truncate_count not atomic

Why is mapping->truncate_count atomic?  It's incremented inside i_mmap_lock
(and i_sem), and the reads don't need it to be atomic.

And why smp_rmb() before call to ->nopage?  The compiler cannot reorder the
initial assignment of sequence after the call to ->nopage, and no cpu (yet!)
can read from the future, which is all that matters there.

And delete totally bogus reset of truncate_count from blkmtd add_device.
truncate_count is all about detecting i_size changes: i_size does not change
there; and if it did, the count should be incremented not reset.

Signed-off-by: Hugh Dickins <hugh at veritas.com>



Index: blkmtd.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/devices/blkmtd.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- blkmtd.c	17 Mar 2005 19:44:27 -0000	1.25
+++ blkmtd.c	18 Mar 2005 01:37:31 -0000	1.26
@@ -661,7 +661,6 @@
 
 	memset(dev, 0, sizeof(struct blkmtd_dev));
 	dev->blkdev = bdev;
-	atomic_set(&(dev->blkdev->bd_inode->i_mapping->truncate_count), 0);
 	if(!readonly) {
 		init_MUTEX(&dev->wrbuf_mutex);
 	}

Index: block2mtd.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/devices/block2mtd.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- block2mtd.c	17 Mar 2005 19:48:19 -0000	1.26
+++ block2mtd.c	18 Mar 2005 01:37:31 -0000	1.27
@@ -310,7 +310,6 @@
 		goto devinit_err;
 	}
 
-	atomic_set(&bdev->bd_inode->i_mapping->truncate_count, 0);
 	init_MUTEX(&dev->write_mutex);
 
 	/* Setup the MTD structure */





More information about the linux-mtd-cvs mailing list