Lines Matching refs:nilfs
48 struct the_nilfs *nilfs = container_of(kobj->parent, \
54 return a->show ? a->show(a, nilfs, buf) : 0; \
60 struct the_nilfs *nilfs = container_of(kobj->parent, \
66 return a->store ? a->store(a, nilfs, buf, len) : 0; \
77 struct the_nilfs *nilfs = container_of(kobj->parent, \
80 subgroups = nilfs->ns_##parent_name##_subgroups; \
90 static int nilfs_sysfs_create_##name##_group(struct the_nilfs *nilfs) \
97 subgroups = nilfs->ns_##parent_name##_subgroups; \
100 parent = &nilfs->ns_##parent_name##_kobj; \
109 static void nilfs_sysfs_delete_##name##_group(struct the_nilfs *nilfs) \
111 kobject_del(&nilfs->ns_##parent_name##_subgroups->sg_##name##_kobj); \
200 struct the_nilfs *nilfs; in nilfs_sysfs_create_snapshot_group() local
204 nilfs = root->nilfs; in nilfs_sysfs_create_snapshot_group()
205 parent = &nilfs->ns_dev_subgroups->sg_mounted_snapshots_kobj; in nilfs_sysfs_create_snapshot_group()
212 &nilfs->ns_dev_kobj, in nilfs_sysfs_create_snapshot_group()
242 struct the_nilfs *nilfs, char *buf) in nilfs_mounted_snapshots_README_show() argument
264 struct the_nilfs *nilfs, in nilfs_checkpoints_checkpoints_number_show() argument
271 down_read(&nilfs->ns_segctor_sem); in nilfs_checkpoints_checkpoints_number_show()
272 err = nilfs_cpfile_get_stat(nilfs->ns_cpfile, &cpstat); in nilfs_checkpoints_checkpoints_number_show()
273 up_read(&nilfs->ns_segctor_sem); in nilfs_checkpoints_checkpoints_number_show()
275 nilfs_msg(nilfs->ns_sb, KERN_ERR, in nilfs_checkpoints_checkpoints_number_show()
287 struct the_nilfs *nilfs, in nilfs_checkpoints_snapshots_number_show() argument
294 down_read(&nilfs->ns_segctor_sem); in nilfs_checkpoints_snapshots_number_show()
295 err = nilfs_cpfile_get_stat(nilfs->ns_cpfile, &cpstat); in nilfs_checkpoints_snapshots_number_show()
296 up_read(&nilfs->ns_segctor_sem); in nilfs_checkpoints_snapshots_number_show()
298 nilfs_msg(nilfs->ns_sb, KERN_ERR, in nilfs_checkpoints_snapshots_number_show()
310 struct the_nilfs *nilfs, in nilfs_checkpoints_last_seg_checkpoint_show() argument
315 spin_lock(&nilfs->ns_last_segment_lock); in nilfs_checkpoints_last_seg_checkpoint_show()
316 last_cno = nilfs->ns_last_cno; in nilfs_checkpoints_last_seg_checkpoint_show()
317 spin_unlock(&nilfs->ns_last_segment_lock); in nilfs_checkpoints_last_seg_checkpoint_show()
324 struct the_nilfs *nilfs, in nilfs_checkpoints_next_checkpoint_show() argument
329 down_read(&nilfs->ns_segctor_sem); in nilfs_checkpoints_next_checkpoint_show()
330 cno = nilfs->ns_cno; in nilfs_checkpoints_next_checkpoint_show()
331 up_read(&nilfs->ns_segctor_sem); in nilfs_checkpoints_next_checkpoint_show()
347 struct the_nilfs *nilfs, char *buf) in nilfs_checkpoints_README_show() argument
377 struct the_nilfs *nilfs, in nilfs_segments_segments_number_show() argument
380 return snprintf(buf, PAGE_SIZE, "%lu\n", nilfs->ns_nsegments); in nilfs_segments_segments_number_show()
385 struct the_nilfs *nilfs, in nilfs_segments_blocks_per_segment_show() argument
388 return snprintf(buf, PAGE_SIZE, "%lu\n", nilfs->ns_blocks_per_segment); in nilfs_segments_blocks_per_segment_show()
393 struct the_nilfs *nilfs, in nilfs_segments_clean_segments_show() argument
398 down_read(&NILFS_MDT(nilfs->ns_dat)->mi_sem); in nilfs_segments_clean_segments_show()
399 ncleansegs = nilfs_sufile_get_ncleansegs(nilfs->ns_sufile); in nilfs_segments_clean_segments_show()
400 up_read(&NILFS_MDT(nilfs->ns_dat)->mi_sem); in nilfs_segments_clean_segments_show()
407 struct the_nilfs *nilfs, in nilfs_segments_dirty_segments_show() argument
413 down_read(&nilfs->ns_segctor_sem); in nilfs_segments_dirty_segments_show()
414 err = nilfs_sufile_get_stat(nilfs->ns_sufile, &sustat); in nilfs_segments_dirty_segments_show()
415 up_read(&nilfs->ns_segctor_sem); in nilfs_segments_dirty_segments_show()
417 nilfs_msg(nilfs->ns_sb, KERN_ERR, in nilfs_segments_dirty_segments_show()
435 struct the_nilfs *nilfs, in nilfs_segments_README_show() argument
466 struct the_nilfs *nilfs, in nilfs_segctor_last_pseg_block_show() argument
471 spin_lock(&nilfs->ns_last_segment_lock); in nilfs_segctor_last_pseg_block_show()
472 last_pseg = nilfs->ns_last_pseg; in nilfs_segctor_last_pseg_block_show()
473 spin_unlock(&nilfs->ns_last_segment_lock); in nilfs_segctor_last_pseg_block_show()
481 struct the_nilfs *nilfs, in nilfs_segctor_last_seg_sequence_show() argument
486 spin_lock(&nilfs->ns_last_segment_lock); in nilfs_segctor_last_seg_sequence_show()
487 last_seq = nilfs->ns_last_seq; in nilfs_segctor_last_seg_sequence_show()
488 spin_unlock(&nilfs->ns_last_segment_lock); in nilfs_segctor_last_seg_sequence_show()
495 struct the_nilfs *nilfs, in nilfs_segctor_last_seg_checkpoint_show() argument
500 spin_lock(&nilfs->ns_last_segment_lock); in nilfs_segctor_last_seg_checkpoint_show()
501 last_cno = nilfs->ns_last_cno; in nilfs_segctor_last_seg_checkpoint_show()
502 spin_unlock(&nilfs->ns_last_segment_lock); in nilfs_segctor_last_seg_checkpoint_show()
509 struct the_nilfs *nilfs, in nilfs_segctor_current_seg_sequence_show() argument
514 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_current_seg_sequence_show()
515 seg_seq = nilfs->ns_seg_seq; in nilfs_segctor_current_seg_sequence_show()
516 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_current_seg_sequence_show()
523 struct the_nilfs *nilfs, in nilfs_segctor_current_last_full_seg_show() argument
528 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_current_last_full_seg_show()
529 segnum = nilfs->ns_segnum; in nilfs_segctor_current_last_full_seg_show()
530 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_current_last_full_seg_show()
537 struct the_nilfs *nilfs, in nilfs_segctor_next_full_seg_show() argument
542 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_next_full_seg_show()
543 nextnum = nilfs->ns_nextnum; in nilfs_segctor_next_full_seg_show()
544 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_next_full_seg_show()
551 struct the_nilfs *nilfs, in nilfs_segctor_next_pseg_offset_show() argument
556 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_next_pseg_offset_show()
557 pseg_offset = nilfs->ns_pseg_offset; in nilfs_segctor_next_pseg_offset_show()
558 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_next_pseg_offset_show()
565 struct the_nilfs *nilfs, in nilfs_segctor_next_checkpoint_show() argument
570 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_next_checkpoint_show()
571 cno = nilfs->ns_cno; in nilfs_segctor_next_checkpoint_show()
572 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_next_checkpoint_show()
579 struct the_nilfs *nilfs, in nilfs_segctor_last_seg_write_time_show() argument
584 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_last_seg_write_time_show()
585 ctime = nilfs->ns_ctime; in nilfs_segctor_last_seg_write_time_show()
586 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_last_seg_write_time_show()
593 struct the_nilfs *nilfs, in nilfs_segctor_last_seg_write_time_secs_show() argument
598 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_last_seg_write_time_secs_show()
599 ctime = nilfs->ns_ctime; in nilfs_segctor_last_seg_write_time_secs_show()
600 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_last_seg_write_time_secs_show()
607 struct the_nilfs *nilfs, in nilfs_segctor_last_nongc_write_time_show() argument
612 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_last_nongc_write_time_show()
613 nongc_ctime = nilfs->ns_nongc_ctime; in nilfs_segctor_last_nongc_write_time_show()
614 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_last_nongc_write_time_show()
621 struct the_nilfs *nilfs, in nilfs_segctor_last_nongc_write_time_secs_show() argument
626 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_last_nongc_write_time_secs_show()
627 nongc_ctime = nilfs->ns_nongc_ctime; in nilfs_segctor_last_nongc_write_time_secs_show()
628 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_last_nongc_write_time_secs_show()
636 struct the_nilfs *nilfs, in nilfs_segctor_dirty_data_blocks_count_show() argument
641 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_dirty_data_blocks_count_show()
642 ndirtyblks = atomic_read(&nilfs->ns_ndirtyblks); in nilfs_segctor_dirty_data_blocks_count_show()
643 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_dirty_data_blocks_count_show()
680 struct the_nilfs *nilfs, char *buf) in nilfs_segctor_README_show() argument
728 struct the_nilfs *nilfs, in nilfs_superblock_sb_write_time_show() argument
733 down_read(&nilfs->ns_sem); in nilfs_superblock_sb_write_time_show()
734 sbwtime = nilfs->ns_sbwtime; in nilfs_superblock_sb_write_time_show()
735 up_read(&nilfs->ns_sem); in nilfs_superblock_sb_write_time_show()
742 struct the_nilfs *nilfs, in nilfs_superblock_sb_write_time_secs_show() argument
747 down_read(&nilfs->ns_sem); in nilfs_superblock_sb_write_time_secs_show()
748 sbwtime = nilfs->ns_sbwtime; in nilfs_superblock_sb_write_time_secs_show()
749 up_read(&nilfs->ns_sem); in nilfs_superblock_sb_write_time_secs_show()
756 struct the_nilfs *nilfs, in nilfs_superblock_sb_write_count_show() argument
761 down_read(&nilfs->ns_sem); in nilfs_superblock_sb_write_count_show()
762 sbwcount = nilfs->ns_sbwcount; in nilfs_superblock_sb_write_count_show()
763 up_read(&nilfs->ns_sem); in nilfs_superblock_sb_write_count_show()
770 struct the_nilfs *nilfs, in nilfs_superblock_sb_update_frequency_show() argument
775 down_read(&nilfs->ns_sem); in nilfs_superblock_sb_update_frequency_show()
776 sb_update_freq = nilfs->ns_sb_update_freq; in nilfs_superblock_sb_update_frequency_show()
777 up_read(&nilfs->ns_sem); in nilfs_superblock_sb_update_frequency_show()
784 struct the_nilfs *nilfs, in nilfs_superblock_sb_update_frequency_store() argument
792 nilfs_msg(nilfs->ns_sb, KERN_ERR, in nilfs_superblock_sb_update_frequency_store()
799 nilfs_msg(nilfs->ns_sb, KERN_WARNING, in nilfs_superblock_sb_update_frequency_store()
803 down_write(&nilfs->ns_sem); in nilfs_superblock_sb_update_frequency_store()
804 nilfs->ns_sb_update_freq = val; in nilfs_superblock_sb_update_frequency_store()
805 up_write(&nilfs->ns_sem); in nilfs_superblock_sb_update_frequency_store()
825 struct the_nilfs *nilfs, char *buf) in nilfs_superblock_README_show() argument
855 struct the_nilfs *nilfs, in nilfs_dev_revision_show() argument
858 struct nilfs_super_block **sbp = nilfs->ns_sbp; in nilfs_dev_revision_show()
867 struct the_nilfs *nilfs, in nilfs_dev_blocksize_show() argument
870 return snprintf(buf, PAGE_SIZE, "%u\n", nilfs->ns_blocksize); in nilfs_dev_blocksize_show()
875 struct the_nilfs *nilfs, in nilfs_dev_device_size_show() argument
878 struct nilfs_super_block **sbp = nilfs->ns_sbp; in nilfs_dev_device_size_show()
886 struct the_nilfs *nilfs, in nilfs_dev_free_blocks_show() argument
891 nilfs_count_free_blocks(nilfs, &free_blocks); in nilfs_dev_free_blocks_show()
898 struct the_nilfs *nilfs, in nilfs_dev_uuid_show() argument
901 struct nilfs_super_block **sbp = nilfs->ns_sbp; in nilfs_dev_uuid_show()
908 struct the_nilfs *nilfs, in nilfs_dev_volume_name_show() argument
911 struct nilfs_super_block **sbp = nilfs->ns_sbp; in nilfs_dev_volume_name_show()
928 struct the_nilfs *nilfs, in nilfs_dev_README_show() argument
956 struct the_nilfs *nilfs = container_of(kobj, struct the_nilfs, in nilfs_dev_attr_show() local
961 return a->show ? a->show(a, nilfs, buf) : 0; in nilfs_dev_attr_show()
968 struct the_nilfs *nilfs = container_of(kobj, struct the_nilfs, in nilfs_dev_attr_store() local
973 return a->store ? a->store(a, nilfs, buf, len) : 0; in nilfs_dev_attr_store()
978 struct the_nilfs *nilfs = container_of(kobj, struct the_nilfs, in nilfs_dev_attr_release() local
980 complete(&nilfs->ns_dev_kobj_unregister); in nilfs_dev_attr_release()
996 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_sysfs_create_device_group() local
1000 nilfs->ns_dev_subgroups = kzalloc(devgrp_size, GFP_KERNEL); in nilfs_sysfs_create_device_group()
1001 if (unlikely(!nilfs->ns_dev_subgroups)) { in nilfs_sysfs_create_device_group()
1008 nilfs->ns_dev_kobj.kset = nilfs_kset; in nilfs_sysfs_create_device_group()
1009 init_completion(&nilfs->ns_dev_kobj_unregister); in nilfs_sysfs_create_device_group()
1010 err = kobject_init_and_add(&nilfs->ns_dev_kobj, &nilfs_dev_ktype, NULL, in nilfs_sysfs_create_device_group()
1015 err = nilfs_sysfs_create_mounted_snapshots_group(nilfs); in nilfs_sysfs_create_device_group()
1019 err = nilfs_sysfs_create_checkpoints_group(nilfs); in nilfs_sysfs_create_device_group()
1023 err = nilfs_sysfs_create_segments_group(nilfs); in nilfs_sysfs_create_device_group()
1027 err = nilfs_sysfs_create_superblock_group(nilfs); in nilfs_sysfs_create_device_group()
1031 err = nilfs_sysfs_create_segctor_group(nilfs); in nilfs_sysfs_create_device_group()
1038 nilfs_sysfs_delete_superblock_group(nilfs); in nilfs_sysfs_create_device_group()
1041 nilfs_sysfs_delete_segments_group(nilfs); in nilfs_sysfs_create_device_group()
1044 nilfs_sysfs_delete_checkpoints_group(nilfs); in nilfs_sysfs_create_device_group()
1047 nilfs_sysfs_delete_mounted_snapshots_group(nilfs); in nilfs_sysfs_create_device_group()
1050 kobject_del(&nilfs->ns_dev_kobj); in nilfs_sysfs_create_device_group()
1053 kfree(nilfs->ns_dev_subgroups); in nilfs_sysfs_create_device_group()
1059 void nilfs_sysfs_delete_device_group(struct the_nilfs *nilfs) in nilfs_sysfs_delete_device_group() argument
1061 nilfs_sysfs_delete_mounted_snapshots_group(nilfs); in nilfs_sysfs_delete_device_group()
1062 nilfs_sysfs_delete_checkpoints_group(nilfs); in nilfs_sysfs_delete_device_group()
1063 nilfs_sysfs_delete_segments_group(nilfs); in nilfs_sysfs_delete_device_group()
1064 nilfs_sysfs_delete_superblock_group(nilfs); in nilfs_sysfs_delete_device_group()
1065 nilfs_sysfs_delete_segctor_group(nilfs); in nilfs_sysfs_delete_device_group()
1066 kobject_del(&nilfs->ns_dev_kobj); in nilfs_sysfs_delete_device_group()
1067 kfree(nilfs->ns_dev_subgroups); in nilfs_sysfs_delete_device_group()