Lines Matching refs:nilfs

194 static inline void set_nilfs_##name(struct the_nilfs *nilfs)		\
196 set_bit(THE_NILFS_##bit, &(nilfs)->ns_flags); \
198 static inline void clear_nilfs_##name(struct the_nilfs *nilfs) \
200 clear_bit(THE_NILFS_##bit, &(nilfs)->ns_flags); \
202 static inline int nilfs_##name(struct the_nilfs *nilfs) \
204 return test_bit(THE_NILFS_##bit, &(nilfs)->ns_flags); \
215 #define nilfs_clear_opt(nilfs, opt) \ argument
216 ((nilfs)->ns_mount_opt &= ~NILFS_MOUNT_##opt)
217 #define nilfs_set_opt(nilfs, opt) \ argument
218 ((nilfs)->ns_mount_opt |= NILFS_MOUNT_##opt)
219 #define nilfs_test_opt(nilfs, opt) ((nilfs)->ns_mount_opt & NILFS_MOUNT_##opt) argument
220 #define nilfs_write_opt(nilfs, mask, opt) \ argument
221 ((nilfs)->ns_mount_opt = \
222 (((nilfs)->ns_mount_opt & ~NILFS_MOUNT_##mask) | \
242 struct the_nilfs *nilfs; member
259 static inline int nilfs_sb_need_update(struct the_nilfs *nilfs) in nilfs_sb_need_update() argument
263 return t < nilfs->ns_sbwtime || in nilfs_sb_need_update()
264 t > nilfs->ns_sbwtime + nilfs->ns_sb_update_freq; in nilfs_sb_need_update()
267 static inline int nilfs_sb_will_flip(struct the_nilfs *nilfs) in nilfs_sb_will_flip() argument
269 int flip_bits = nilfs->ns_sbwcount & 0x0FL; in nilfs_sb_will_flip()
276 void destroy_nilfs(struct the_nilfs *nilfs);
277 int init_nilfs(struct the_nilfs *nilfs, struct super_block *sb, char *data);
278 int load_nilfs(struct the_nilfs *nilfs, struct super_block *sb);
279 unsigned long nilfs_nrsvsegs(struct the_nilfs *nilfs, unsigned long nsegs);
280 void nilfs_set_nsegments(struct the_nilfs *nilfs, unsigned long nsegs);
283 struct nilfs_root *nilfs_lookup_root(struct the_nilfs *nilfs, __u64 cno);
284 struct nilfs_root *nilfs_find_or_create_root(struct the_nilfs *nilfs,
297 static inline int nilfs_valid_fs(struct the_nilfs *nilfs) in nilfs_valid_fs() argument
301 down_read(&nilfs->ns_sem); in nilfs_valid_fs()
302 valid_fs = (nilfs->ns_mount_state & NILFS_VALID_FS); in nilfs_valid_fs()
303 up_read(&nilfs->ns_sem); in nilfs_valid_fs()
308 nilfs_get_segment_range(struct the_nilfs *nilfs, __u64 segnum, in nilfs_get_segment_range() argument
311 *seg_start = (sector_t)nilfs->ns_blocks_per_segment * segnum; in nilfs_get_segment_range()
312 *seg_end = *seg_start + nilfs->ns_blocks_per_segment - 1; in nilfs_get_segment_range()
314 *seg_start = nilfs->ns_first_data_block; in nilfs_get_segment_range()
318 nilfs_get_segment_start_blocknr(struct the_nilfs *nilfs, __u64 segnum) in nilfs_get_segment_start_blocknr() argument
320 return (segnum == 0) ? nilfs->ns_first_data_block : in nilfs_get_segment_start_blocknr()
321 (sector_t)nilfs->ns_blocks_per_segment * segnum; in nilfs_get_segment_start_blocknr()
325 nilfs_get_segnum_of_block(struct the_nilfs *nilfs, sector_t blocknr) in nilfs_get_segnum_of_block() argument
329 sector_div(segnum, nilfs->ns_blocks_per_segment); in nilfs_get_segnum_of_block()
334 nilfs_terminate_segment(struct the_nilfs *nilfs, sector_t seg_start, in nilfs_terminate_segment() argument
338 nilfs->ns_pseg_offset = seg_end - seg_start + 1; in nilfs_terminate_segment()
341 static inline void nilfs_shift_to_next_segment(struct the_nilfs *nilfs) in nilfs_shift_to_next_segment() argument
344 nilfs->ns_segnum = nilfs->ns_nextnum; in nilfs_shift_to_next_segment()
345 nilfs->ns_pseg_offset = 0; in nilfs_shift_to_next_segment()
346 nilfs->ns_seg_seq++; in nilfs_shift_to_next_segment()
349 static inline __u64 nilfs_last_cno(struct the_nilfs *nilfs) in nilfs_last_cno() argument
353 spin_lock(&nilfs->ns_last_segment_lock); in nilfs_last_cno()
354 cno = nilfs->ns_last_cno; in nilfs_last_cno()
355 spin_unlock(&nilfs->ns_last_segment_lock); in nilfs_last_cno()
359 static inline int nilfs_segment_is_active(struct the_nilfs *nilfs, __u64 n) in nilfs_segment_is_active() argument
361 return n == nilfs->ns_segnum || n == nilfs->ns_nextnum; in nilfs_segment_is_active()
364 static inline int nilfs_flush_device(struct the_nilfs *nilfs) in nilfs_flush_device() argument
368 if (!nilfs_test_opt(nilfs, BARRIER) || nilfs->ns_flushed_device) in nilfs_flush_device()
371 nilfs->ns_flushed_device = 1; in nilfs_flush_device()
378 err = blkdev_issue_flush(nilfs->ns_bdev, GFP_KERNEL, NULL); in nilfs_flush_device()