Lines Matching refs: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; in nilfs_sysfs_create_snapshot_group() local
181 nilfs = root->nilfs; in nilfs_sysfs_create_snapshot_group()
182 parent = &nilfs->ns_dev_subgroups->sg_mounted_snapshots_kobj; in nilfs_sysfs_create_snapshot_group()
189 &nilfs->ns_dev_kobj, in nilfs_sysfs_create_snapshot_group()
219 struct the_nilfs *nilfs, char *buf) in nilfs_mounted_snapshots_README_show() argument
242 struct the_nilfs *nilfs, in nilfs_checkpoints_checkpoints_number_show() argument
249 down_read(&nilfs->ns_segctor_sem); in nilfs_checkpoints_checkpoints_number_show()
250 err = nilfs_cpfile_get_stat(nilfs->ns_cpfile, &cpstat); in nilfs_checkpoints_checkpoints_number_show()
251 up_read(&nilfs->ns_segctor_sem); in nilfs_checkpoints_checkpoints_number_show()
253 nilfs_err(nilfs->ns_sb, "unable to get checkpoint stat: err=%d", in nilfs_checkpoints_checkpoints_number_show()
265 struct the_nilfs *nilfs, in nilfs_checkpoints_snapshots_number_show() argument
272 down_read(&nilfs->ns_segctor_sem); in nilfs_checkpoints_snapshots_number_show()
273 err = nilfs_cpfile_get_stat(nilfs->ns_cpfile, &cpstat); in nilfs_checkpoints_snapshots_number_show()
274 up_read(&nilfs->ns_segctor_sem); in nilfs_checkpoints_snapshots_number_show()
276 nilfs_err(nilfs->ns_sb, "unable to get checkpoint stat: err=%d", in nilfs_checkpoints_snapshots_number_show()
288 struct the_nilfs *nilfs, in nilfs_checkpoints_last_seg_checkpoint_show() argument
293 spin_lock(&nilfs->ns_last_segment_lock); in nilfs_checkpoints_last_seg_checkpoint_show()
294 last_cno = nilfs->ns_last_cno; in nilfs_checkpoints_last_seg_checkpoint_show()
295 spin_unlock(&nilfs->ns_last_segment_lock); in nilfs_checkpoints_last_seg_checkpoint_show()
302 struct the_nilfs *nilfs, in nilfs_checkpoints_next_checkpoint_show() argument
307 down_read(&nilfs->ns_segctor_sem); in nilfs_checkpoints_next_checkpoint_show()
308 cno = nilfs->ns_cno; in nilfs_checkpoints_next_checkpoint_show()
309 up_read(&nilfs->ns_segctor_sem); in nilfs_checkpoints_next_checkpoint_show()
325 struct the_nilfs *nilfs, char *buf) in nilfs_checkpoints_README_show() argument
356 struct the_nilfs *nilfs, in nilfs_segments_segments_number_show() argument
359 return sysfs_emit(buf, "%lu\n", nilfs->ns_nsegments); in nilfs_segments_segments_number_show()
364 struct the_nilfs *nilfs, in nilfs_segments_blocks_per_segment_show() argument
367 return sysfs_emit(buf, "%lu\n", nilfs->ns_blocks_per_segment); in nilfs_segments_blocks_per_segment_show()
372 struct the_nilfs *nilfs, in nilfs_segments_clean_segments_show() argument
377 down_read(&NILFS_MDT(nilfs->ns_dat)->mi_sem); in nilfs_segments_clean_segments_show()
378 ncleansegs = nilfs_sufile_get_ncleansegs(nilfs->ns_sufile); in nilfs_segments_clean_segments_show()
379 up_read(&NILFS_MDT(nilfs->ns_dat)->mi_sem); in nilfs_segments_clean_segments_show()
386 struct the_nilfs *nilfs, in nilfs_segments_dirty_segments_show() argument
392 down_read(&nilfs->ns_segctor_sem); in nilfs_segments_dirty_segments_show()
393 err = nilfs_sufile_get_stat(nilfs->ns_sufile, &sustat); in nilfs_segments_dirty_segments_show()
394 up_read(&nilfs->ns_segctor_sem); in nilfs_segments_dirty_segments_show()
396 nilfs_err(nilfs->ns_sb, "unable to get segment stat: err=%d", in nilfs_segments_dirty_segments_show()
414 struct the_nilfs *nilfs, in nilfs_segments_README_show() argument
446 struct the_nilfs *nilfs, in nilfs_segctor_last_pseg_block_show() argument
451 spin_lock(&nilfs->ns_last_segment_lock); in nilfs_segctor_last_pseg_block_show()
452 last_pseg = nilfs->ns_last_pseg; in nilfs_segctor_last_pseg_block_show()
453 spin_unlock(&nilfs->ns_last_segment_lock); in nilfs_segctor_last_pseg_block_show()
461 struct the_nilfs *nilfs, in nilfs_segctor_last_seg_sequence_show() argument
466 spin_lock(&nilfs->ns_last_segment_lock); in nilfs_segctor_last_seg_sequence_show()
467 last_seq = nilfs->ns_last_seq; in nilfs_segctor_last_seg_sequence_show()
468 spin_unlock(&nilfs->ns_last_segment_lock); in nilfs_segctor_last_seg_sequence_show()
475 struct the_nilfs *nilfs, in nilfs_segctor_last_seg_checkpoint_show() argument
480 spin_lock(&nilfs->ns_last_segment_lock); in nilfs_segctor_last_seg_checkpoint_show()
481 last_cno = nilfs->ns_last_cno; in nilfs_segctor_last_seg_checkpoint_show()
482 spin_unlock(&nilfs->ns_last_segment_lock); in nilfs_segctor_last_seg_checkpoint_show()
489 struct the_nilfs *nilfs, in nilfs_segctor_current_seg_sequence_show() argument
494 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_current_seg_sequence_show()
495 seg_seq = nilfs->ns_seg_seq; in nilfs_segctor_current_seg_sequence_show()
496 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_current_seg_sequence_show()
503 struct the_nilfs *nilfs, in nilfs_segctor_current_last_full_seg_show() argument
508 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_current_last_full_seg_show()
509 segnum = nilfs->ns_segnum; in nilfs_segctor_current_last_full_seg_show()
510 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_current_last_full_seg_show()
517 struct the_nilfs *nilfs, in nilfs_segctor_next_full_seg_show() argument
522 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_next_full_seg_show()
523 nextnum = nilfs->ns_nextnum; in nilfs_segctor_next_full_seg_show()
524 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_next_full_seg_show()
531 struct the_nilfs *nilfs, in nilfs_segctor_next_pseg_offset_show() argument
536 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_next_pseg_offset_show()
537 pseg_offset = nilfs->ns_pseg_offset; in nilfs_segctor_next_pseg_offset_show()
538 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_next_pseg_offset_show()
545 struct the_nilfs *nilfs, in nilfs_segctor_next_checkpoint_show() argument
550 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_next_checkpoint_show()
551 cno = nilfs->ns_cno; in nilfs_segctor_next_checkpoint_show()
552 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_next_checkpoint_show()
559 struct the_nilfs *nilfs, in nilfs_segctor_last_seg_write_time_show() argument
564 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_last_seg_write_time_show()
565 ctime = nilfs->ns_ctime; in nilfs_segctor_last_seg_write_time_show()
566 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_last_seg_write_time_show()
573 struct the_nilfs *nilfs, in nilfs_segctor_last_seg_write_time_secs_show() argument
578 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_last_seg_write_time_secs_show()
579 ctime = nilfs->ns_ctime; in nilfs_segctor_last_seg_write_time_secs_show()
580 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_last_seg_write_time_secs_show()
587 struct the_nilfs *nilfs, in nilfs_segctor_last_nongc_write_time_show() argument
592 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_last_nongc_write_time_show()
593 nongc_ctime = nilfs->ns_nongc_ctime; in nilfs_segctor_last_nongc_write_time_show()
594 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_last_nongc_write_time_show()
601 struct the_nilfs *nilfs, in nilfs_segctor_last_nongc_write_time_secs_show() argument
606 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_last_nongc_write_time_secs_show()
607 nongc_ctime = nilfs->ns_nongc_ctime; in nilfs_segctor_last_nongc_write_time_secs_show()
608 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_last_nongc_write_time_secs_show()
615 struct the_nilfs *nilfs, in nilfs_segctor_dirty_data_blocks_count_show() argument
620 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_dirty_data_blocks_count_show()
621 ndirtyblks = atomic_read(&nilfs->ns_ndirtyblks); in nilfs_segctor_dirty_data_blocks_count_show()
622 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_dirty_data_blocks_count_show()
659 struct the_nilfs *nilfs, char *buf) in nilfs_segctor_README_show() argument
708 struct the_nilfs *nilfs, in nilfs_superblock_sb_write_time_show() argument
713 down_read(&nilfs->ns_sem); in nilfs_superblock_sb_write_time_show()
714 sbwtime = nilfs->ns_sbwtime; in nilfs_superblock_sb_write_time_show()
715 up_read(&nilfs->ns_sem); in nilfs_superblock_sb_write_time_show()
722 struct the_nilfs *nilfs, in nilfs_superblock_sb_write_time_secs_show() argument
727 down_read(&nilfs->ns_sem); in nilfs_superblock_sb_write_time_secs_show()
728 sbwtime = nilfs->ns_sbwtime; in nilfs_superblock_sb_write_time_secs_show()
729 up_read(&nilfs->ns_sem); in nilfs_superblock_sb_write_time_secs_show()
736 struct the_nilfs *nilfs, in nilfs_superblock_sb_write_count_show() argument
741 down_read(&nilfs->ns_sem); in nilfs_superblock_sb_write_count_show()
742 sbwcount = nilfs->ns_sbwcount; in nilfs_superblock_sb_write_count_show()
743 up_read(&nilfs->ns_sem); in nilfs_superblock_sb_write_count_show()
750 struct the_nilfs *nilfs, in nilfs_superblock_sb_update_frequency_show() argument
755 down_read(&nilfs->ns_sem); in nilfs_superblock_sb_update_frequency_show()
756 sb_update_freq = nilfs->ns_sb_update_freq; in nilfs_superblock_sb_update_frequency_show()
757 up_read(&nilfs->ns_sem); in nilfs_superblock_sb_update_frequency_show()
764 struct the_nilfs *nilfs, in nilfs_superblock_sb_update_frequency_store() argument
772 nilfs_err(nilfs->ns_sb, "unable to convert string: err=%d", in nilfs_superblock_sb_update_frequency_store()
779 nilfs_warn(nilfs->ns_sb, in nilfs_superblock_sb_update_frequency_store()
783 down_write(&nilfs->ns_sem); in nilfs_superblock_sb_update_frequency_store()
784 nilfs->ns_sb_update_freq = val; in nilfs_superblock_sb_update_frequency_store()
785 up_write(&nilfs->ns_sem); in nilfs_superblock_sb_update_frequency_store()
805 struct the_nilfs *nilfs, char *buf) in nilfs_superblock_README_show() argument
836 struct the_nilfs *nilfs, in nilfs_dev_revision_show() argument
839 struct nilfs_super_block **sbp = nilfs->ns_sbp; in nilfs_dev_revision_show()
848 struct the_nilfs *nilfs, in nilfs_dev_blocksize_show() argument
851 return sysfs_emit(buf, "%u\n", nilfs->ns_blocksize); in nilfs_dev_blocksize_show()
856 struct the_nilfs *nilfs, in nilfs_dev_device_size_show() argument
859 struct nilfs_super_block **sbp = nilfs->ns_sbp; in nilfs_dev_device_size_show()
867 struct the_nilfs *nilfs, in nilfs_dev_free_blocks_show() argument
872 nilfs_count_free_blocks(nilfs, &free_blocks); in nilfs_dev_free_blocks_show()
879 struct the_nilfs *nilfs, in nilfs_dev_uuid_show() argument
882 struct nilfs_super_block **sbp = nilfs->ns_sbp; in nilfs_dev_uuid_show()
889 struct the_nilfs *nilfs, in nilfs_dev_volume_name_show() argument
892 struct nilfs_super_block **sbp = nilfs->ns_sbp; in nilfs_dev_volume_name_show()
909 struct the_nilfs *nilfs, in nilfs_dev_README_show() argument
938 struct the_nilfs *nilfs = container_of(kobj, struct the_nilfs, in nilfs_dev_attr_show() local
943 return a->show ? a->show(a, nilfs, buf) : 0; in nilfs_dev_attr_show()
950 struct the_nilfs *nilfs = container_of(kobj, struct the_nilfs, in nilfs_dev_attr_store() local
955 return a->store ? a->store(a, nilfs, buf, len) : 0; in nilfs_dev_attr_store()
960 struct the_nilfs *nilfs = container_of(kobj, struct the_nilfs, in nilfs_dev_attr_release() local
962 complete(&nilfs->ns_dev_kobj_unregister); in nilfs_dev_attr_release()
978 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_sysfs_create_device_group() local
982 nilfs->ns_dev_subgroups = kzalloc(devgrp_size, GFP_KERNEL); in nilfs_sysfs_create_device_group()
983 if (unlikely(!nilfs->ns_dev_subgroups)) { in nilfs_sysfs_create_device_group()
989 nilfs->ns_dev_kobj.kset = nilfs_kset; in nilfs_sysfs_create_device_group()
990 init_completion(&nilfs->ns_dev_kobj_unregister); in nilfs_sysfs_create_device_group()
991 err = kobject_init_and_add(&nilfs->ns_dev_kobj, &nilfs_dev_ktype, NULL, in nilfs_sysfs_create_device_group()
996 err = nilfs_sysfs_create_mounted_snapshots_group(nilfs); in nilfs_sysfs_create_device_group()
1000 err = nilfs_sysfs_create_checkpoints_group(nilfs); in nilfs_sysfs_create_device_group()
1004 err = nilfs_sysfs_create_segments_group(nilfs); in nilfs_sysfs_create_device_group()
1008 err = nilfs_sysfs_create_superblock_group(nilfs); in nilfs_sysfs_create_device_group()
1012 err = nilfs_sysfs_create_segctor_group(nilfs); in nilfs_sysfs_create_device_group()
1019 nilfs_sysfs_delete_superblock_group(nilfs); in nilfs_sysfs_create_device_group()
1022 nilfs_sysfs_delete_segments_group(nilfs); in nilfs_sysfs_create_device_group()
1025 nilfs_sysfs_delete_checkpoints_group(nilfs); in nilfs_sysfs_create_device_group()
1028 nilfs_sysfs_delete_mounted_snapshots_group(nilfs); in nilfs_sysfs_create_device_group()
1031 kobject_put(&nilfs->ns_dev_kobj); in nilfs_sysfs_create_device_group()
1032 kfree(nilfs->ns_dev_subgroups); in nilfs_sysfs_create_device_group()
1038 void nilfs_sysfs_delete_device_group(struct the_nilfs *nilfs) in nilfs_sysfs_delete_device_group() argument
1040 nilfs_sysfs_delete_mounted_snapshots_group(nilfs); in nilfs_sysfs_delete_device_group()
1041 nilfs_sysfs_delete_checkpoints_group(nilfs); in nilfs_sysfs_delete_device_group()
1042 nilfs_sysfs_delete_segments_group(nilfs); in nilfs_sysfs_delete_device_group()
1043 nilfs_sysfs_delete_superblock_group(nilfs); in nilfs_sysfs_delete_device_group()
1044 nilfs_sysfs_delete_segctor_group(nilfs); in nilfs_sysfs_delete_device_group()
1045 kobject_del(&nilfs->ns_dev_kobj); in nilfs_sysfs_delete_device_group()
1046 kobject_put(&nilfs->ns_dev_kobj); in nilfs_sysfs_delete_device_group()
1047 kfree(nilfs->ns_dev_subgroups); in nilfs_sysfs_delete_device_group()