Lines Matching refs: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; in nilfs_sysfs_create_snapshot_group() local
193 nilfs = root->nilfs; in nilfs_sysfs_create_snapshot_group()
194 parent = &nilfs->ns_dev_subgroups->sg_mounted_snapshots_kobj; in nilfs_sysfs_create_snapshot_group()
201 &nilfs->ns_dev_kobj, in nilfs_sysfs_create_snapshot_group()
231 struct the_nilfs *nilfs, char *buf) in nilfs_mounted_snapshots_README_show() argument
253 struct the_nilfs *nilfs, in nilfs_checkpoints_checkpoints_number_show() argument
260 down_read(&nilfs->ns_segctor_sem); in nilfs_checkpoints_checkpoints_number_show()
261 err = nilfs_cpfile_get_stat(nilfs->ns_cpfile, &cpstat); in nilfs_checkpoints_checkpoints_number_show()
262 up_read(&nilfs->ns_segctor_sem); in nilfs_checkpoints_checkpoints_number_show()
264 nilfs_err(nilfs->ns_sb, "unable to get checkpoint stat: err=%d", in nilfs_checkpoints_checkpoints_number_show()
276 struct the_nilfs *nilfs, in nilfs_checkpoints_snapshots_number_show() argument
283 down_read(&nilfs->ns_segctor_sem); in nilfs_checkpoints_snapshots_number_show()
284 err = nilfs_cpfile_get_stat(nilfs->ns_cpfile, &cpstat); in nilfs_checkpoints_snapshots_number_show()
285 up_read(&nilfs->ns_segctor_sem); in nilfs_checkpoints_snapshots_number_show()
287 nilfs_err(nilfs->ns_sb, "unable to get checkpoint stat: err=%d", in nilfs_checkpoints_snapshots_number_show()
299 struct the_nilfs *nilfs, in nilfs_checkpoints_last_seg_checkpoint_show() argument
304 spin_lock(&nilfs->ns_last_segment_lock); in nilfs_checkpoints_last_seg_checkpoint_show()
305 last_cno = nilfs->ns_last_cno; in nilfs_checkpoints_last_seg_checkpoint_show()
306 spin_unlock(&nilfs->ns_last_segment_lock); in nilfs_checkpoints_last_seg_checkpoint_show()
313 struct the_nilfs *nilfs, in nilfs_checkpoints_next_checkpoint_show() argument
318 down_read(&nilfs->ns_segctor_sem); in nilfs_checkpoints_next_checkpoint_show()
319 cno = nilfs->ns_cno; in nilfs_checkpoints_next_checkpoint_show()
320 up_read(&nilfs->ns_segctor_sem); in nilfs_checkpoints_next_checkpoint_show()
336 struct the_nilfs *nilfs, char *buf) in nilfs_checkpoints_README_show() argument
366 struct the_nilfs *nilfs, in nilfs_segments_segments_number_show() argument
369 return snprintf(buf, PAGE_SIZE, "%lu\n", nilfs->ns_nsegments); in nilfs_segments_segments_number_show()
374 struct the_nilfs *nilfs, in nilfs_segments_blocks_per_segment_show() argument
377 return snprintf(buf, PAGE_SIZE, "%lu\n", nilfs->ns_blocks_per_segment); in nilfs_segments_blocks_per_segment_show()
382 struct the_nilfs *nilfs, in nilfs_segments_clean_segments_show() argument
387 down_read(&NILFS_MDT(nilfs->ns_dat)->mi_sem); in nilfs_segments_clean_segments_show()
388 ncleansegs = nilfs_sufile_get_ncleansegs(nilfs->ns_sufile); in nilfs_segments_clean_segments_show()
389 up_read(&NILFS_MDT(nilfs->ns_dat)->mi_sem); in nilfs_segments_clean_segments_show()
396 struct the_nilfs *nilfs, in nilfs_segments_dirty_segments_show() argument
402 down_read(&nilfs->ns_segctor_sem); in nilfs_segments_dirty_segments_show()
403 err = nilfs_sufile_get_stat(nilfs->ns_sufile, &sustat); in nilfs_segments_dirty_segments_show()
404 up_read(&nilfs->ns_segctor_sem); in nilfs_segments_dirty_segments_show()
406 nilfs_err(nilfs->ns_sb, "unable to get segment stat: err=%d", in nilfs_segments_dirty_segments_show()
424 struct the_nilfs *nilfs, in nilfs_segments_README_show() argument
455 struct the_nilfs *nilfs, in nilfs_segctor_last_pseg_block_show() argument
460 spin_lock(&nilfs->ns_last_segment_lock); in nilfs_segctor_last_pseg_block_show()
461 last_pseg = nilfs->ns_last_pseg; in nilfs_segctor_last_pseg_block_show()
462 spin_unlock(&nilfs->ns_last_segment_lock); in nilfs_segctor_last_pseg_block_show()
470 struct the_nilfs *nilfs, in nilfs_segctor_last_seg_sequence_show() argument
475 spin_lock(&nilfs->ns_last_segment_lock); in nilfs_segctor_last_seg_sequence_show()
476 last_seq = nilfs->ns_last_seq; in nilfs_segctor_last_seg_sequence_show()
477 spin_unlock(&nilfs->ns_last_segment_lock); in nilfs_segctor_last_seg_sequence_show()
484 struct the_nilfs *nilfs, in nilfs_segctor_last_seg_checkpoint_show() argument
489 spin_lock(&nilfs->ns_last_segment_lock); in nilfs_segctor_last_seg_checkpoint_show()
490 last_cno = nilfs->ns_last_cno; in nilfs_segctor_last_seg_checkpoint_show()
491 spin_unlock(&nilfs->ns_last_segment_lock); in nilfs_segctor_last_seg_checkpoint_show()
498 struct the_nilfs *nilfs, in nilfs_segctor_current_seg_sequence_show() argument
503 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_current_seg_sequence_show()
504 seg_seq = nilfs->ns_seg_seq; in nilfs_segctor_current_seg_sequence_show()
505 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_current_seg_sequence_show()
512 struct the_nilfs *nilfs, in nilfs_segctor_current_last_full_seg_show() argument
517 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_current_last_full_seg_show()
518 segnum = nilfs->ns_segnum; in nilfs_segctor_current_last_full_seg_show()
519 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_current_last_full_seg_show()
526 struct the_nilfs *nilfs, in nilfs_segctor_next_full_seg_show() argument
531 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_next_full_seg_show()
532 nextnum = nilfs->ns_nextnum; in nilfs_segctor_next_full_seg_show()
533 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_next_full_seg_show()
540 struct the_nilfs *nilfs, in nilfs_segctor_next_pseg_offset_show() argument
545 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_next_pseg_offset_show()
546 pseg_offset = nilfs->ns_pseg_offset; in nilfs_segctor_next_pseg_offset_show()
547 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_next_pseg_offset_show()
554 struct the_nilfs *nilfs, in nilfs_segctor_next_checkpoint_show() argument
559 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_next_checkpoint_show()
560 cno = nilfs->ns_cno; in nilfs_segctor_next_checkpoint_show()
561 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_next_checkpoint_show()
568 struct the_nilfs *nilfs, in nilfs_segctor_last_seg_write_time_show() argument
573 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_last_seg_write_time_show()
574 ctime = nilfs->ns_ctime; in nilfs_segctor_last_seg_write_time_show()
575 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_last_seg_write_time_show()
582 struct the_nilfs *nilfs, in nilfs_segctor_last_seg_write_time_secs_show() argument
587 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_last_seg_write_time_secs_show()
588 ctime = nilfs->ns_ctime; in nilfs_segctor_last_seg_write_time_secs_show()
589 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_last_seg_write_time_secs_show()
596 struct the_nilfs *nilfs, in nilfs_segctor_last_nongc_write_time_show() argument
601 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_last_nongc_write_time_show()
602 nongc_ctime = nilfs->ns_nongc_ctime; in nilfs_segctor_last_nongc_write_time_show()
603 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_last_nongc_write_time_show()
610 struct the_nilfs *nilfs, in nilfs_segctor_last_nongc_write_time_secs_show() argument
615 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_last_nongc_write_time_secs_show()
616 nongc_ctime = nilfs->ns_nongc_ctime; in nilfs_segctor_last_nongc_write_time_secs_show()
617 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_last_nongc_write_time_secs_show()
624 struct the_nilfs *nilfs, in nilfs_segctor_dirty_data_blocks_count_show() argument
629 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_dirty_data_blocks_count_show()
630 ndirtyblks = atomic_read(&nilfs->ns_ndirtyblks); in nilfs_segctor_dirty_data_blocks_count_show()
631 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_dirty_data_blocks_count_show()
668 struct the_nilfs *nilfs, char *buf) in nilfs_segctor_README_show() argument
716 struct the_nilfs *nilfs, in nilfs_superblock_sb_write_time_show() argument
721 down_read(&nilfs->ns_sem); in nilfs_superblock_sb_write_time_show()
722 sbwtime = nilfs->ns_sbwtime; in nilfs_superblock_sb_write_time_show()
723 up_read(&nilfs->ns_sem); in nilfs_superblock_sb_write_time_show()
730 struct the_nilfs *nilfs, in nilfs_superblock_sb_write_time_secs_show() argument
735 down_read(&nilfs->ns_sem); in nilfs_superblock_sb_write_time_secs_show()
736 sbwtime = nilfs->ns_sbwtime; in nilfs_superblock_sb_write_time_secs_show()
737 up_read(&nilfs->ns_sem); in nilfs_superblock_sb_write_time_secs_show()
744 struct the_nilfs *nilfs, in nilfs_superblock_sb_write_count_show() argument
749 down_read(&nilfs->ns_sem); in nilfs_superblock_sb_write_count_show()
750 sbwcount = nilfs->ns_sbwcount; in nilfs_superblock_sb_write_count_show()
751 up_read(&nilfs->ns_sem); in nilfs_superblock_sb_write_count_show()
758 struct the_nilfs *nilfs, in nilfs_superblock_sb_update_frequency_show() argument
763 down_read(&nilfs->ns_sem); in nilfs_superblock_sb_update_frequency_show()
764 sb_update_freq = nilfs->ns_sb_update_freq; in nilfs_superblock_sb_update_frequency_show()
765 up_read(&nilfs->ns_sem); in nilfs_superblock_sb_update_frequency_show()
772 struct the_nilfs *nilfs, in nilfs_superblock_sb_update_frequency_store() argument
780 nilfs_err(nilfs->ns_sb, "unable to convert string: err=%d", in nilfs_superblock_sb_update_frequency_store()
787 nilfs_warn(nilfs->ns_sb, in nilfs_superblock_sb_update_frequency_store()
791 down_write(&nilfs->ns_sem); in nilfs_superblock_sb_update_frequency_store()
792 nilfs->ns_sb_update_freq = val; in nilfs_superblock_sb_update_frequency_store()
793 up_write(&nilfs->ns_sem); in nilfs_superblock_sb_update_frequency_store()
813 struct the_nilfs *nilfs, char *buf) in nilfs_superblock_README_show() argument
843 struct the_nilfs *nilfs, in nilfs_dev_revision_show() argument
846 struct nilfs_super_block **sbp = nilfs->ns_sbp; in nilfs_dev_revision_show()
855 struct the_nilfs *nilfs, in nilfs_dev_blocksize_show() argument
858 return snprintf(buf, PAGE_SIZE, "%u\n", nilfs->ns_blocksize); in nilfs_dev_blocksize_show()
863 struct the_nilfs *nilfs, in nilfs_dev_device_size_show() argument
866 struct nilfs_super_block **sbp = nilfs->ns_sbp; in nilfs_dev_device_size_show()
874 struct the_nilfs *nilfs, in nilfs_dev_free_blocks_show() argument
879 nilfs_count_free_blocks(nilfs, &free_blocks); in nilfs_dev_free_blocks_show()
886 struct the_nilfs *nilfs, in nilfs_dev_uuid_show() argument
889 struct nilfs_super_block **sbp = nilfs->ns_sbp; in nilfs_dev_uuid_show()
896 struct the_nilfs *nilfs, in nilfs_dev_volume_name_show() argument
899 struct nilfs_super_block **sbp = nilfs->ns_sbp; in nilfs_dev_volume_name_show()
916 struct the_nilfs *nilfs, in nilfs_dev_README_show() argument
944 struct the_nilfs *nilfs = container_of(kobj, struct the_nilfs, in nilfs_dev_attr_show() local
949 return a->show ? a->show(a, nilfs, buf) : 0; in nilfs_dev_attr_show()
956 struct the_nilfs *nilfs = container_of(kobj, struct the_nilfs, in nilfs_dev_attr_store() local
961 return a->store ? a->store(a, nilfs, buf, len) : 0; in nilfs_dev_attr_store()
966 struct the_nilfs *nilfs = container_of(kobj, struct the_nilfs, in nilfs_dev_attr_release() local
968 complete(&nilfs->ns_dev_kobj_unregister); in nilfs_dev_attr_release()
984 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_sysfs_create_device_group() local
988 nilfs->ns_dev_subgroups = kzalloc(devgrp_size, GFP_KERNEL); in nilfs_sysfs_create_device_group()
989 if (unlikely(!nilfs->ns_dev_subgroups)) { in nilfs_sysfs_create_device_group()
995 nilfs->ns_dev_kobj.kset = nilfs_kset; in nilfs_sysfs_create_device_group()
996 init_completion(&nilfs->ns_dev_kobj_unregister); in nilfs_sysfs_create_device_group()
997 err = kobject_init_and_add(&nilfs->ns_dev_kobj, &nilfs_dev_ktype, NULL, in nilfs_sysfs_create_device_group()
1002 err = nilfs_sysfs_create_mounted_snapshots_group(nilfs); in nilfs_sysfs_create_device_group()
1006 err = nilfs_sysfs_create_checkpoints_group(nilfs); in nilfs_sysfs_create_device_group()
1010 err = nilfs_sysfs_create_segments_group(nilfs); in nilfs_sysfs_create_device_group()
1014 err = nilfs_sysfs_create_superblock_group(nilfs); in nilfs_sysfs_create_device_group()
1018 err = nilfs_sysfs_create_segctor_group(nilfs); in nilfs_sysfs_create_device_group()
1025 nilfs_sysfs_delete_superblock_group(nilfs); in nilfs_sysfs_create_device_group()
1028 nilfs_sysfs_delete_segments_group(nilfs); in nilfs_sysfs_create_device_group()
1031 nilfs_sysfs_delete_checkpoints_group(nilfs); in nilfs_sysfs_create_device_group()
1034 nilfs_sysfs_delete_mounted_snapshots_group(nilfs); in nilfs_sysfs_create_device_group()
1037 kobject_put(&nilfs->ns_dev_kobj); in nilfs_sysfs_create_device_group()
1038 kfree(nilfs->ns_dev_subgroups); in nilfs_sysfs_create_device_group()
1044 void nilfs_sysfs_delete_device_group(struct the_nilfs *nilfs) in nilfs_sysfs_delete_device_group() argument
1046 nilfs_sysfs_delete_mounted_snapshots_group(nilfs); in nilfs_sysfs_delete_device_group()
1047 nilfs_sysfs_delete_checkpoints_group(nilfs); in nilfs_sysfs_delete_device_group()
1048 nilfs_sysfs_delete_segments_group(nilfs); in nilfs_sysfs_delete_device_group()
1049 nilfs_sysfs_delete_superblock_group(nilfs); in nilfs_sysfs_delete_device_group()
1050 nilfs_sysfs_delete_segctor_group(nilfs); in nilfs_sysfs_delete_device_group()
1051 kobject_del(&nilfs->ns_dev_kobj); in nilfs_sysfs_delete_device_group()
1052 kobject_put(&nilfs->ns_dev_kobj); in nilfs_sysfs_delete_device_group()
1053 kfree(nilfs->ns_dev_subgroups); in nilfs_sysfs_delete_device_group()