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.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/fs/nilfs2/the_nilfs.h b/fs/nilfs2/the_nilfs.h
index de8cc53b4a5c..d01ead1bea9a 100644
--- a/fs/nilfs2/the_nilfs.h
+++ b/fs/nilfs2/the_nilfs.h
@@ -33,6 +33,7 @@
33#include <linux/slab.h> 33#include <linux/slab.h>
34 34
35struct nilfs_sc_info; 35struct nilfs_sc_info;
36struct nilfs_sysfs_dev_subgroups;
36 37
37/* the_nilfs struct */ 38/* the_nilfs struct */
38enum { 39enum {
@@ -54,6 +55,7 @@ enum {
54 * @ns_sbwcount: write count of super block 55 * @ns_sbwcount: write count of super block
55 * @ns_sbsize: size of valid data in super block 56 * @ns_sbsize: size of valid data in super block
56 * @ns_mount_state: file system state 57 * @ns_mount_state: file system state
58 * @ns_sb_update_freq: interval of periodical update of superblocks (in seconds)
57 * @ns_seg_seq: segment sequence counter 59 * @ns_seg_seq: segment sequence counter
58 * @ns_segnum: index number of the latest full segment. 60 * @ns_segnum: index number of the latest full segment.
59 * @ns_nextnum: index number of the full segment index to be used next 61 * @ns_nextnum: index number of the full segment index to be used next
@@ -95,6 +97,9 @@ enum {
95 * @ns_inode_size: size of on-disk inode 97 * @ns_inode_size: size of on-disk inode
96 * @ns_first_ino: first not-special inode number 98 * @ns_first_ino: first not-special inode number
97 * @ns_crc_seed: seed value of CRC32 calculation 99 * @ns_crc_seed: seed value of CRC32 calculation
100 * @ns_dev_kobj: /sys/fs/<nilfs>/<device>
101 * @ns_dev_kobj_unregister: completion state
102 * @ns_dev_subgroups: <device> subgroups pointer
98 */ 103 */
99struct the_nilfs { 104struct the_nilfs {
100 unsigned long ns_flags; 105 unsigned long ns_flags;
@@ -114,6 +119,7 @@ struct the_nilfs {
114 unsigned ns_sbwcount; 119 unsigned ns_sbwcount;
115 unsigned ns_sbsize; 120 unsigned ns_sbsize;
116 unsigned ns_mount_state; 121 unsigned ns_mount_state;
122 unsigned ns_sb_update_freq;
117 123
118 /* 124 /*
119 * Following fields are dedicated to a writable FS-instance. 125 * Following fields are dedicated to a writable FS-instance.
@@ -188,6 +194,11 @@ struct the_nilfs {
188 int ns_inode_size; 194 int ns_inode_size;
189 int ns_first_ino; 195 int ns_first_ino;
190 u32 ns_crc_seed; 196 u32 ns_crc_seed;
197
198 /* /sys/fs/<nilfs>/<device> */
199 struct kobject ns_dev_kobj;
200 struct completion ns_dev_kobj_unregister;
201 struct nilfs_sysfs_dev_subgroups *ns_dev_subgroups;
191}; 202};
192 203
193#define THE_NILFS_FNS(bit, name) \ 204#define THE_NILFS_FNS(bit, name) \
@@ -232,6 +243,8 @@ THE_NILFS_FNS(SB_DIRTY, sb_dirty)
232 * @ifile: inode file 243 * @ifile: inode file
233 * @inodes_count: number of inodes 244 * @inodes_count: number of inodes
234 * @blocks_count: number of blocks 245 * @blocks_count: number of blocks
246 * @snapshot_kobj: /sys/fs/<nilfs>/<device>/mounted_snapshots/<snapshot>
247 * @snapshot_kobj_unregister: completion state for kernel object
235 */ 248 */
236struct nilfs_root { 249struct nilfs_root {
237 __u64 cno; 250 __u64 cno;
@@ -243,6 +256,10 @@ struct nilfs_root {
243 256
244 atomic64_t inodes_count; 257 atomic64_t inodes_count;
245 atomic64_t blocks_count; 258 atomic64_t blocks_count;
259
260 /* /sys/fs/<nilfs>/<device>/mounted_snapshots/<snapshot> */
261 struct kobject snapshot_kobj;
262 struct completion snapshot_kobj_unregister;
246}; 263};
247 264
248/* Special checkpoint number */ 265/* Special checkpoint number */
@@ -254,7 +271,8 @@ struct nilfs_root {
254static inline int nilfs_sb_need_update(struct the_nilfs *nilfs) 271static inline int nilfs_sb_need_update(struct the_nilfs *nilfs)
255{ 272{
256 u64 t = get_seconds(); 273 u64 t = get_seconds();
257 return t < nilfs->ns_sbwtime || t > nilfs->ns_sbwtime + NILFS_SB_FREQ; 274 return t < nilfs->ns_sbwtime ||
275 t > nilfs->ns_sbwtime + nilfs->ns_sb_update_freq;
258} 276}
259 277
260static inline int nilfs_sb_will_flip(struct the_nilfs *nilfs) 278static inline int nilfs_sb_will_flip(struct the_nilfs *nilfs)