Lines Matching refs:nilfs
207 static inline void set_nilfs_##name(struct the_nilfs *nilfs) \
209 set_bit(THE_NILFS_##bit, &(nilfs)->ns_flags); \
211 static inline void clear_nilfs_##name(struct the_nilfs *nilfs) \
213 clear_bit(THE_NILFS_##bit, &(nilfs)->ns_flags); \
215 static inline int nilfs_##name(struct the_nilfs *nilfs) \
217 return test_bit(THE_NILFS_##bit, &(nilfs)->ns_flags); \
228 #define nilfs_clear_opt(nilfs, opt) \ argument
229 do { (nilfs)->ns_mount_opt &= ~NILFS_MOUNT_##opt; } while (0)
230 #define nilfs_set_opt(nilfs, opt) \ argument
231 do { (nilfs)->ns_mount_opt |= NILFS_MOUNT_##opt; } while (0)
232 #define nilfs_test_opt(nilfs, opt) ((nilfs)->ns_mount_opt & NILFS_MOUNT_##opt) argument
233 #define nilfs_write_opt(nilfs, mask, opt) \ argument
234 do { (nilfs)->ns_mount_opt = \
235 (((nilfs)->ns_mount_opt & ~NILFS_MOUNT_##mask) | \
256 struct the_nilfs *nilfs; member
273 static inline int nilfs_sb_need_update(struct the_nilfs *nilfs) in nilfs_sb_need_update() argument
276 return t < nilfs->ns_sbwtime || in nilfs_sb_need_update()
277 t > nilfs->ns_sbwtime + nilfs->ns_sb_update_freq; in nilfs_sb_need_update()
280 static inline int nilfs_sb_will_flip(struct the_nilfs *nilfs) in nilfs_sb_will_flip() argument
282 int flip_bits = nilfs->ns_sbwcount & 0x0FL; in nilfs_sb_will_flip()
288 void destroy_nilfs(struct the_nilfs *nilfs);
289 int init_nilfs(struct the_nilfs *nilfs, struct super_block *sb, char *data);
290 int load_nilfs(struct the_nilfs *nilfs, struct super_block *sb);
291 unsigned long nilfs_nrsvsegs(struct the_nilfs *nilfs, unsigned long nsegs);
292 void nilfs_set_nsegments(struct the_nilfs *nilfs, unsigned long nsegs);
295 struct nilfs_root *nilfs_lookup_root(struct the_nilfs *nilfs, __u64 cno);
296 struct nilfs_root *nilfs_find_or_create_root(struct the_nilfs *nilfs,
309 static inline int nilfs_valid_fs(struct the_nilfs *nilfs) in nilfs_valid_fs() argument
313 down_read(&nilfs->ns_sem); in nilfs_valid_fs()
314 valid_fs = (nilfs->ns_mount_state & NILFS_VALID_FS); in nilfs_valid_fs()
315 up_read(&nilfs->ns_sem); in nilfs_valid_fs()
320 nilfs_get_segment_range(struct the_nilfs *nilfs, __u64 segnum, in nilfs_get_segment_range() argument
323 *seg_start = (sector_t)nilfs->ns_blocks_per_segment * segnum; in nilfs_get_segment_range()
324 *seg_end = *seg_start + nilfs->ns_blocks_per_segment - 1; in nilfs_get_segment_range()
326 *seg_start = nilfs->ns_first_data_block; in nilfs_get_segment_range()
330 nilfs_get_segment_start_blocknr(struct the_nilfs *nilfs, __u64 segnum) in nilfs_get_segment_start_blocknr() argument
332 return (segnum == 0) ? nilfs->ns_first_data_block : in nilfs_get_segment_start_blocknr()
333 (sector_t)nilfs->ns_blocks_per_segment * segnum; in nilfs_get_segment_start_blocknr()
337 nilfs_get_segnum_of_block(struct the_nilfs *nilfs, sector_t blocknr) in nilfs_get_segnum_of_block() argument
341 sector_div(segnum, nilfs->ns_blocks_per_segment); in nilfs_get_segnum_of_block()
346 nilfs_terminate_segment(struct the_nilfs *nilfs, sector_t seg_start, in nilfs_terminate_segment() argument
350 nilfs->ns_pseg_offset = seg_end - seg_start + 1; in nilfs_terminate_segment()
353 static inline void nilfs_shift_to_next_segment(struct the_nilfs *nilfs) in nilfs_shift_to_next_segment() argument
356 nilfs->ns_segnum = nilfs->ns_nextnum; in nilfs_shift_to_next_segment()
357 nilfs->ns_pseg_offset = 0; in nilfs_shift_to_next_segment()
358 nilfs->ns_seg_seq++; in nilfs_shift_to_next_segment()
361 static inline __u64 nilfs_last_cno(struct the_nilfs *nilfs) in nilfs_last_cno() argument
365 spin_lock(&nilfs->ns_last_segment_lock); in nilfs_last_cno()
366 cno = nilfs->ns_last_cno; in nilfs_last_cno()
367 spin_unlock(&nilfs->ns_last_segment_lock); in nilfs_last_cno()
371 static inline int nilfs_segment_is_active(struct the_nilfs *nilfs, __u64 n) in nilfs_segment_is_active() argument
373 return n == nilfs->ns_segnum || n == nilfs->ns_nextnum; in nilfs_segment_is_active()
376 static inline int nilfs_flush_device(struct the_nilfs *nilfs) in nilfs_flush_device() argument
380 if (!nilfs_test_opt(nilfs, BARRIER) || nilfs->ns_flushed_device) in nilfs_flush_device()
383 nilfs->ns_flushed_device = 1; in nilfs_flush_device()
390 err = blkdev_issue_flush(nilfs->ns_bdev, GFP_KERNEL, NULL); in nilfs_flush_device()