aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nilfs2/the_nilfs.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nilfs2/the_nilfs.h')
-rw-r--r--fs/nilfs2/the_nilfs.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/nilfs2/the_nilfs.h b/fs/nilfs2/the_nilfs.h
index fa3a1dfe4053..68e9626e3d44 100644
--- a/fs/nilfs2/the_nilfs.h
+++ b/fs/nilfs2/the_nilfs.h
@@ -200,6 +200,20 @@ THE_NILFS_FNS(DISCONTINUED, discontinued)
200#define NILFS_SB_FREQ 10 200#define NILFS_SB_FREQ 10
201#define NILFS_ALTSB_FREQ 60 /* spare superblock */ 201#define NILFS_ALTSB_FREQ 60 /* spare superblock */
202 202
203static inline int nilfs_sb_need_update(struct the_nilfs *nilfs)
204{
205 u64 t = get_seconds();
206 return t < nilfs->ns_sbwtime[0] ||
207 t > nilfs->ns_sbwtime[0] + NILFS_SB_FREQ;
208}
209
210static inline int nilfs_altsb_need_update(struct the_nilfs *nilfs)
211{
212 u64 t = get_seconds();
213 struct nilfs_super_block **sbp = nilfs->ns_sbp;
214 return sbp[1] && t > nilfs->ns_sbwtime[1] + NILFS_ALTSB_FREQ;
215}
216
203void nilfs_set_last_segment(struct the_nilfs *, sector_t, u64, __u64); 217void nilfs_set_last_segment(struct the_nilfs *, sector_t, u64, __u64);
204struct the_nilfs *find_or_create_nilfs(struct block_device *); 218struct the_nilfs *find_or_create_nilfs(struct block_device *);
205void put_nilfs(struct the_nilfs *); 219void put_nilfs(struct the_nilfs *);