Lines Matching defs:nilfs
13 #include "nilfs.h"
19 /* /sys/fs/<nilfs>/ */
26 struct the_nilfs *nilfs = container_of(kobj->parent, \
32 return a->show ? a->show(a, nilfs, buf) : 0; \
38 struct the_nilfs *nilfs = container_of(kobj->parent, \
44 return a->store ? a->store(a, nilfs, buf, len) : 0; \
66 static int nilfs_sysfs_create_##name##_group(struct the_nilfs *nilfs) \
73 subgroups = nilfs->ns_##parent_name##_subgroups; \
76 parent = &nilfs->ns_##parent_name##_kobj; \
85 static void nilfs_sysfs_delete_##name##_group(struct the_nilfs *nilfs) \
87 kobject_put(&nilfs->ns_##parent_name##_subgroups->sg_##name##_kobj); \
177 struct the_nilfs *nilfs;
181 nilfs = root->nilfs;
182 parent = &nilfs->ns_dev_subgroups->sg_mounted_snapshots_kobj;
189 &nilfs->ns_dev_kobj,
219 struct the_nilfs *nilfs, char *buf)
242 struct the_nilfs *nilfs,
249 down_read(&nilfs->ns_segctor_sem);
250 err = nilfs_cpfile_get_stat(nilfs->ns_cpfile, &cpstat);
251 up_read(&nilfs->ns_segctor_sem);
253 nilfs_err(nilfs->ns_sb, "unable to get checkpoint stat: err=%d",
265 struct the_nilfs *nilfs,
272 down_read(&nilfs->ns_segctor_sem);
273 err = nilfs_cpfile_get_stat(nilfs->ns_cpfile, &cpstat);
274 up_read(&nilfs->ns_segctor_sem);
276 nilfs_err(nilfs->ns_sb, "unable to get checkpoint stat: err=%d",
288 struct the_nilfs *nilfs,
293 spin_lock(&nilfs->ns_last_segment_lock);
294 last_cno = nilfs->ns_last_cno;
295 spin_unlock(&nilfs->ns_last_segment_lock);
302 struct the_nilfs *nilfs,
307 down_read(&nilfs->ns_segctor_sem);
308 cno = nilfs->ns_cno;
309 up_read(&nilfs->ns_segctor_sem);
325 struct the_nilfs *nilfs, char *buf)
356 struct the_nilfs *nilfs,
359 return sysfs_emit(buf, "%lu\n", nilfs->ns_nsegments);
364 struct the_nilfs *nilfs,
367 return sysfs_emit(buf, "%lu\n", nilfs->ns_blocks_per_segment);
372 struct the_nilfs *nilfs,
377 down_read(&NILFS_MDT(nilfs->ns_dat)->mi_sem);
378 ncleansegs = nilfs_sufile_get_ncleansegs(nilfs->ns_sufile);
379 up_read(&NILFS_MDT(nilfs->ns_dat)->mi_sem);
386 struct the_nilfs *nilfs,
392 down_read(&nilfs->ns_segctor_sem);
393 err = nilfs_sufile_get_stat(nilfs->ns_sufile, &sustat);
394 up_read(&nilfs->ns_segctor_sem);
396 nilfs_err(nilfs->ns_sb, "unable to get segment stat: err=%d",
414 struct the_nilfs *nilfs,
446 struct the_nilfs *nilfs,
451 spin_lock(&nilfs->ns_last_segment_lock);
452 last_pseg = nilfs->ns_last_pseg;
453 spin_unlock(&nilfs->ns_last_segment_lock);
461 struct the_nilfs *nilfs,
466 spin_lock(&nilfs->ns_last_segment_lock);
467 last_seq = nilfs->ns_last_seq;
468 spin_unlock(&nilfs->ns_last_segment_lock);
475 struct the_nilfs *nilfs,
480 spin_lock(&nilfs->ns_last_segment_lock);
481 last_cno = nilfs->ns_last_cno;
482 spin_unlock(&nilfs->ns_last_segment_lock);
489 struct the_nilfs *nilfs,
494 down_read(&nilfs->ns_segctor_sem);
495 seg_seq = nilfs->ns_seg_seq;
496 up_read(&nilfs->ns_segctor_sem);
503 struct the_nilfs *nilfs,
508 down_read(&nilfs->ns_segctor_sem);
509 segnum = nilfs->ns_segnum;
510 up_read(&nilfs->ns_segctor_sem);
517 struct the_nilfs *nilfs,
522 down_read(&nilfs->ns_segctor_sem);
523 nextnum = nilfs->ns_nextnum;
524 up_read(&nilfs->ns_segctor_sem);
531 struct the_nilfs *nilfs,
536 down_read(&nilfs->ns_segctor_sem);
537 pseg_offset = nilfs->ns_pseg_offset;
538 up_read(&nilfs->ns_segctor_sem);
545 struct the_nilfs *nilfs,
550 down_read(&nilfs->ns_segctor_sem);
551 cno = nilfs->ns_cno;
552 up_read(&nilfs->ns_segctor_sem);
559 struct the_nilfs *nilfs,
564 down_read(&nilfs->ns_segctor_sem);
565 ctime = nilfs->ns_ctime;
566 up_read(&nilfs->ns_segctor_sem);
573 struct the_nilfs *nilfs,
578 down_read(&nilfs->ns_segctor_sem);
579 ctime = nilfs->ns_ctime;
580 up_read(&nilfs->ns_segctor_sem);
587 struct the_nilfs *nilfs,
592 down_read(&nilfs->ns_segctor_sem);
593 nongc_ctime = nilfs->ns_nongc_ctime;
594 up_read(&nilfs->ns_segctor_sem);
601 struct the_nilfs *nilfs,
606 down_read(&nilfs->ns_segctor_sem);
607 nongc_ctime = nilfs->ns_nongc_ctime;
608 up_read(&nilfs->ns_segctor_sem);
615 struct the_nilfs *nilfs,
620 down_read(&nilfs->ns_segctor_sem);
621 ndirtyblks = atomic_read(&nilfs->ns_ndirtyblks);
622 up_read(&nilfs->ns_segctor_sem);
659 struct the_nilfs *nilfs, char *buf)
708 struct the_nilfs *nilfs,
713 down_read(&nilfs->ns_sem);
714 sbwtime = nilfs->ns_sbwtime;
715 up_read(&nilfs->ns_sem);
722 struct the_nilfs *nilfs,
727 down_read(&nilfs->ns_sem);
728 sbwtime = nilfs->ns_sbwtime;
729 up_read(&nilfs->ns_sem);
736 struct the_nilfs *nilfs,
741 down_read(&nilfs->ns_sem);
742 sbwcount = nilfs->ns_sbwcount;
743 up_read(&nilfs->ns_sem);
750 struct the_nilfs *nilfs,
755 down_read(&nilfs->ns_sem);
756 sb_update_freq = nilfs->ns_sb_update_freq;
757 up_read(&nilfs->ns_sem);
764 struct the_nilfs *nilfs,
772 nilfs_err(nilfs->ns_sb, "unable to convert string: err=%d",
779 nilfs_warn(nilfs->ns_sb,
783 down_write(&nilfs->ns_sem);
784 nilfs->ns_sb_update_freq = val;
785 up_write(&nilfs->ns_sem);
801 "\t'echo <val> > /sys/fs/<nilfs>/<dev>/superblock/sb_update_frequency'\n";
805 struct the_nilfs *nilfs, char *buf)
836 struct the_nilfs *nilfs,
839 struct nilfs_super_block **sbp = nilfs->ns_sbp;
848 struct the_nilfs *nilfs,
851 return sysfs_emit(buf, "%u\n", nilfs->ns_blocksize);
856 struct the_nilfs *nilfs,
859 struct nilfs_super_block **sbp = nilfs->ns_sbp;
867 struct the_nilfs *nilfs,
872 nilfs_count_free_blocks(nilfs, &free_blocks);
879 struct the_nilfs *nilfs,
882 struct nilfs_super_block **sbp = nilfs->ns_sbp;
889 struct the_nilfs *nilfs,
892 struct nilfs_super_block **sbp = nilfs->ns_sbp;
909 struct the_nilfs *nilfs,
938 struct the_nilfs *nilfs = container_of(kobj, struct the_nilfs,
943 return a->show ? a->show(a, nilfs, buf) : 0;
950 struct the_nilfs *nilfs = container_of(kobj, struct the_nilfs,
955 return a->store ? a->store(a, nilfs, buf, len) : 0;
960 struct the_nilfs *nilfs = container_of(kobj, struct the_nilfs,
962 complete(&nilfs->ns_dev_kobj_unregister);
978 struct the_nilfs *nilfs = sb->s_fs_info;
982 nilfs->ns_dev_subgroups = kzalloc(devgrp_size, GFP_KERNEL);
983 if (unlikely(!nilfs->ns_dev_subgroups)) {
989 nilfs->ns_dev_kobj.kset = nilfs_kset;
990 init_completion(&nilfs->ns_dev_kobj_unregister);
991 err = kobject_init_and_add(&nilfs->ns_dev_kobj, &nilfs_dev_ktype, NULL,
996 err = nilfs_sysfs_create_mounted_snapshots_group(nilfs);
1000 err = nilfs_sysfs_create_checkpoints_group(nilfs);
1004 err = nilfs_sysfs_create_segments_group(nilfs);
1008 err = nilfs_sysfs_create_superblock_group(nilfs);
1012 err = nilfs_sysfs_create_segctor_group(nilfs);
1019 nilfs_sysfs_delete_superblock_group(nilfs);
1022 nilfs_sysfs_delete_segments_group(nilfs);
1025 nilfs_sysfs_delete_checkpoints_group(nilfs);
1028 nilfs_sysfs_delete_mounted_snapshots_group(nilfs);
1031 kobject_put(&nilfs->ns_dev_kobj);
1032 kfree(nilfs->ns_dev_subgroups);
1038 void nilfs_sysfs_delete_device_group(struct the_nilfs *nilfs)
1040 nilfs_sysfs_delete_mounted_snapshots_group(nilfs);
1041 nilfs_sysfs_delete_checkpoints_group(nilfs);
1042 nilfs_sysfs_delete_segments_group(nilfs);
1043 nilfs_sysfs_delete_superblock_group(nilfs);
1044 nilfs_sysfs_delete_segctor_group(nilfs);
1045 kobject_del(&nilfs->ns_dev_kobj);
1046 kobject_put(&nilfs->ns_dev_kobj);
1047 kfree(nilfs->ns_dev_subgroups);