atime update works (Yura Pakhuchiy, Szabolcs Szakacsits)

master
szaka 2007-11-18 14:08:44 +00:00
parent 76a3a8963c
commit 008cac84fb
3 changed files with 7 additions and 34 deletions

View File

@ -43,23 +43,12 @@
#endif
/*
* Under Cygwin, DJGPP and FreeBSD we do not have MS_RDONLY and MS_NOATIME,
* Under Cygwin, DJGPP and FreeBSD we do not have MS_RDONLY,
* so we define them ourselves.
*/
#ifndef MS_RDONLY
#define MS_RDONLY 1
#endif
/*
* Solaris defines MS_RDONLY but not MS_NOATIME thus we need to carefully
* define MS_NOATIME.
*/
#ifndef MS_NOATIME
#if (MS_RDONLY != 1)
# define MS_NOATIME 1
#else
# define MS_NOATIME 2
#endif
#endif
#define MS_EXCLUSIVE 0x08000000
@ -98,7 +87,6 @@ typedef enum {
NV_ReadOnly, /* 1: Volume is read-only. */
NV_CaseSensitive, /* 1: Volume is mounted case-sensitive. */
NV_LogFileEmpty, /* 1: $logFile journal is empty. */
NV_NoATime, /* 1: Do not update access time. */
} ntfs_volume_state_bits;
#define test_nvol_flag(nv, flag) test_bit(NV_##flag, (nv)->state)
@ -117,10 +105,6 @@ typedef enum {
#define NVolSetLogFileEmpty(nv) set_nvol_flag(nv, LogFileEmpty)
#define NVolClearLogFileEmpty(nv) clear_nvol_flag(nv, LogFileEmpty)
#define NVolNoATime(nv) test_nvol_flag(nv, NoATime)
#define NVolSetNoATime(nv) set_nvol_flag(nv, NoATime)
#define NVolClearNoATime(nv) clear_nvol_flag(nv, NoATime)
/*
* NTFS version 1.1 and 1.2 are used by Windows NT4.
* NTFS version 2.x is used by Windows 2000 Beta

View File

@ -457,8 +457,6 @@ ntfs_volume *ntfs_volume_startup(struct ntfs_device *dev, unsigned long flags)
if (flags & MS_RDONLY)
NVolSetReadOnly(vol);
if (flags & MS_NOATIME)
NVolSetNoATime(vol);
/* ...->open needs bracketing to compile with glibc 2.7 */
if ((dev->d_ops->open)(dev, NVolReadOnly(vol) ? O_RDONLY: O_RDWR)) {
@ -739,10 +737,9 @@ out:
* to mount as the ntfs volume.
*
* @flags is an optional second parameter. The same flags are used as for
* the mount system call (man 2 mount). Currently only the following flags
* are implemented:
* the mount system call (man 2 mount). Currently only the following flag
* is implemented:
* MS_RDONLY - mount volume read-only
* MS_NOATIME - do not update access time
*
* The function opens the device @dev and verifies that it contains a valid
* bootsector. Then, it allocates an ntfs_volume structure and initializes
@ -1136,9 +1133,8 @@ error_exit:
*
* @flags is an optional second parameter. The same flags are used as for
* the mount system call (man 2 mount). Currently only the following flags
* are implemented:
* is implemented:
* MS_RDONLY - mount volume read-only
* MS_NOATIME - do not update access time
*
* The function opens the device or file @name and verifies that it contains a
* valid bootsector. Then, it allocates an ntfs_volume structure and initializes

View File

@ -1210,7 +1210,7 @@ static int ntfs_fuse_utime(const char *path, struct utimbuf *buf)
ni->last_data_change_time = buf->modtime;
ntfs_fuse_update_times(ni, NTFS_UPDATE_CTIME);
} else
ntfs_fuse_update_times(ni, NTFS_UPDATE_AMCTIME);
ntfs_inode_update_times(ni, NTFS_UPDATE_AMCTIME);
if (ntfs_inode_close(ni))
set_fuse_error(&res);
@ -1620,8 +1620,6 @@ static int ntfs_open(const char *device, char *mntpoint)
flags |= MS_EXCLUSIVE;
if (ctx->ro)
flags |= MS_RDONLY;
if (ctx->noatime)
flags |= MS_NOATIME;
if (ctx->force)
flags |= MS_FORCE;
@ -1676,13 +1674,6 @@ static char *parse_mount_options(const char *orig_opts)
return NULL;
}
/*
* FIXME: Due to major performance hit and interference
* issues, always use the 'noatime' options for now.
*/
ctx->noatime = TRUE;
strcat(ret, "noatime,");
ctx->silent = TRUE;
s = options;
@ -1702,6 +1693,8 @@ static char *parse_mount_options(const char *orig_opts)
"have value.\n");
goto err_exit;
}
ctx->noatime = TRUE;
strcat(ret, "noatime,");
} else if (!strcmp(opt, "fake_rw")) {
if (val) {
ntfs_log_error("'fake_rw' option should not "