public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/3] stop using file_update_time
@ 2008-07-26  6:33 Christoph Hellwig
  2008-07-26  9:13 ` Dave Chinner
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2008-07-26  6:33 UTC (permalink / raw)
  To: xfs

xfs_ichtime updates the xfs_inode and Linux inode timestamps just fine,
no need to call file_update_time and then copy the values over to the
XFS inode.  The only additional thing in file_update_time are checks
not applicable to the write path.


Signed-off-by: Christoph Hellwig <hch@lst.de>

Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c
===================================================================
--- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_iops.c	2008-07-24 08:37:09.000000000 +0200
+++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.c	2008-07-24 08:37:18.000000000 +0200
@@ -134,52 +134,6 @@ xfs_ichgtime(
 }
 
 /*
- * Variant on the above which avoids querying the system clock
- * in situations where we know the Linux inode timestamps have
- * just been updated (and so we can update our inode cheaply).
- */
-void
-xfs_ichgtime_fast(
-	xfs_inode_t	*ip,
-	struct inode	*inode,
-	int		flags)
-{
-	timespec_t	*tvp;
-
-	/*
-	 * We're not supposed to change timestamps in readonly-mounted
-	 * filesystems.  Throw it away if anyone asks us.
-	 */
-	if (unlikely(IS_RDONLY(inode)))
-		return;
-
-	if (flags & XFS_ICHGTIME_MOD) {
-		tvp = &inode->i_mtime;
-		ip->i_d.di_mtime.t_sec = (__int32_t)tvp->tv_sec;
-		ip->i_d.di_mtime.t_nsec = (__int32_t)tvp->tv_nsec;
-	}
-	if (flags & XFS_ICHGTIME_CHG) {
-		tvp = &inode->i_ctime;
-		ip->i_d.di_ctime.t_sec = (__int32_t)tvp->tv_sec;
-		ip->i_d.di_ctime.t_nsec = (__int32_t)tvp->tv_nsec;
-	}
-
-	/*
-	 * We update the i_update_core field _after_ changing
-	 * the timestamps in order to coordinate properly with
-	 * xfs_iflush() so that we don't lose timestamp updates.
-	 * This keeps us from having to hold the inode lock
-	 * while doing this.  We use the SYNCHRONIZE macro to
-	 * ensure that the compiler does not reorder the update
-	 * of i_update_core above the timestamp updates above.
-	 */
-	SYNCHRONIZE();
-	ip->i_update_core = 1;
-	if (!(inode->i_state & I_NEW))
-		mark_inode_dirty_sync(inode);
-}
-
-/*
  * Hook in SELinux.  This is not quite correct yet, what we really need
  * here (as we do for default ACLs) is a mechanism by which creation of
  * these attrs can be journalled at inode creation time (along with the
Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.h
===================================================================
--- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_iops.h	2008-07-24 08:37:09.000000000 +0200
+++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.h	2008-07-24 08:37:40.000000000 +0200
@@ -26,9 +26,6 @@ extern const struct file_operations xfs_
 
 extern ssize_t xfs_vn_listxattr(struct dentry *, char *data, size_t size);
 
-extern void xfs_ichgtime(struct xfs_inode *, int);
-extern void xfs_ichgtime_fast(struct xfs_inode *, struct inode *, int);
-
 extern void xfs_setup_inode(struct xfs_inode *);
 
 #endif /* __XFS_IOPS_H__ */
Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_lrw.c
===================================================================
--- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_lrw.c	2008-07-24 08:37:09.000000000 +0200
+++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_lrw.c	2008-07-24 08:37:18.000000000 +0200
@@ -667,11 +667,8 @@ start:
 	if (new_size > xip->i_size)
 		xip->i_new_size = new_size;
 
-	if (likely(!(ioflags & IO_INVIS))) {
-		file_update_time(file);
-		xfs_ichgtime_fast(xip, inode,
-				  XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
-	}
+	if (likely(!(ioflags & IO_INVIS)))
+		xfs_ichgtime(xip, XFS_ICHGTIME_MOD | XFS_ICHGTIME_CHG);
 
 	/*
 	 * If the offset is beyond the size of the file, we have a couple
Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c
===================================================================
--- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_ksyms.c	2008-07-24 08:37:09.000000000 +0200
+++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_ksyms.c	2008-07-24 08:37:18.000000000 +0200
@@ -294,7 +294,6 @@ EXPORT_SYMBOL(xfs_dinode_from_disk);
 EXPORT_SYMBOL(xfs_sb_from_disk);
 EXPORT_SYMBOL(xfs_zero_eof);
 EXPORT_SYMBOL(xlog_recover_process_iunlinks);
-EXPORT_SYMBOL(xfs_ichgtime_fast);
 EXPORT_SYMBOL(xfs_free_eofblocks);
 
 EXPORT_SYMBOL(xfs_do_force_shutdown);

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

* Re: [PATCH 3/3] stop using file_update_time
  2008-07-26  6:33 [PATCH 3/3] stop using file_update_time Christoph Hellwig
@ 2008-07-26  9:13 ` Dave Chinner
  2008-07-26  9:14   ` Christoph Hellwig
  0 siblings, 1 reply; 4+ messages in thread
From: Dave Chinner @ 2008-07-26  9:13 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

On Sat, Jul 26, 2008 at 08:33:39AM +0200, Christoph Hellwig wrote:
> xfs_ichtime updates the xfs_inode and Linux inode timestamps just fine,
> no need to call file_update_time and then copy the values over to the
> XFS inode.  The only additional thing in file_update_time are checks
> not applicable to the write path.
.....

> Index: linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.h
> ===================================================================
> --- linux-2.6-xfs.orig/fs/xfs/linux-2.6/xfs_iops.h	2008-07-24 08:37:09.000000000 +0200
> +++ linux-2.6-xfs/fs/xfs/linux-2.6/xfs_iops.h	2008-07-24 08:37:40.000000000 +0200
> @@ -26,9 +26,6 @@ extern const struct file_operations xfs_
>  
>  extern ssize_t xfs_vn_listxattr(struct dentry *, char *data, size_t size);
>  
> -extern void xfs_ichgtime(struct xfs_inode *, int);
> -extern void xfs_ichgtime_fast(struct xfs_inode *, struct inode *, int);
> -

I don't think you meant to remove the xfs_ichgtime() prototype
as well...

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

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

* Re: [PATCH 3/3] stop using file_update_time
  2008-07-26  9:13 ` Dave Chinner
