Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 6 May 2018 21:29:30 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r333311 - head/sys/fs/msdosfs
Message-ID:  <201805062129.w46LTU7X004766@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pfg
Date: Sun May  6 21:29:29 2018
New Revision: 333311
URL: https://svnweb.freebsd.org/changeset/base/333311

Log:
  msdosfs: use vfs_timestamp() to generate timestamps instead of getnanotime().
  
  Most filesystems, with the notable exceptions of msdosfs and autofs use
  only vfs_timestamp() to read the current time. This has the benefit of
  configurable granularity (using the vfs.timestamp_precision sysctl).
  
  For convenience, use it on msdosfs too.
  
  Submitted by:	Damjan Jovanovic
  Differential Revision:	https://reviews.freebsd.org/D15297

Modified:
  head/sys/fs/msdosfs/msdosfs_denode.c
  head/sys/fs/msdosfs/msdosfs_vnops.c

Modified: head/sys/fs/msdosfs/msdosfs_denode.c
==============================================================================
--- head/sys/fs/msdosfs/msdosfs_denode.c	Sun May  6 21:22:46 2018	(r333310)
+++ head/sys/fs/msdosfs/msdosfs_denode.c	Sun May  6 21:29:29 2018	(r333311)
@@ -297,7 +297,7 @@ deupdat(struct denode *dep, int waitfor)
 		    DE_MODIFIED);
 		return (0);
 	}
-	getnanotime(&ts);
+	vfs_timestamp(&ts);
 	DETIMES(dep, &ts, &ts, &ts);
 	if ((dep->de_flag & DE_MODIFIED) == 0 && waitfor == 0)
 		return (0);

Modified: head/sys/fs/msdosfs/msdosfs_vnops.c
==============================================================================
--- head/sys/fs/msdosfs/msdosfs_vnops.c	Sun May  6 21:22:46 2018	(r333310)
+++ head/sys/fs/msdosfs/msdosfs_vnops.c	Sun May  6 21:29:29 2018	(r333311)
@@ -178,7 +178,7 @@ msdosfs_create(struct vop_create_args *ap)
 	ndirent.de_FileSize = 0;
 	ndirent.de_pmp = pdep->de_pmp;
 	ndirent.de_flag = DE_ACCESS | DE_CREATE | DE_UPDATE;
-	getnanotime(&ts);
+	vfs_timestamp(&ts);
 	DETIMES(&ndirent, &ts, &ts, &ts);
 	error = createde(&ndirent, pdep, &dep, cnp);
 	if (error)
@@ -216,7 +216,7 @@ msdosfs_close(struct vop_close_args *ap)
 
 	VI_LOCK(vp);
 	if (vp->v_usecount > 1) {
-		getnanotime(&ts);
+		vfs_timestamp(&ts);
 		DETIMES(dep, &ts, &ts, &ts);
 	}
 	VI_UNLOCK(vp);
@@ -266,7 +266,7 @@ msdosfs_getattr(struct vop_getattr_args *ap)
 	u_long dirsperblk = pmp->pm_BytesPerSec / sizeof(struct direntry);
 	uint64_t fileid;
 
-	getnanotime(&ts);
+	vfs_timestamp(&ts);
 	DETIMES(dep, &ts, &ts, &ts);
 	vap->va_fsid = dev2udev(pmp->pm_dev);
 	/*
@@ -1330,7 +1330,7 @@ msdosfs_mkdir(struct vop_mkdir_args *ap)
 	memset(&ndirent, 0, sizeof(ndirent));
 	ndirent.de_pmp = pmp;
 	ndirent.de_flag = DE_ACCESS | DE_CREATE | DE_UPDATE;
-	getnanotime(&ts);
+	vfs_timestamp(&ts);
 	DETIMES(&ndirent, &ts, &ts, &ts);
 
 	/*



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201805062129.w46LTU7X004766>