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; \
68 struct the_nilfs *nilfs = container_of(kobj->parent, \
71 subgroups = nilfs->ns_##parent_name##_subgroups; \
81 static int nilfs_sysfs_create_##name##_group(struct the_nilfs *nilfs) \
88 subgroups = nilfs->ns_##parent_name##_subgroups; \
91 parent = &nilfs->ns_##parent_name##_kobj; \
100 static void nilfs_sysfs_delete_##name##_group(struct the_nilfs *nilfs) \
102 kobject_del(&nilfs->ns_##parent_name##_subgroups->sg_##name##_kobj); \
191 struct the_nilfs *nilfs; in nilfs_sysfs_create_snapshot_group() local
195 nilfs = root->nilfs; in nilfs_sysfs_create_snapshot_group()
196 parent = &nilfs->ns_dev_subgroups->sg_mounted_snapshots_kobj; in nilfs_sysfs_create_snapshot_group()
203 &nilfs->ns_dev_kobj, in nilfs_sysfs_create_snapshot_group()
233 struct the_nilfs *nilfs, char *buf) in nilfs_mounted_snapshots_README_show() argument
255 struct the_nilfs *nilfs, in nilfs_checkpoints_checkpoints_number_show() argument
262 down_read(&nilfs->ns_segctor_sem); in nilfs_checkpoints_checkpoints_number_show()
263 err = nilfs_cpfile_get_stat(nilfs->ns_cpfile, &cpstat); in nilfs_checkpoints_checkpoints_number_show()
264 up_read(&nilfs->ns_segctor_sem); in nilfs_checkpoints_checkpoints_number_show()
266 nilfs_err(nilfs->ns_sb, "unable to get checkpoint stat: err=%d", in nilfs_checkpoints_checkpoints_number_show()
278 struct the_nilfs *nilfs, in nilfs_checkpoints_snapshots_number_show() argument
285 down_read(&nilfs->ns_segctor_sem); in nilfs_checkpoints_snapshots_number_show()
286 err = nilfs_cpfile_get_stat(nilfs->ns_cpfile, &cpstat); in nilfs_checkpoints_snapshots_number_show()
287 up_read(&nilfs->ns_segctor_sem); in nilfs_checkpoints_snapshots_number_show()
289 nilfs_err(nilfs->ns_sb, "unable to get checkpoint stat: err=%d", in nilfs_checkpoints_snapshots_number_show()
301 struct the_nilfs *nilfs, in nilfs_checkpoints_last_seg_checkpoint_show() argument
306 spin_lock(&nilfs->ns_last_segment_lock); in nilfs_checkpoints_last_seg_checkpoint_show()
307 last_cno = nilfs->ns_last_cno; in nilfs_checkpoints_last_seg_checkpoint_show()
308 spin_unlock(&nilfs->ns_last_segment_lock); in nilfs_checkpoints_last_seg_checkpoint_show()
315 struct the_nilfs *nilfs, in nilfs_checkpoints_next_checkpoint_show() argument
320 down_read(&nilfs->ns_segctor_sem); in nilfs_checkpoints_next_checkpoint_show()
321 cno = nilfs->ns_cno; in nilfs_checkpoints_next_checkpoint_show()
322 up_read(&nilfs->ns_segctor_sem); in nilfs_checkpoints_next_checkpoint_show()
338 struct the_nilfs *nilfs, char *buf) in nilfs_checkpoints_README_show() argument
368 struct the_nilfs *nilfs, in nilfs_segments_segments_number_show() argument
371 return snprintf(buf, PAGE_SIZE, "%lu\n", nilfs->ns_nsegments); in nilfs_segments_segments_number_show()
376 struct the_nilfs *nilfs, in nilfs_segments_blocks_per_segment_show() argument
379 return snprintf(buf, PAGE_SIZE, "%lu\n", nilfs->ns_blocks_per_segment); in nilfs_segments_blocks_per_segment_show()
384 struct the_nilfs *nilfs, in nilfs_segments_clean_segments_show() argument
389 down_read(&NILFS_MDT(nilfs->ns_dat)->mi_sem); in nilfs_segments_clean_segments_show()
390 ncleansegs = nilfs_sufile_get_ncleansegs(nilfs->ns_sufile); in nilfs_segments_clean_segments_show()
391 up_read(&NILFS_MDT(nilfs->ns_dat)->mi_sem); in nilfs_segments_clean_segments_show()
398 struct the_nilfs *nilfs, in nilfs_segments_dirty_segments_show() argument
404 down_read(&nilfs->ns_segctor_sem); in nilfs_segments_dirty_segments_show()
405 err = nilfs_sufile_get_stat(nilfs->ns_sufile, &sustat); in nilfs_segments_dirty_segments_show()
406 up_read(&nilfs->ns_segctor_sem); in nilfs_segments_dirty_segments_show()
408 nilfs_err(nilfs->ns_sb, "unable to get segment stat: err=%d", in nilfs_segments_dirty_segments_show()
426 struct the_nilfs *nilfs, in nilfs_segments_README_show() argument
457 struct the_nilfs *nilfs, in nilfs_segctor_last_pseg_block_show() argument
462 spin_lock(&nilfs->ns_last_segment_lock); in nilfs_segctor_last_pseg_block_show()
463 last_pseg = nilfs->ns_last_pseg; in nilfs_segctor_last_pseg_block_show()
464 spin_unlock(&nilfs->ns_last_segment_lock); in nilfs_segctor_last_pseg_block_show()
472 struct the_nilfs *nilfs, in nilfs_segctor_last_seg_sequence_show() argument
477 spin_lock(&nilfs->ns_last_segment_lock); in nilfs_segctor_last_seg_sequence_show()
478 last_seq = nilfs->ns_last_seq; in nilfs_segctor_last_seg_sequence_show()
479 spin_unlock(&nilfs->ns_last_segment_lock); in nilfs_segctor_last_seg_sequence_show()
486 struct the_nilfs *nilfs, in nilfs_segctor_last_seg_checkpoint_show() argument
491 spin_lock(&nilfs->ns_last_segment_lock); in nilfs_segctor_last_seg_checkpoint_show()
492 last_cno = nilfs->ns_last_cno; in nilfs_segctor_last_seg_checkpoint_show()
493 spin_unlock(&nilfs->ns_last_segment_lock); in nilfs_segctor_last_seg_checkpoint_show()
500 struct the_nilfs *nilfs, in nilfs_segctor_current_seg_sequence_show() argument
505 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_current_seg_sequence_show()
506 seg_seq = nilfs->ns_seg_seq; in nilfs_segctor_current_seg_sequence_show()
507 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_current_seg_sequence_show()
514 struct the_nilfs *nilfs, in nilfs_segctor_current_last_full_seg_show() argument
519 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_current_last_full_seg_show()
520 segnum = nilfs->ns_segnum; in nilfs_segctor_current_last_full_seg_show()
521 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_current_last_full_seg_show()
528 struct the_nilfs *nilfs, in nilfs_segctor_next_full_seg_show() argument
533 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_next_full_seg_show()
534 nextnum = nilfs->ns_nextnum; in nilfs_segctor_next_full_seg_show()
535 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_next_full_seg_show()
542 struct the_nilfs *nilfs, in nilfs_segctor_next_pseg_offset_show() argument
547 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_next_pseg_offset_show()
548 pseg_offset = nilfs->ns_pseg_offset; in nilfs_segctor_next_pseg_offset_show()
549 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_next_pseg_offset_show()
556 struct the_nilfs *nilfs, in nilfs_segctor_next_checkpoint_show() argument
561 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_next_checkpoint_show()
562 cno = nilfs->ns_cno; in nilfs_segctor_next_checkpoint_show()
563 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_next_checkpoint_show()
570 struct the_nilfs *nilfs, in nilfs_segctor_last_seg_write_time_show() argument
575 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_last_seg_write_time_show()
576 ctime = nilfs->ns_ctime; in nilfs_segctor_last_seg_write_time_show()
577 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_last_seg_write_time_show()
584 struct the_nilfs *nilfs, in nilfs_segctor_last_seg_write_time_secs_show() argument
589 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_last_seg_write_time_secs_show()
590 ctime = nilfs->ns_ctime; in nilfs_segctor_last_seg_write_time_secs_show()
591 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_last_seg_write_time_secs_show()
598 struct the_nilfs *nilfs, in nilfs_segctor_last_nongc_write_time_show() argument
603 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_last_nongc_write_time_show()
604 nongc_ctime = nilfs->ns_nongc_ctime; in nilfs_segctor_last_nongc_write_time_show()
605 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_last_nongc_write_time_show()
612 struct the_nilfs *nilfs, in nilfs_segctor_last_nongc_write_time_secs_show() argument
617 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_last_nongc_write_time_secs_show()
618 nongc_ctime = nilfs->ns_nongc_ctime; in nilfs_segctor_last_nongc_write_time_secs_show()
619 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_last_nongc_write_time_secs_show()
626 struct the_nilfs *nilfs, in nilfs_segctor_dirty_data_blocks_count_show() argument
631 down_read(&nilfs->ns_segctor_sem); in nilfs_segctor_dirty_data_blocks_count_show()
632 ndirtyblks = atomic_read(&nilfs->ns_ndirtyblks); in nilfs_segctor_dirty_data_blocks_count_show()
633 up_read(&nilfs->ns_segctor_sem); in nilfs_segctor_dirty_data_blocks_count_show()
670 struct the_nilfs *nilfs, char *buf) in nilfs_segctor_README_show() argument
718 struct the_nilfs *nilfs, in nilfs_superblock_sb_write_time_show() argument
723 down_read(&nilfs->ns_sem); in nilfs_superblock_sb_write_time_show()
724 sbwtime = nilfs->ns_sbwtime; in nilfs_superblock_sb_write_time_show()
725 up_read(&nilfs->ns_sem); in nilfs_superblock_sb_write_time_show()
732 struct the_nilfs *nilfs, in nilfs_superblock_sb_write_time_secs_show() argument
737 down_read(&nilfs->ns_sem); in nilfs_superblock_sb_write_time_secs_show()
738 sbwtime = nilfs->ns_sbwtime; in nilfs_superblock_sb_write_time_secs_show()
739 up_read(&nilfs->ns_sem); in nilfs_superblock_sb_write_time_secs_show()
746 struct the_nilfs *nilfs, in nilfs_superblock_sb_write_count_show() argument
751 down_read(&nilfs->ns_sem); in nilfs_superblock_sb_write_count_show()
752 sbwcount = nilfs->ns_sbwcount; in nilfs_superblock_sb_write_count_show()
753 up_read(&nilfs->ns_sem); in nilfs_superblock_sb_write_count_show()
760 struct the_nilfs *nilfs, in nilfs_superblock_sb_update_frequency_show() argument
765 down_read(&nilfs->ns_sem); in nilfs_superblock_sb_update_frequency_show()
766 sb_update_freq = nilfs->ns_sb_update_freq; in nilfs_superblock_sb_update_frequency_show()
767 up_read(&nilfs->ns_sem); in nilfs_superblock_sb_update_frequency_show()
774 struct the_nilfs *nilfs, in nilfs_superblock_sb_update_frequency_store() argument
782 nilfs_err(nilfs->ns_sb, "unable to convert string: err=%d", in nilfs_superblock_sb_update_frequency_store()
789 nilfs_warn(nilfs->ns_sb, in nilfs_superblock_sb_update_frequency_store()
793 down_write(&nilfs->ns_sem); in nilfs_superblock_sb_update_frequency_store()
794 nilfs->ns_sb_update_freq = val; in nilfs_superblock_sb_update_frequency_store()
795 up_write(&nilfs->ns_sem); in nilfs_superblock_sb_update_frequency_store()
815 struct the_nilfs *nilfs, char *buf) in nilfs_superblock_README_show() argument
845 struct the_nilfs *nilfs, in nilfs_dev_revision_show() argument
848 struct nilfs_super_block **sbp = nilfs->ns_sbp; in nilfs_dev_revision_show()
857 struct the_nilfs *nilfs, in nilfs_dev_blocksize_show() argument
860 return snprintf(buf, PAGE_SIZE, "%u\n", nilfs->ns_blocksize); in nilfs_dev_blocksize_show()
865 struct the_nilfs *nilfs, in nilfs_dev_device_size_show() argument
868 struct nilfs_super_block **sbp = nilfs->ns_sbp; in nilfs_dev_device_size_show()
876 struct the_nilfs *nilfs, in nilfs_dev_free_blocks_show() argument
881 nilfs_count_free_blocks(nilfs, &free_blocks); in nilfs_dev_free_blocks_show()
888 struct the_nilfs *nilfs, in nilfs_dev_uuid_show() argument
891 struct nilfs_super_block **sbp = nilfs->ns_sbp; in nilfs_dev_uuid_show()
898 struct the_nilfs *nilfs, in nilfs_dev_volume_name_show() argument
901 struct nilfs_super_block **sbp = nilfs->ns_sbp; in nilfs_dev_volume_name_show()
918 struct the_nilfs *nilfs, in nilfs_dev_README_show() argument
946 struct the_nilfs *nilfs = container_of(kobj, struct the_nilfs, in nilfs_dev_attr_show() local
951 return a->show ? a->show(a, nilfs, buf) : 0; in nilfs_dev_attr_show()
958 struct the_nilfs *nilfs = container_of(kobj, struct the_nilfs, in nilfs_dev_attr_store() local
963 return a->store ? a->store(a, nilfs, buf, len) : 0; in nilfs_dev_attr_store()
968 struct the_nilfs *nilfs = container_of(kobj, struct the_nilfs, in nilfs_dev_attr_release() local
970 complete(&nilfs->ns_dev_kobj_unregister); in nilfs_dev_attr_release()
986 struct the_nilfs *nilfs = sb->s_fs_info; in nilfs_sysfs_create_device_group() local
990 nilfs->ns_dev_subgroups = kzalloc(devgrp_size, GFP_KERNEL); in nilfs_sysfs_create_device_group()
991 if (unlikely(!nilfs->ns_dev_subgroups)) { in nilfs_sysfs_create_device_group()
997 nilfs->ns_dev_kobj.kset = nilfs_kset; in nilfs_sysfs_create_device_group()
998 init_completion(&nilfs->ns_dev_kobj_unregister); in nilfs_sysfs_create_device_group()
999 err = kobject_init_and_add(&nilfs->ns_dev_kobj, &nilfs_dev_ktype, NULL, in nilfs_sysfs_create_device_group()
1004 err = nilfs_sysfs_create_mounted_snapshots_group(nilfs); in nilfs_sysfs_create_device_group()
1008 err = nilfs_sysfs_create_checkpoints_group(nilfs); in nilfs_sysfs_create_device_group()
1012 err = nilfs_sysfs_create_segments_group(nilfs); in nilfs_sysfs_create_device_group()
1016 err = nilfs_sysfs_create_superblock_group(nilfs); in nilfs_sysfs_create_device_group()
1020 err = nilfs_sysfs_create_segctor_group(nilfs); in nilfs_sysfs_create_device_group()
1027 nilfs_sysfs_delete_superblock_group(nilfs); in nilfs_sysfs_create_device_group()
1030 nilfs_sysfs_delete_segments_group(nilfs); in nilfs_sysfs_create_device_group()
1033 nilfs_sysfs_delete_checkpoints_group(nilfs); in nilfs_sysfs_create_device_group()
1036 nilfs_sysfs_delete_mounted_snapshots_group(nilfs); in nilfs_sysfs_create_device_group()
1039 kobject_del(&nilfs->ns_dev_kobj); in nilfs_sysfs_create_device_group()
1042 kfree(nilfs->ns_dev_subgroups); in nilfs_sysfs_create_device_group()
1048 void nilfs_sysfs_delete_device_group(struct the_nilfs *nilfs) in nilfs_sysfs_delete_device_group() argument
1050 nilfs_sysfs_delete_mounted_snapshots_group(nilfs); in nilfs_sysfs_delete_device_group()
1051 nilfs_sysfs_delete_checkpoints_group(nilfs); in nilfs_sysfs_delete_device_group()
1052 nilfs_sysfs_delete_segments_group(nilfs); in nilfs_sysfs_delete_device_group()
1053 nilfs_sysfs_delete_superblock_group(nilfs); in nilfs_sysfs_delete_device_group()
1054 nilfs_sysfs_delete_segctor_group(nilfs); in nilfs_sysfs_delete_device_group()
1055 kobject_del(&nilfs->ns_dev_kobj); in nilfs_sysfs_delete_device_group()
1056 kfree(nilfs->ns_dev_subgroups); in nilfs_sysfs_delete_device_group()