@ 2008-07-26  9:14   ` Christoph Hellwig
  2008-07-26  9:22     ` Dave Chinner
  0 siblings, 1 reply; 4+ messages in thread
From: Christoph Hellwig @ 2008-07-26  9:14 UTC (permalink / raw)
  To: Christoph Hellwig, xfs

On Sat, Jul 26, 2008 at 07:13:48PM +1000, Dave Chinner wrote:
> I don't think you meant to remove the xfs_ichgtime() prototype
> as well...

Actually I did, but I forgot to mention why.  There's a second prototype
in xfs_inode.h which is enough.

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

* Re: [PATCH 3/3] stop using file_update_time
  2008-07-26  9:14   ` Christoph Hellwig
@ 2008-07-26  9:22     ` Dave Chinner
  0 siblings, 0 replies; 4+ messages in thread
From: Dave Chinner @ 2008-07-26  9:22 UTC (permalink / raw)
  To: Christoph Hellwig; +Cc: xfs

On Sat, Jul 26, 2008 at 11:14:28AM +0200, Christoph Hellwig wrote:
> On Sat, Jul 26, 2008 at 07:13:48PM +1000, Dave Chinner wrote:
> > I don't think you meant to remove the xfs_ichgtime() prototype
> > as well...
> 
> Actually I did, but I forgot to mention why.  There's a second prototype
> in xfs_inode.h which is enough.

Ah, ok, so there is. Looks good, then ;)

Cheers,

Dave.
-- 
Dave Chinner
david@fromorbit.com

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

end of thread, other threads:[~2008-07-26  9:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-26  6:33 [PATCH 3/3] stop using file_update_time Christoph Hellwig
2008-07-26  9:13 ` Dave Chinner
2008-07-26  9:14   ` Christoph Hellwig
2008-07-26  9:22     ` Dave Chinner

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