Lines Matching defs:nilfs

13 #include "nilfs.h"
19 /* /sys/fs/<nilfs>/ */
39 struct the_nilfs *nilfs = container_of(kobj->parent, \
45 return a->show ? a->show(a, nilfs, buf) : 0; \
51 struct the_nilfs *nilfs = container_of(kobj->parent, \
57 return a->store ? a->store(a, nilfs, buf, len) : 0; \
79 static int nilfs_sysfs_create_##name##_group(struct the_nilfs *nilfs) \
86 subgroups = nilfs->ns_##parent_name##_subgroups; \
89 parent = &nilfs->ns_##parent_name##_kobj; \
98 static void nilfs_sysfs_delete_##name##_group(struct the_nilfs *nilfs) \
100 kobject_put(&nilfs->ns_##parent_name##_subgroups->sg_##name##_kobj); \
189 struct the_nilfs *nilfs;
193 nilfs = root->nilfs;
194 parent = &nilfs->ns_dev_subgroups->sg_mounted_snapshots_kobj;
201 &nilfs->ns_dev_kobj,
231 struct the_nilfs *nilfs, char *buf)
253 struct the_nilfs *nilfs,
260 down_read(&nilfs->ns_segctor_sem);
261 err = nilfs_cpfile_get_stat(nilfs->ns_cpfile, &cpstat);
262 up_read(&nilfs->ns_segctor_sem);
264 nilfs_err(nilfs->ns_sb, "unable to get checkpoint stat: err=%d",
276 struct the_nilfs *nilfs,
283 down_read(&nilfs->ns_segctor_sem);
284 err = nilfs_cpfile_get_stat(nilfs->ns_cpfile, &cpstat);
285 up_read(&nilfs->ns_segctor_sem);
287 nilfs_err(nilfs->ns_sb, "unable to get checkpoint stat: err=%d",
299 struct the_nilfs *nilfs,
304 spin_lock(&nilfs->ns_last_segment_lock);
305 last_cno = nilfs->ns_last_cno;
306 spin_unlock(&nilfs->ns_last_segment_lock);
313 struct the_nilfs *nilfs,
318 down_read(&nilfs->ns_segctor_sem);
319 cno = nilfs->ns_cno;
320 up_read(&nilfs->ns_segctor_sem);
336 struct the_nilfs *nilfs, char *buf)
366 struct the_nilfs *nilfs,
369 return snprintf(buf, PAGE_SIZE, "%lu\n", nilfs->ns_nsegments);
374 struct the_nilfs *nilfs,
377 return snprintf(buf, PAGE_SIZE, "%lu\n", nilfs->ns_blocks_per_segment);
382 struct the_nilfs *nilfs,
387 down_read(&NILFS_MDT(nilfs->ns_dat)->mi_sem);
388 ncleansegs = nilfs_sufile_get_ncleansegs(nilfs->ns_sufile);
389 up_read(&NILFS_MDT(nilfs->ns_dat)->mi_sem);
396 struct the_nilfs *nilfs,
402 down_read(&nilfs->ns_segctor_sem);
403 err = nilfs_sufile_get_stat(nilfs->ns_sufile, &sustat);
404 up_read(&nilfs->ns_segctor_sem);
406 nilfs_err(nilfs->ns_sb, "unable to get segment stat: err=%d",
424 struct the_nilfs *nilfs,
455 struct the_nilfs *nilfs,
460 spin_lock(&nilfs->ns_last_segment_lock);
461 last_pseg = nilfs->ns_last_pseg;
462 spin_unlock(&nilfs->ns_last_segment_lock);
470 struct the_nilfs *nilfs,
475 spin_lock(&nilfs->ns_last_segment_lock);
476 last_seq = nilfs->ns_last_seq;
477 spin_unlock(&nilfs->ns_last_segment_lock);
484 struct the_nilfs *nilfs,
489 spin_lock(&nilfs->ns_last_segment_lock);
490 last_cno = nilfs->ns_last_cno;
491 spin_unlock(&nilfs->ns_last_segment_lock);
498 struct the_nilfs *nilfs,
503 down_read(&nilfs->ns_segctor_sem);
504 seg_seq = nilfs->ns_seg_seq;
505 up_read(&nilfs->ns_segctor_sem);
512 struct the_nilfs *nilfs,
517 down_read(&nilfs->ns_segctor_sem);
518 segnum = nilfs->ns_segnum;
519 up_read(&nilfs->ns_segctor_sem);
526 struct the_nilfs *nilfs,
531 down_read(&nilfs->ns_segctor_sem);
532 nextnum = nilfs->ns_nextnum;
533 up_read(&nilfs->ns_segctor_sem);
540 struct the_nilfs *nilfs,
545 down_read(&nilfs->ns_segctor_sem);
546 pseg_offset = nilfs->ns_pseg_offset;
547 up_read(&nilfs->ns_segctor_sem);
554 struct the_nilfs *nilfs,
559 down_read(&nilfs->ns_segctor_sem);
560 cno = nilfs->ns_cno;
561 up_read(&nilfs->ns_segctor_sem);
568 struct the_nilfs *nilfs,
573 down_read(&nilfs->ns_segctor_sem);
574 ctime = nilfs->ns_ctime;
575 up_read(&nilfs->ns_segctor_sem);
582 struct the_nilfs *nilfs,
587 down_read(&nilfs->ns_segctor_sem);
588 ctime = nilfs->ns_ctime;
589 up_read(&nilfs->ns_segctor_sem);
596 struct the_nilfs *nilfs,
601 down_read(&nilfs->ns_segctor_sem);
602 nongc_ctime = nilfs->ns_nongc_ctime;
603 up_read(&nilfs->ns_segctor_sem);
610 struct the_nilfs *nilfs,
615 down_read(&nilfs->ns_segctor_sem);
616 nongc_ctime = nilfs->ns_nongc_ctime;
617 up_read(&nilfs->ns_segctor_sem);
624 struct the_nilfs *nilfs,
629 down_read(&nilfs->ns_segctor_sem);
630 ndirtyblks = atomic_read(&nilfs->ns_ndirtyblks);
631 up_read(&nilfs->ns_segctor_sem);
668 struct the_nilfs *nilfs, char *buf)
716 struct the_nilfs *nilfs,
721 down_read(&nilfs->ns_sem);
722 sbwtime = nilfs->ns_sbwtime;
723 up_read(&nilfs->ns_sem);
730 struct the_nilfs *nilfs,
735 down_read(&nilfs->ns_sem);
736 sbwtime = nilfs->ns_sbwtime;
737 up_read(&nilfs->ns_sem);
744 struct the_nilfs *nilfs,
749 down_read(&nilfs->ns_sem);
750 sbwcount = nilfs->ns_sbwcount;
751 up_read(&nilfs->ns_sem);
758 struct the_nilfs *nilfs,
763 down_read(&nilfs->ns_sem);
764 sb_update_freq = nilfs->ns_sb_update_freq;
765 up_read(&nilfs->ns_sem);
772 struct the_nilfs *nilfs,
780 nilfs_err(nilfs->ns_sb, "unable to convert string: err=%d",
787 nilfs_warn(nilfs->ns_sb,
791 down_write(&nilfs->ns_sem);
792 nilfs->ns_sb_update_freq = val;
793 up_write(&nilfs->ns_sem);
809 "\t'echo <val> > /sys/fs/<nilfs>/<dev>/superblock/sb_update_frequency'\n";
813 struct the_nilfs *nilfs, char *buf)
843 struct the_nilfs *nilfs,
846 struct nilfs_super_block **sbp = nilfs->ns_sbp;
855 struct the_nilfs *nilfs,
858 return snprintf(buf, PAGE_SIZE, "%u\n", nilfs->ns_blocksize);
863 struct the_nilfs *nilfs,
866 struct nilfs_super_block **sbp = nilfs->ns_sbp;
874 struct the_nilfs *nilfs,
879 nilfs_count_free_blocks(nilfs, &free_blocks);
886 struct the_nilfs *nilfs,
889 struct nilfs_super_block **sbp = nilfs->ns_sbp;
896 struct the_nilfs *nilfs,
899 struct nilfs_super_block **sbp = nilfs->ns_sbp;
916 struct the_nilfs *nilfs,
944 struct the_nilfs *nilfs = container_of(kobj, struct the_nilfs,
949 return a->show ? a->show(a, nilfs, buf) : 0;
956 struct the_nilfs *nilfs = container_of(kobj, struct the_nilfs,
961 return a->store ? a->store(a, nilfs, buf, len) : 0;
966 struct the_nilfs *nilfs = container_of(kobj, struct the_nilfs,
968 complete(&nilfs->ns_dev_kobj_unregister);
984 struct the_nilfs *nilfs = sb->s_fs_info;
988 nilfs->ns_dev_subgroups = kzalloc(devgrp_size, GFP_KERNEL);
989 if (unlikely(!nilfs->ns_dev_subgroups)) {
995 nilfs->ns_dev_kobj.kset = nilfs_kset;
996 init_completion(&nilfs->ns_dev_kobj_unregister);
997 err = kobject_init_and_add(&nilfs->ns_dev_kobj, &nilfs_dev_ktype, NULL,
1002 err = nilfs_sysfs_create_mounted_snapshots_group(nilfs);
1006 err = nilfs_sysfs_create_checkpoints_group(nilfs);
1010 err = nilfs_sysfs_create_segments_group(nilfs);
1014 err = nilfs_sysfs_create_superblock_group(nilfs);
1018 err = nilfs_sysfs_create_segctor_group(nilfs);
1025 nilfs_sysfs_delete_superblock_group(nilfs);
1028 nilfs_sysfs_delete_segments_group(nilfs);
1031 nilfs_sysfs_delete_checkpoints_group(nilfs);
1034 nilfs_sysfs_delete_mounted_snapshots_group(nilfs);
1037 kobject_put(&nilfs->ns_dev_kobj);
1038 kfree(nilfs->ns_dev_subgroups);
1044 void nilfs_sysfs_delete_device_group(struct the_nilfs *nilfs)
1046 nilfs_sysfs_delete_mounted_snapshots_group(nilfs);
1047 nilfs_sysfs_delete_checkpoints_group(nilfs);
1048 nilfs_sysfs_delete_segments_group(nilfs);
1049 nilfs_sysfs_delete_superblock_group(nilfs);
1050 nilfs_sysfs_delete_segctor_group(nilfs);
1051 kobject_del(&nilfs->ns_dev_kobj);
1052 kobject_put(&nilfs->ns_dev_kobj);
1053 kfree(nilfs->ns_dev_subgroups);