Lines Matching defs:nilfs

36  * struct the_nilfs - struct to supervise multiple nilfs mount points
91 * @ns_dev_kobj: /sys/fs/<nilfs>/<device>
188 /* /sys/fs/<nilfs>/<device> */
195 static inline void set_nilfs_##name(struct the_nilfs *nilfs) \
197 set_bit(THE_NILFS_##bit, &(nilfs)->ns_flags); \
199 static inline void clear_nilfs_##name(struct the_nilfs *nilfs) \
201 clear_bit(THE_NILFS_##bit, &(nilfs)->ns_flags); \
203 static inline int nilfs_##name(struct the_nilfs *nilfs) \
205 return test_bit(THE_NILFS_##bit, &(nilfs)->ns_flags); \
217 #define nilfs_clear_opt(nilfs, opt) \
218 ((nilfs)->ns_mount_opt &= ~NILFS_MOUNT_##opt)
219 #define nilfs_set_opt(nilfs, opt) \
220 ((nilfs)->ns_mount_opt |= NILFS_MOUNT_##opt)
221 #define nilfs_test_opt(nilfs, opt) ((nilfs)->ns_mount_opt & NILFS_MOUNT_##opt)
222 #define nilfs_write_opt(nilfs, mask, opt) \
223 ((nilfs)->ns_mount_opt = \
224 (((nilfs)->ns_mount_opt & ~NILFS_MOUNT_##mask) | \
228 * struct nilfs_root - nilfs root object
232 * @nilfs: nilfs object
236 * @snapshot_kobj: /sys/fs/<nilfs>/<device>/mounted_snapshots/<snapshot>
244 struct the_nilfs *nilfs;
250 /* /sys/fs/<nilfs>/<device>/mounted_snapshots/<snapshot> */
261 static inline int nilfs_sb_need_update(struct the_nilfs *nilfs)
265 return t < nilfs->ns_sbwtime ||
266 t > nilfs->ns_sbwtime + nilfs->ns_sb_update_freq;
269 static inline int nilfs_sb_will_flip(struct the_nilfs *nilfs)
271 int flip_bits = nilfs->ns_sbwcount & 0x0FL;
278 void destroy_nilfs(struct the_nilfs *nilfs);
279 int init_nilfs(struct the_nilfs *nilfs, struct super_block *sb, char *data);
280 int load_nilfs(struct the_nilfs *nilfs, struct super_block *sb);
281 unsigned long nilfs_nrsvsegs(struct the_nilfs *nilfs, unsigned long nsegs);
282 void nilfs_set_nsegments(struct the_nilfs *nilfs, unsigned long nsegs);
285 struct nilfs_root *nilfs_lookup_root(struct the_nilfs *nilfs, __u64 cno);
286 struct nilfs_root *nilfs_find_or_create_root(struct the_nilfs *nilfs,
299 static inline int nilfs_valid_fs(struct the_nilfs *nilfs)
303 down_read(&nilfs->ns_sem);
304 valid_fs = (nilfs->ns_mount_state & NILFS_VALID_FS);
305 up_read(&nilfs->ns_sem);
310 nilfs_get_segment_range(struct the_nilfs *nilfs, __u64 segnum,
313 *seg_start = (sector_t)nilfs->ns_blocks_per_segment * segnum;
314 *seg_end = *seg_start + nilfs->ns_blocks_per_segment - 1;
316 *seg_start = nilfs->ns_first_data_block;
320 nilfs_get_segment_start_blocknr(struct the_nilfs *nilfs, __u64 segnum)
322 return (segnum == 0) ? nilfs->ns_first_data_block :
323 (sector_t)nilfs->ns_blocks_per_segment * segnum;
327 nilfs_get_segnum_of_block(struct the_nilfs *nilfs, sector_t blocknr)
331 sector_div(segnum, nilfs->ns_blocks_per_segment);
336 nilfs_terminate_segment(struct the_nilfs *nilfs, sector_t seg_start,
340 nilfs->ns_pseg_offset = seg_end - seg_start + 1;
343 static inline void nilfs_shift_to_next_segment(struct the_nilfs *nilfs)
346 nilfs->ns_segnum = nilfs->ns_nextnum;
347 nilfs->ns_pseg_offset = 0;
348 nilfs->ns_seg_seq++;
351 static inline __u64 nilfs_last_cno(struct the_nilfs *nilfs)
355 spin_lock(&nilfs->ns_last_segment_lock);
356 cno = nilfs->ns_last_cno;
357 spin_unlock(&nilfs->ns_last_segment_lock);
361 static inline int nilfs_segment_is_active(struct the_nilfs *nilfs, __u64 n)
363 return n == nilfs->ns_segnum || n == nilfs->ns_nextnum;
366 static inline int nilfs_flush_device(struct the_nilfs *nilfs)
370 if (!nilfs_test_opt(nilfs, BARRIER) || nilfs->ns_flushed_device)
373 nilfs->ns_flushed_device = 1;
380 err = blkdev_issue_flush(nilfs->ns_bdev, GFP_KERNEL);