diff options
author | Tiger Yang <tiger.yang@oracle.com> | 2006-11-15 02:48:42 -0500 |
---|---|---|
committer | Mark Fasheh <mark.fasheh@oracle.com> | 2006-12-01 21:28:51 -0500 |
commit | 7f1a37e31f94b4f1c123d32ce9f69205ab2095bd (patch) | |
tree | 7d2136573966de80d031e7320db11c15d7f93a92 /fs/ocfs2/super.c | |
parent | 8659ac25b434fcc61cf7797f4b69edc3eaaffb55 (diff) |
ocfs2: core atime update functions
This patch adds the core routines for updating atime in ocfs2.
Signed-off-by: Tiger Yang <tiger.yang@oracle.com>
Signed-off-by: Mark Fasheh <mark.fasheh@oracle.com>
Diffstat (limited to 'fs/ocfs2/super.c')
-rw-r--r-- | fs/ocfs2/super.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index d9b1eb6a3c6e..b0992573dee2 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c | |||
@@ -139,6 +139,7 @@ enum { | |||
139 | Opt_hb_local, | 139 | Opt_hb_local, |
140 | Opt_data_ordered, | 140 | Opt_data_ordered, |
141 | Opt_data_writeback, | 141 | Opt_data_writeback, |
142 | Opt_atime_quantum, | ||
142 | Opt_err, | 143 | Opt_err, |
143 | }; | 144 | }; |
144 | 145 | ||
@@ -152,6 +153,7 @@ static match_table_t tokens = { | |||
152 | {Opt_hb_local, OCFS2_HB_LOCAL}, | 153 | {Opt_hb_local, OCFS2_HB_LOCAL}, |
153 | {Opt_data_ordered, "data=ordered"}, | 154 | {Opt_data_ordered, "data=ordered"}, |
154 | {Opt_data_writeback, "data=writeback"}, | 155 | {Opt_data_writeback, "data=writeback"}, |
156 | {Opt_atime_quantum, "atime_quantum=%u"}, | ||
155 | {Opt_err, NULL} | 157 | {Opt_err, NULL} |
156 | }; | 158 | }; |
157 | 159 | ||
@@ -705,6 +707,7 @@ static int ocfs2_parse_options(struct super_block *sb, | |||
705 | while ((p = strsep(&options, ",")) != NULL) { | 707 | while ((p = strsep(&options, ",")) != NULL) { |
706 | int token, option; | 708 | int token, option; |
707 | substring_t args[MAX_OPT_ARGS]; | 709 | substring_t args[MAX_OPT_ARGS]; |
710 | struct ocfs2_super * osb = OCFS2_SB(sb); | ||
708 | 711 | ||
709 | if (!*p) | 712 | if (!*p) |
710 | continue; | 713 | continue; |
@@ -745,6 +748,16 @@ static int ocfs2_parse_options(struct super_block *sb, | |||
745 | case Opt_data_writeback: | 748 | case Opt_data_writeback: |
746 | *mount_opt |= OCFS2_MOUNT_DATA_WRITEBACK; | 749 | *mount_opt |= OCFS2_MOUNT_DATA_WRITEBACK; |
747 | break; | 750 | break; |
751 | case Opt_atime_quantum: | ||
752 | if (match_int(&args[0], &option)) { | ||
753 | status = 0; | ||
754 | goto bail; | ||
755 | } | ||
756 | if (option >= 0) | ||
757 | osb->s_atime_quantum = option; | ||
758 | else | ||
759 | osb->s_atime_quantum = OCFS2_DEFAULT_ATIME_QUANTUM; | ||
760 | break; | ||
748 | default: | 761 | default: |
749 | mlog(ML_ERROR, | 762 | mlog(ML_ERROR, |
750 | "Unrecognized mount option \"%s\" " | 763 | "Unrecognized mount option \"%s\" " |
@@ -1265,6 +1278,8 @@ static int ocfs2_initialize_super(struct super_block *sb, | |||
1265 | init_waitqueue_head(&osb->checkpoint_event); | 1278 | init_waitqueue_head(&osb->checkpoint_event); |
1266 | atomic_set(&osb->needs_checkpoint, 0); | 1279 | atomic_set(&osb->needs_checkpoint, 0); |
1267 | 1280 | ||
1281 | osb->s_atime_quantum = OCFS2_DEFAULT_ATIME_QUANTUM; | ||
1282 | |||
1268 | osb->node_num = O2NM_INVALID_NODE_NUM; | 1283 | osb->node_num = O2NM_INVALID_NODE_NUM; |
1269 | osb->slot_num = OCFS2_INVALID_SLOT; | 1284 | osb->slot_num = OCFS2_INVALID_SLOT; |
1270 | 1285 | ||