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); \
176 struct the_nilfs *nilfs; in nilfs_sysfs_create_snapshot_group() local
180 nilfs = root->nilfs; in nilfs_sysfs_create_snapshot_group()
181 parent = &nilfs->ns_dev_subgroups->sg_mounted_snapshots_kobj; in nilfs_sysfs_create_snapshot_group()
188 &nilfs->ns_dev_kobj, in nilfs_sysfs_create_snapshot_group()
218 struct the_nilfs *nilfs, char *buf) in nilfs_mounted_snapshots_README_show() argument
240 struct the_nilfs *nilfs, in nilfs_checkpoints_checkpoints_number_show() argument
247 down_read(&nilfs->ns_segctor_sem); in nilfs_checkpoints_checkpoints_number_show()
248 err = nilfs_cpfile_get_stat(nilfs->ns_cpfile, &cpstat); in nilfs_checkpoints_checkpoints_number_show()
249 up_read(&nilfs->ns_segctor_sem); in nilfs_checkpoints_checkpoints_number_show()
251 nilfs_err(nilfs->ns_sb, "unable to get checkpoint stat: err=%d", in nilfs_checkpoints_checkpoints_number_show()
263 struct the_nilfs *nilfs, in nilfs_checkpoints_snapshots_number_show() argument
270 down_read(&nilfs->ns_segctor_sem); in nilfs_checkpoints_snapshots_number_show()
271 err = nilfs_cpfile_get_stat(nilfs->ns_cpfile, &cpstat); in nilfs_checkpoints_snapshots_number_show()
272 up_read(&nilfs->ns_segctor_sem); in nilfs_checkpoints_snapshots_number_show()
274 nilfs_err(nilfs->ns_sb, "unable to get checkpoint stat: err=%d", in nilfs_checkpoints_snapshots_number_show()
286 struct the_nilfs *nilfs, in nilfs_checkpoints_last_seg_checkpoint_show() argument
291 spin_lock(&nilfs->ns_last_segment_lock); in nilfs_checkpoints_last_seg_checkpoint_show()
292 last_cno = nilfs->ns_last_cno; in nilfs_checkpoints_last_seg_checkpoint_show()
293 spin_unlock(&nilfs->ns_last_segment_lock); in nilfs_checkpoints_last_seg_checkpoint_show()
300 struct the_nilfs *nilfs, in nilfs_checkpoints_next_checkpoint_show() argument
305 down_read(&nilfs->ns_segctor_sem); in nilfs_checkpoints_next_checkpoint_show()
306 cno = nilfs->ns_cno; in nilfs_checkpoints_next_checkpoint_show()
307 up_read(&nilfs->ns_segctor_sem); in nilfs_checkpoints_next_checkpoint_show()
323 struct the_nilfs *nilfs, char *buf) in nilfs_checkpoints_README_show() argument
353 struct the_nilfs *nilfs, in nilfs_segments_segments_number_show() argument
356 return sysfs_emit(buf, "%lu\n", nilfs->ns_nsegments); in nilfs_segments_segments_number_show()
361 struct the_nilfs *nilfs, in nilfs_segments_blocks_per_segment_show() argument
364 return sysfs_emit(buf, "%lu\n", nilfs->ns_blocks_per_segment); in nilfs_segments_blocks_per_segment_show()
369 struct the_nilfs *nilfs, in nilfs_segments_clean_segments_show() argument
374 down_read(&NILFS_MDT(nilfs->ns_dat)->mi_sem); in nilfs_segments_clean_segments_show()
375 ncleansegs = nilfs_sufile_get_ncleansegs(nilfs->ns_sufile); in nilfs_segments_clean_segments_show()
376 up_read(&NILFS_MDT(nilfs->ns_dat)->mi_sem); in nilfs_segments_clean_segments_show()
383 struct the_nilfs *nilfs, in nilfs_segments_dirty_segments_show() argument
389 down_read(&nilfs->ns_segctor_sem); in nilfs_segments_dirty_segments_show()
390 err = nilfs_sufile_get_stat(nilfs->ns_sufile, &sustat); in nilfs_segments_dirty_segments_show()
391 up_read(&nilfs->ns_segctor_sem); in nilfs_segments_dirty_segments_show()
393 nilfs_err(nilfs->ns_sb, "unable to get segment stat: err=%d", in nilfs_segments_dirty_segments_show()
411 struct the_nilfs *nilfs, in nilfs_segments_README_show() argument
442 struct the_nilfs *nilfs, in nilfs_segctor_last_pseg_block_show() argument
447 spin_lock(&nilfs->ns_last_segment_lock); in nilfs_segctor_last_pseg_block_show()
448 last_pseg = nilfs->ns_last_pseg; in nilfs_segctor_last_pseg_block_show()
449 spin_unlock(&nilfs->ns_last_segment_lock); in nilfs_segctor_last_pseg_block_show()
457 struct the_nilfs *nilfs, in nilfs_segctor_last_seg_sequence_show() argument
462 spin_lock(&nilfs->ns_last_segment_lock); in nilfs_segctor_last_seg_sequence_show()
463 last_seq = nilfs->ns_last_seq; in nilfs_segctor_last_seg_sequence_show()
464 spin_unlock(&nilfs->ns_last_segment_lock); in nilfs_segctor_last_seg_sequence_show()
471 struct the_nilfs *nilfs, in nilfs_segctor_last_seg_checkpoint_show() argument
476 spin_lock(&nilfs->ns_last_segment_lock); in nilfs_segctor_last_seg_checkpoint_show()
477 last_cno = nilfs->ns_last_cno; in nilfs_segctor_last_seg_checkpoint_show()
478 spin_unlock(&nilfs->ns_last_segment_lock); in nilfs_segctor_last_seg_checkpoint_show()
485 struct the_nilfs *nilfs, in nilfs_segctor_current_seg_sequence_show() argument
490 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_current_seg_sequence_show()
491 seg_seq = nilfs->ns_seg_seq; in nilfs_segctor_current_seg_sequence_show()
492 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_current_seg_sequence_show()
499 struct the_nilfs *nilfs, in nilfs_segctor_current_last_full_seg_show() argument
504 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_current_last_full_seg_show()
505 segnum = nilfs->ns_segnum; in nilfs_segctor_current_last_full_seg_show()
506 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_current_last_full_seg_show()
513 struct the_nilfs *nilfs, in nilfs_segctor_next_full_seg_show() argument
518 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_next_full_seg_show()
519 nextnum = nilfs->ns_nextnum; in nilfs_segctor_next_full_seg_show()
520 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_next_full_seg_show()
527 struct the_nilfs *nilfs, in nilfs_segctor_next_pseg_offset_show() argument
532 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_next_pseg_offset_show()
533 pseg_offset = nilfs->ns_pseg_offset; in nilfs_segctor_next_pseg_offset_show()
534 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_next_pseg_offset_show()
541 struct the_nilfs *nilfs, in nilfs_segctor_next_checkpoint_show() argument
546 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_next_checkpoint_show()
547 cno = nilfs->ns_cno; in nilfs_segctor_next_checkpoint_show()
548 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_next_checkpoint_show()
555 struct the_nilfs *nilfs, in nilfs_segctor_last_seg_write_time_show() argument
560 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_last_seg_write_time_show()
561 ctime = nilfs->ns_ctime; in nilfs_segctor_last_seg_write_time_show()
562 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_last_seg_write_time_show()
569 struct the_nilfs *nilfs, in nilfs_segctor_last_seg_write_time_secs_show() argument
574 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_last_seg_write_time_secs_show()
575 ctime = nilfs->ns_ctime; in nilfs_segctor_last_seg_write_time_secs_show()
576 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_last_seg_write_time_secs_show()
583 struct the_nilfs *nilfs, in nilfs_segctor_last_nongc_write_time_show() argument
588 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_last_nongc_write_time_show()
589 nongc_ctime = nilfs->ns_nongc_ctime; in nilfs_segctor_last_nongc_write_time_show()
590 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_last_nongc_write_time_show()
597 struct the_nilfs *nilfs, in nilfs_segctor_last_nongc_write_time_secs_show() argument
602 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_last_nongc_write_time_secs_show()
603 nongc_ctime = nilfs->ns_nongc_ctime; in nilfs_segctor_last_nongc_write_time_secs_show()
604 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_last_nongc_write_time_secs_show()
611 struct the_nilfs *nilfs, in nilfs_segctor_dirty_data_blocks_count_show() argument
616 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_dirty_data_blocks_count_show()
617 ndirtyblks = atomic_read(&nilfs->ns_ndirtyblks); in nilfs_segctor_dirty_data_blocks_count_show()
618 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_dirty_data_blocks_count_show()
655 struct the_nilfs *nilfs, char *buf) in nilfs_segctor_README_show() argument
703 struct the_nilfs *nilfs, in nilfs_superblock_sb_write_time_show() argument
708 down_read(&nilfs->ns_sem); in nilfs_superblock_sb_write_time_show()
709 sbwtime = nilfs->ns_sbwtime; in nilfs_superblock_sb_write_time_show()
710 up_read(&nilfs->ns_sem); in nilfs_superblock_sb_write_time_show()
717 struct the_nilfs *nilfs, in nilfs_superblock_sb_write_time_secs_show() argument
722 down_read(&nilfs->ns_sem); in nilfs_superblock_sb_write_time_secs_show()
723 sbwtime = nilfs->ns_sbwtime; in nilfs_superblock_sb_write_time_secs_show()
724 up_read(&nilfs->ns_sem); in nilfs_superblock_sb_write_time_secs_show()
731 struct the_nilfs *nilfs, in nilfs_superblock_sb_write_count_show() argument
736 down_read(&nilfs->ns_sem); in nilfs_superblock_sb_write_count_show()
737 sbwcount = nilfs->ns_sbwcount; in nilfs_superblock_sb_write_count_show()
738 up_read(&nilfs->ns_sem); in nilfs_superblock_sb_write_count_show()
745 struct the_nilfs *nilfs, in nilfs_superblock_sb_update_frequency_show() argument
750 down_read(&nilfs->ns_sem); in nilfs_superblock_sb_update_frequency_show()
751 sb_update_freq = nilfs->ns_sb_update_freq; in nilfs_superblock_sb_update_frequency_show()
752 up_read(&nilfs->ns_sem); in nilfs_superblock_sb_update_frequency_show()
759 struct the_nilfs *nilfs, in nilfs_superblock_sb_update_frequency_store() argument
767 nilfs_err(nilfs->ns_sb, "unable to convert string: err=%d", in nilfs_superblock_sb_update_frequency_store()
774 nilfs_warn(nilfs->ns_sb, in nilfs_superblock_sb_update_frequency_store()
778 down_write(&nilfs->ns_sem); in nilfs_superblock_sb_update_frequency_store()
779 nilfs->ns_sb_update_freq = val; in nilfs_superblock_sb_update_frequency_store()
780 up_write(&nilfs->ns_sem); in nilfs_superblock_sb_update_frequency_store()
800 struct the_nilfs *nilfs, char *buf) in nilfs_superblock_README_show() argument
830 struct the_nilfs *nilfs, in nilfs_dev_revision_show() argument
833 struct nilfs_super_block **sbp = nilfs->ns_sbp; in nilfs_dev_revision_show()
842 struct the_nilfs *nilfs, in nilfs_dev_blocksize_show() argument
845 return sysfs_emit(buf, "%u\n", nilfs->ns_blocksize); in nilfs_dev_blocksize_show()
850 struct the_nilfs *nilfs, in nilfs_dev_device_size_show() argument
853 struct nilfs_super_block **sbp = nilfs->ns_sbp; in nilfs_dev_device_size_show()
861 struct the_nilfs *nilfs, in nilfs_dev_free_blocks_show() argument
866 nilfs_count_free_blocks(nilfs, &free_blocks); in nilfs_dev_free_blocks_show()
873 struct the_nilfs *nilfs, in nilfs_dev_uuid_show() argument
876 struct nilfs_super_block **sbp = nilfs->ns_sbp; in nilfs_dev_uuid_show()
883 struct the_nilfs *nilfs, in nilfs_dev_volume_name_show() argument
886 struct nilfs_super_block **sbp = nilfs->ns_sbp; in nilfs_dev_volume_name_show()
903 struct the_nilfs *nilfs, in nilfs_dev_README_show() argument
931 struct the_nilfs *nilfs = container_of(kobj, struct the_nilfs, in nilfs_dev_attr_show() local
936 return a->show ? a->show(a, nilfs, buf) : 0; in nilfs_dev_attr_show()
943 struct the_nilfs *nilfs = container_of(kobj, struct the_nilfs, in nilfs_dev_attr_store() local
948 return a->store ? a->store(a, nilfs, buf, len) : 0; in nilfs_dev_attr_store()
953 struct the_nilfs *nilfs = container_of(kobj, struct the_nilfs, in nilfs_dev_attr_release() local
955 complete(&nilfs->ns_dev_kobj_unregister); in nilfs_dev_attr_release()
971 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_sysfs_create_device_group() local
975 nilfs->ns_dev_subgroups = kzalloc(devgrp_size, GFP_KERNEL); in nilfs_sysfs_create_device_group()
976 if (unlikely(!nilfs->ns_dev_subgroups)) { in nilfs_sysfs_create_device_group()
982 nilfs->ns_dev_kobj.kset = nilfs_kset; in nilfs_sysfs_create_device_group()
983 init_completion(&nilfs->ns_dev_kobj_unregister); in nilfs_sysfs_create_device_group()
984 err = kobject_init_and_add(&nilfs->ns_dev_kobj, &nilfs_dev_ktype, NULL, in nilfs_sysfs_create_device_group()
989 err = nilfs_sysfs_create_mounted_snapshots_group(nilfs); in nilfs_sysfs_create_device_group()
993 err = nilfs_sysfs_create_checkpoints_group(nilfs); in nilfs_sysfs_create_device_group()
997 err = nilfs_sysfs_create_segments_group(nilfs); in nilfs_sysfs_create_device_group()
1001 err = nilfs_sysfs_create_superblock_group(nilfs); in nilfs_sysfs_create_device_group()
1005 err = nilfs_sysfs_create_segctor_group(nilfs); in nilfs_sysfs_create_device_group()
1012 nilfs_sysfs_delete_superblock_group(nilfs); in nilfs_sysfs_create_device_group()
1015 nilfs_sysfs_delete_segments_group(nilfs); in nilfs_sysfs_create_device_group()
1018 nilfs_sysfs_delete_checkpoints_group(nilfs); in nilfs_sysfs_create_device_group()
1021 nilfs_sysfs_delete_mounted_snapshots_group(nilfs); in nilfs_sysfs_create_device_group()
1024 kobject_put(&nilfs->ns_dev_kobj); in nilfs_sysfs_create_device_group()
1025 kfree(nilfs->ns_dev_subgroups); in nilfs_sysfs_create_device_group()
1031 void nilfs_sysfs_delete_device_group(struct the_nilfs *nilfs) in nilfs_sysfs_delete_device_group() argument
1033 nilfs_sysfs_delete_mounted_snapshots_group(nilfs); in nilfs_sysfs_delete_device_group()
1034 nilfs_sysfs_delete_checkpoints_group(nilfs); in nilfs_sysfs_delete_device_group()
1035 nilfs_sysfs_delete_segments_group(nilfs); in nilfs_sysfs_delete_device_group()
1036 nilfs_sysfs_delete_superblock_group(nilfs); in nilfs_sysfs_delete_device_group()
1037 nilfs_sysfs_delete_segctor_group(nilfs); in nilfs_sysfs_delete_device_group()
1038 kobject_del(&nilfs->ns_dev_kobj); in nilfs_sysfs_delete_device_group()
1039 kobject_put(&nilfs->ns_dev_kobj); in nilfs_sysfs_delete_device_group()
1040 kfree(nilfs->ns_dev_subgroups); in nilfs_sysfs_delete_device_group()