remove useless mnt_want_write call in xfs_write
authorChristoph Hellwig <hch@lst.de>
Wed, 3 Dec 2008 11:20:22 +0000 (12:20 +0100)
committerNiv Sardi <xaiki@sgi.com>
Thu, 4 Dec 2008 04:39:19 +0000 (15:39 +1100)
When mnt_want_write was introduced a call to it was added around
xfs_ichgtime, but there is no need for this because a file can't be open
read/write on a r/o mount, and a mount can't degrade r/o while we still
have files open for writing.  As the mnt_want_write changes were never
merged into the CVS tree this patch is for mainline only.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Dave Chinner <david@fromorbit.com>
Signed-off-by: Niv Sardi <xaiki@sgi.com>
fs/xfs/linux-2.6/xfs_lrw.c

index 4959c87..59b7d5f 100644 (file)
@@ -51,7 +51,6 @@
 #include "xfs_vnodeops.h"
 
 #include <linux/capability.h>
-#include <linux/mount.h>
 #include <linux/writeback.h>
 
 
@@ -668,15 +667,8 @@ start:
        if (new_size > xip->i_size)
                xip->i_new_size = new_size;
 
-       /*
-        * We're not supposed to change timestamps in readonly-mounted
-        * filesystems.  Throw it away if anyone asks us.
-        */
-       if (likely(!(ioflags & IO_INVIS) &&
-                  !mnt_want_write(file->f_path.mnt))) {
+       if (likely(!(ioflags & IO_INVIS)))
                xfs_ichgtime(xip, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
-               mnt_drop_write(file->f_path.mnt);
-       }
 
        /*
         * If the offset is beyond the size of the file, we have a couple