[Ocfs2-tools-devel] [PATCH 1/1] ocfs2-tools: add mount option relatime support
Joel Becker
Joel.Becker at oracle.com
Tue Mar 3 12:42:33 PST 2009
On Tue, Mar 03, 2009 at 10:23:56AM +0800, Tiger Yang wrote:
> diff --git a/mount.ocfs2/mount_constants.h b/mount.ocfs2/mount_constants.h
> index 61e8969..ed475db 100644
> --- a/mount.ocfs2/mount_constants.h
> +++ b/mount.ocfs2/mount_constants.h
> @@ -57,6 +57,9 @@ if we have a stack or plain mount - mount atop of it, forming a stack. */
> #ifndef MS_VERBOSE
> #define MS_VERBOSE 0x8000 /* 32768 */
> #endif
> +#ifndef MS_RELATIME
> +#define MS_RELATIME (1<<21) /* Update atime relative to mtime/ctime. */
> +#endif
> /*
> * Magic mount flag number. Had to be or-ed to the flag values.
> */
> diff --git a/mount.ocfs2/opts.c b/mount.ocfs2/opts.c
> index f90ef54..f834c9e 100644
> --- a/mount.ocfs2/opts.c
> +++ b/mount.ocfs2/opts.c
> @@ -84,6 +84,10 @@ static const struct opt_map opt_map[] = {
> { "atime", 0, 1, MS_NOATIME }, /* Update access time */
> { "noatime", 0, 0, MS_NOATIME }, /* Do not update access time */
> #endif
> +#ifdef MS_RELATIME
> + { "relatime", 0, 0, MS_RELATIME }, /* only update atime if previous */
> + /* atime is older than mtime/ctime */
> +#endif
The #ifdef is useless, because you ensure that MS_RELATIME is
defined in mount_constants.h. So just leave out the #ifdef.
The same is in fact true of NOATIME, NODIRATIME, and MANDLOCK.
Joel
--
Life's Little Instruction Book #237
"Seek out the good in people."
Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127
More information about the Ocfs2-tools-devel
mailing list