Lines Matching full:sbi

66 static ssize_t session_write_kbytes_show(struct ext4_sb_info *sbi, char *buf)  in session_write_kbytes_show()  argument
68 struct super_block *sb = sbi->s_buddy_cache->i_sb; in session_write_kbytes_show()
72 sbi->s_sectors_written_start) >> 1); in session_write_kbytes_show()
75 static ssize_t lifetime_write_kbytes_show(struct ext4_sb_info *sbi, char *buf) in lifetime_write_kbytes_show() argument
77 struct super_block *sb = sbi->s_buddy_cache->i_sb; in lifetime_write_kbytes_show()
80 (unsigned long long)(sbi->s_kbytes_written + in lifetime_write_kbytes_show()
85 static ssize_t inode_readahead_blks_store(struct ext4_sb_info *sbi, in inode_readahead_blks_store() argument
98 sbi->s_inode_readahead_blks = t; in inode_readahead_blks_store()
102 static ssize_t reserved_clusters_store(struct ext4_sb_info *sbi, in reserved_clusters_store() argument
106 ext4_fsblk_t clusters = (ext4_blocks_count(sbi->s_es) >> in reserved_clusters_store()
107 sbi->s_cluster_bits); in reserved_clusters_store()
114 atomic64_set(&sbi->s_resv_clusters, val); in reserved_clusters_store()
118 static ssize_t trigger_test_error(struct ext4_sb_info *sbi, in trigger_test_error() argument
130 ext4_error(sbi->s_sb, "%.*s", len, buf); in trigger_test_error()
134 static ssize_t err_report_sec_store(struct ext4_sb_info *sbi, in err_report_sec_store() argument
148 if (sbi->s_err_report_sec == t) /*nothing to do*/ in err_report_sec_store()
150 else if (!sbi->s_err_report_sec && t) { in err_report_sec_store()
151 timer_setup(&sbi->s_err_report, print_daily_error_info, 0); in err_report_sec_store()
152 } else if (sbi->s_err_report_sec && !t) { in err_report_sec_store()
153 timer_delete_sync(&sbi->s_err_report); in err_report_sec_store()
157 sbi->s_err_report_sec = t; in err_report_sec_store()
158 mod_timer(&sbi->s_err_report, jiffies + secs_to_jiffies(sbi->s_err_report_sec)); in err_report_sec_store()
164 static ssize_t journal_task_show(struct ext4_sb_info *sbi, char *buf) in journal_task_show() argument
166 if (!sbi->s_journal) in journal_task_show()
169 task_pid_vnr(sbi->s_journal->j_task)); in journal_task_show()
398 static void *calc_ptr(struct ext4_attr *a, struct ext4_sb_info *sbi) in calc_ptr() argument
404 return (void *) (((char *) sbi) + a->u.offset); in calc_ptr()
406 return (void *) (((char *) sbi->s_es) + a->u.offset); in calc_ptr()
421 struct ext4_sb_info *sbi, char *buf) in ext4_generic_attr_show() argument
423 void *ptr = calc_ptr(a, sbi); in ext4_generic_attr_show()
457 struct ext4_sb_info *sbi = container_of(kobj, struct ext4_sb_info, in ext4_attr_show() local
464 (s64) EXT4_C2B(sbi, in ext4_attr_show()
465 percpu_counter_sum(&sbi->s_dirtyclusters_counter))); in ext4_attr_show()
467 return session_write_kbytes_show(sbi, buf); in ext4_attr_show()
469 return lifetime_write_kbytes_show(sbi, buf); in ext4_attr_show()
473 atomic64_read(&sbi->s_resv_clusters)); in ext4_attr_show()
477 percpu_counter_sum(&sbi->s_sra_exceeded_retry_limit)); in ext4_attr_show()
481 return print_tstamp(buf, sbi->s_es, s_first_error_time); in ext4_attr_show()
483 return print_tstamp(buf, sbi->s_es, s_last_error_time); in ext4_attr_show()
485 return journal_task_show(sbi, buf); in ext4_attr_show()
487 return ext4_generic_attr_show(a, sbi, buf); in ext4_attr_show()
492 struct ext4_sb_info *sbi, in ext4_generic_attr_store() argument
498 void *ptr = calc_ptr(a, sbi); in ext4_generic_attr_store()
533 if (t > sbi->s_clusters_per_group) in ext4_generic_attr_store()
551 struct ext4_sb_info *sbi = container_of(kobj, struct ext4_sb_info, in ext4_attr_store() local
557 return reserved_clusters_store(sbi, buf, len); in ext4_attr_store()
559 return inode_readahead_blks_store(sbi, buf, len); in ext4_attr_store()
561 return trigger_test_error(sbi, buf, len); in ext4_attr_store()
563 return err_report_sec_store(sbi, buf, len); in ext4_attr_store()
565 return ext4_generic_attr_store(a, sbi, buf, len); in ext4_attr_store()
571 struct ext4_sb_info *sbi = container_of(kobj, struct ext4_sb_info, in ext4_sb_release() local
573 complete(&sbi->s_kobj_unregister); in ext4_sb_release()
598 void ext4_notify_error_sysfs(struct ext4_sb_info *sbi) in ext4_notify_error_sysfs() argument
600 sysfs_notify(&sbi->s_kobj, NULL, "errors_count"); in ext4_notify_error_sysfs()
609 struct ext4_sb_info *sbi = EXT4_SB(sb); in ext4_register_sysfs() local
612 init_completion(&sbi->s_kobj_unregister); in ext4_register_sysfs()
613 err = kobject_init_and_add(&sbi->s_kobj, &ext4_sb_ktype, ext4_root, in ext4_register_sysfs()
616 kobject_put(&sbi->s_kobj); in ext4_register_sysfs()
617 wait_for_completion(&sbi->s_kobj_unregister); in ext4_register_sysfs()
622 sbi->s_proc = proc_mkdir(sb->s_id, ext4_proc_root); in ext4_register_sysfs()
623 if (sbi->s_proc) { in ext4_register_sysfs()
624 proc_create_single_data("options", S_IRUGO, sbi->s_proc, in ext4_register_sysfs()
627 sbi->s_proc, ext4_seq_es_shrinker_info_show, in ext4_register_sysfs()
629 proc_create_single_data("fc_info", 0444, sbi->s_proc, in ext4_register_sysfs()
631 proc_create_seq_data("mb_groups", S_IRUGO, sbi->s_proc, in ext4_register_sysfs()
633 proc_create_single_data("mb_stats", 0444, sbi->s_proc, in ext4_register_sysfs()
635 proc_create_seq_data("mb_structs_summary", 0444, sbi->s_proc, in ext4_register_sysfs()
643 struct ext4_sb_info *sbi = EXT4_SB(sb); in ext4_unregister_sysfs() local
645 if (sbi->s_proc) in ext4_unregister_sysfs()
647 kobject_del(&sbi->s_kobj); in ext4_unregister_sysfs()