| /linux-6.15/fs/f2fs/ |
| H A D | super.c | 342 sbi->user_block_count - sbi->reserved_blocks); in limit_reserve_root() 369 F2FS_OPTION(sbi).unusable_cap = sbi->user_block_count; in adjust_unusable_cap_perc() 1403 if (test_opt(sbi, ATGC) && f2fs_lfs_mode(sbi)) { in f2fs_default_check() 1677 f2fs_bug_on(sbi, sbi->fsync_node_num); in f2fs_put_super() 3876 sbi->blocksize = BIT(sbi->log_blocksize); in init_sb_info() 3882 sbi->total_node_count = SEGS_TO_BLKS(sbi, in init_sb_info() 3893 sbi->migration_granularity = SEGS_PER_SEC(sbi); in init_sb_info() 4025 rep_zone_arg.sbi = sbi; in init_blkz_info() 4109 crc = f2fs_crc32(sbi, F2FS_RAW_SUPER(sbi), in f2fs_commit_super() 4336 sbi->devs = f2fs_kzalloc(sbi, in f2fs_scan_devices() [all …]
|
| H A D | segment.h | 66 (SM_I(sbi) ? SM_I(sbi)->main_blkaddr : \ 69 (SM_I(sbi) ? SM_I(sbi)->seg0_blkaddr : \ 72 #define MAIN_SEGS(sbi) (SM_I(sbi)->main_segments) argument 73 #define MAIN_SECS(sbi) ((sbi)->total_sections) argument 76 (SM_I(sbi) ? SM_I(sbi)->segment_count : \ 78 #define TOTAL_BLKS(sbi) (SEGS_TO_BLKS(sbi, TOTAL_SEGS(sbi))) argument 80 #define MAX_BLKADDR(sbi) (SEG0_BLKADDR(sbi) + TOTAL_BLKS(sbi)) argument 101 (BLKS_PER_SEC(sbi) - (sbi)->unusable_blocks_per_sec) 104 BLKS_TO_SEGS(sbi, (sbi)->unusable_blocks_per_sec)) 112 GET_ZONE_FROM_SEC(sbi, GET_SEC_FROM_SEG(sbi, segno)) [all …]
|
| H A D | checkpoint.c | 63 .sbi = sbi, in __get_meta_page() 258 .sbi = sbi, in f2fs_ra_meta_pages() 747 start_blk = __start_cp_addr(sbi) + 1 + __cp_payload(sbi); in f2fs_recover_orphan_inodes() 1346 sbi->blocks_per_seg - NM_I(sbi)->nat_bits_blocks) in update_ckpt_flags() 1520 get_sit_bitmap(sbi, __bitmap_ptr(sbi, SIT_BITMAP)); in do_checkpoint() 1521 get_nat_bitmap(sbi, __bitmap_ptr(sbi, NAT_BITMAP)); in do_checkpoint() 1595 MAIN_BLKADDR(sbi), MAX_BLKADDR(sbi) - 1)); in do_checkpoint() 1619 f2fs_bug_on(sbi, get_pages(sbi, F2FS_DIRTY_DENTS)); in do_checkpoint() 1630 if (f2fs_readonly(sbi->sb) || f2fs_hw_is_readonly(sbi)) in f2fs_write_checkpoint() 1689 f2fs_bug_on(sbi, !f2fs_cp_error(sbi)); in f2fs_write_checkpoint() [all …]
|
| H A D | segment.c | 185 SM_I(sbi)->min_ssr_sections + reserved_sections(sbi)); in f2fs_need_SSR() 437 if (test_opt(sbi, GC_MERGE) && sbi->gc_thread && in f2fs_balance_fs() 555 return __submit_flush_wait(sbi, sbi->sb->s_bdev); in submit_flush_wait() 1678 f2fs_bug_on(sbi, !f2fs_check_discard_tree(sbi)); in __issue_discard_cmd() 2065 se = get_seg_entry(sbi, GET_SEGNO(sbi, i)); in f2fs_issue_discard() 2450 f2fs_bug_on(sbi, GET_SEGNO(sbi, blkaddr) != GET_SEGNO(sbi, blkaddr + del_count - 1)); in update_sit_entry_for_release() 3940 .sbi = sbi, in f2fs_do_write_meta_page() 3975 struct f2fs_sb_info *sbi = fio->sbi; in f2fs_outplace_write_data() local 3991 struct f2fs_sb_info *sbi = fio->sbi; in f2fs_inplace_write_data() local 4955 sbi->discard_blks += BLKS_PER_SEG(sbi) - in build_sit_entries() [all …]
|
| H A D | gc.c | 169 prefree_segments(sbi), free_segments(sbi)); in gc_thread_func() 398 CAP_BLKS_PER_SEC(sbi) * sbi->gc_thread->valid_thresh_ratio / in get_gc_cost() 687 f2fs_bug_on(sbi, !f2fs_check_victim_tree(sbi, &sbi->am.root)); in lookup_victim_by_age() 784 last_segment = MAIN_SECS(sbi) * SEGS_PER_SEC(sbi); in f2fs_get_victim() 929 (MAIN_SECS(sbi) * SEGS_PER_SEC(sbi)); in f2fs_get_victim() 964 prefree_segments(sbi), free_segments(sbi)); in f2fs_get_victim() 1210 .sbi = sbi, in ra_data_block() 1767 f2fs_ra_meta_pages(sbi, GET_SUM_BLOCK(sbi, segno), in do_garbage_collect() 1830 sbi->gc_reclaimed_segs[sbi->gc_mode]++; in do_garbage_collect() 2096 start = MAIN_SECS(sbi) * SEGS_PER_SEC(sbi); in free_segment_range() [all …]
|
| H A D | iostat.c | 23 return sbi->iostat_count[type] ? div64_u64(sbi->iostat_bytes[type], in iostat_get_avg_bytes() 24 sbi->iostat_count[type]) : 0; in iostat_get_avg_bytes() 38 if (!sbi->iostat_enable) in iostat_info_seq_show() 134 sbi->prev_iostat_bytes[i] = sbi->iostat_bytes[i]; in f2fs_record_iostat() 173 if (!sbi->iostat_enable) in f2fs_update_iostat() 209 f2fs_record_iostat(sbi); in f2fs_update_iostat() 217 struct f2fs_sb_info *sbi = iostat_ctx->sbi; in __update_iostat_latency() local 221 if (!sbi->iostat_enable) in __update_iostat_latency() 264 iostat_ctx->sbi = sbi; in iostat_alloc_and_bind_ctx() 304 sbi->iostat_io_lat = f2fs_kzalloc(sbi, sizeof(struct iostat_lat_info), in f2fs_init_iostat() [all …]
|
| H A D | debug.c | 44 for (segno = 0; segno < MAIN_SEGS(sbi); segno += SEGS_PER_SEC(sbi)) { in f2fs_update_sit_info() 112 if (IS_CURSEC(sbi, GET_SEC_FROM_SEG(sbi, j))) in update_multidevice_stats() 203 si->total_count = BLKS_TO_SEGS(sbi, (int)sbi->user_block_count); in update_general_status() 225 if (sbi->node_inode) in update_general_status() 244 si->util_free = (int)(BLKS_TO_SEGS(sbi, free_user_blocks(sbi))) in update_general_status() 245 * 100 / (int)(sbi->user_block_count >> sbi->log_blocks_per_seg) in update_general_status() 247 si->util_valid = (int)(BLKS_TO_SEGS(sbi, written_block_count(sbi))) in update_general_status() 248 * 100 / (int)(sbi->user_block_count >> sbi->log_blocks_per_seg) in update_general_status() 355 if (sbi->gc_thread) in update_mem_info() 446 struct f2fs_sb_info *sbi = si->sbi; in stat_show() local [all …]
|
| H A D | shrinker.c | 43 struct f2fs_sb_info *sbi; in f2fs_shrink_count() local 66 count += __count_nat_entries(sbi); in f2fs_shrink_count() 69 count += __count_free_nids(sbi); in f2fs_shrink_count() 73 mutex_unlock(&sbi->umount_mutex); in f2fs_shrink_count() 83 struct f2fs_sb_info *sbi; in f2fs_shrink_scan() local 106 sbi->shrinker_run_no = run_no; in f2fs_shrink_scan() 135 struct f2fs_sb_info *sbi; in f2fs_donate_files() local 199 struct f2fs_sb_info *sbi; in f2fs_reclaim_caches() local 232 f2fs_shrink_read_extent_tree(sbi, __count_extent_cache(sbi, EX_READ)); in f2fs_leave_shrinker() 233 f2fs_shrink_age_extent_tree(sbi, in f2fs_leave_shrinker() [all …]
|
| H A D | sysfs.c | 146 if (!SM_I(sbi)->dcc_info) in pending_discard_show() 155 if (!SM_I(sbi)->dcc_info) in issued_discard_show() 164 if (!SM_I(sbi)->dcc_info) in queued_discard_show() 377 sbi->gc_reclaimed_segs[sbi->gc_segment_mode]); in f2fs_sbi_show() 515 sbi->current_reserved_blocks = min(sbi->reserved_blocks, in __sbi_store() 516 sbi->user_block_count - valid_user_blocks(sbi)); in __sbi_store() 581 if (sbi->gc_thread) { in __sbi_store() 715 sbi->gc_reclaimed_segs[sbi->gc_segment_mode] = 0; in __sbi_store() 816 sbi->dir_level = t; in __sbi_store() 1666 SEGS_PER_SEC(sbi)); in disk_map_seq_show() [all …]
|
| H A D | f2fs.h | 126 #define F2FS_OPTION(sbi) ((sbi)->mount_opt) argument 1863 #define BLKS_PER_SEG(sbi) ((sbi)->blocks_per_seg) argument 1864 #define BLKS_PER_SEC(sbi) (SEGS_TO_BLKS(sbi, (sbi)->segs_per_sec)) argument 1865 #define SEGS_PER_SEC(sbi) ((sbi)->segs_per_sec) argument 2524 sbi->current_reserved_blocks < sbi->reserved_blocks) in dec_valid_block_count() 2525 sbi->current_reserved_blocks = min(sbi->reserved_blocks, in dec_valid_block_count() 2692 sbi->cur_cp_pack = (sbi->cur_cp_pack == 1) ? 2 : 1; in __set_cp_next_pack() 2781 sbi->current_reserved_blocks < sbi->reserved_blocks) in dec_valid_node_count() 2943 if (SM_I(sbi) && SM_I(sbi)->fcc_info && in is_inflight_io() 3550 #define __is_large_section(sbi) (SEGS_PER_SEC(sbi) > 1) argument [all …]
|
| H A D | node.c | 35 if (unlikely(nid < F2FS_ROOT_INO(sbi) || nid >= NM_I(sbi)->max_nid)) { in f2fs_check_nid_range() 135 return f2fs_get_meta_page_retry(sbi, current_nat_addr(sbi, nid)); in get_current_nat_page() 147 dst_off = next_nat_addr(sbi, current_nat_addr(sbi, nid)); in get_next_nat_page() 323 sbi->fsync_seg_id = 0; in f2fs_init_fsync_node_info() 345 sbi->fsync_node_num++; in f2fs_add_fsync_node_entry() 368 f2fs_bug_on(sbi, 1); in f2fs_del_fsync_node_entry() 1397 .sbi = sbi, in read_node_page() 1677 .sbi = sbi, in __write_node_page() 3173 nat_bits_addr = __start_cp_addr(sbi) + BLKS_PER_SEG(sbi) - in __get_nat_bitmaps() 3332 sbi->nm_info = f2fs_kzalloc(sbi, sizeof(struct f2fs_nm_info), in f2fs_build_node_manager() [all …]
|
| /linux-6.15/fs/autofs/ |
| H A D | inode.c | 21 ino->sbi = sbi; in autofs_new_ino() 51 if (sbi) { in autofs_kill_sb() 59 if (sbi) in autofs_kill_sb() 68 if (!sbi) in autofs_show_options() 245 sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); in autofs_alloc_sbi() 246 if (!sbi) in autofs_alloc_sbi() 275 sbi->min_proto, sbi->max_proto, in autofs_validate_protocol() 284 sbi->version = sbi->max_proto; in autofs_validate_protocol() 356 sbi->pipefd, pid_nr(sbi->oz_pgrp)); in autofs_fill_super() 385 if (sbi) { in autofs_free_fc() [all …]
|
| /linux-6.15/fs/hfsplus/ |
| H A D | super.c | 219 memcpy(sbi->s_backup_vhdr, sbi->s_vhdr, sizeof(*sbi->s_vhdr)); in hfsplus_sync_fs() 233 sbi->part_start + sbi->sect_count - 2, in hfsplus_sync_fs() 286 kfree(sbi); in delayed_free() 325 buf->f_blocks = sbi->total_blocks << sbi->fs_shift; in hfsplus_statfs() 326 buf->f_bfree = sbi->free_blocks << sbi->fs_shift; in hfsplus_statfs() 398 if (!sbi->nls) { in hfsplus_fill_super() 401 if (!sbi->nls) in hfsplus_fill_super() 406 nls = sbi->nls; in hfsplus_fill_super() 590 sbi->nls = nls; in hfsplus_fill_super() 613 kfree(sbi); in hfsplus_fill_super() [all …]
|
| H A D | options.c | 93 memcpy(&sbi->type, param->string, 4); in hfsplus_parse_param() 99 sbi->uid = result.uid; in hfsplus_parse_param() 103 sbi->gid = result.gid; in hfsplus_parse_param() 107 sbi->part = result.uint_32; in hfsplus_parse_param() 110 sbi->session = result.uint_32; in hfsplus_parse_param() 113 if (sbi->nls) { in hfsplus_parse_param() 117 sbi->nls = load_nls(param->string); in hfsplus_parse_param() 118 if (!sbi->nls) { in hfsplus_parse_param() 157 if (sbi->part >= 0) in hfsplus_show_options() 159 if (sbi->session >= 0) in hfsplus_show_options() [all …]
|
| /linux-6.15/fs/exfat/ |
| H A D | super.c | 39 exfat_free_bitmap(sbi); in exfat_put_super() 40 brelse(sbi->boot_bh); in exfat_put_super() 143 else if (sbi->nls_io) in exfat_show_options() 454 if (!sbi->boot_bh) { in exfat_read_boot_sector() 506 sbi->cluster_size = 1 << sbi->cluster_size_bits; in exfat_read_boot_sector() 511 sbi->FAT2_start_sector += sbi->num_FAT_sectors; in exfat_read_boot_sector() 680 sbi->nls_io = load_nls(sbi->options.iocharset); in exfat_fill_super() 741 kfree(sbi); in exfat_free_sbi() 748 if (sbi) in exfat_free() 773 if (!sbi) in exfat_init_fs_context() [all …]
|
| H A D | balloc.c | 53 sbi->vol_amap = kvmalloc_array(sbi->map_sectors, in exfat_allocate_bitmap() 55 if (!sbi->vol_amap) in exfat_allocate_bitmap() 58 sector = exfat_cluster_to_sector(sbi, sbi->map_clu); in exfat_allocate_bitmap() 61 if (!sbi->vol_amap[i]) { in exfat_allocate_bitmap() 66 brelse(sbi->vol_amap[j++]); in exfat_allocate_bitmap() 68 kvfree(sbi->vol_amap); in exfat_allocate_bitmap() 69 sbi->vol_amap = NULL; in exfat_allocate_bitmap() 120 __brelse(sbi->vol_amap[i]); in exfat_free_bitmap() 122 kvfree(sbi->vol_amap); in exfat_free_bitmap() 260 if (clu_start >= sbi->num_clusters || range->len < sbi->cluster_size) in exfat_trim_fs() [all …]
|
| /linux-6.15/fs/erofs/ |
| H A D | super.c | 198 sbi->total_blocks = sbi->dif0.blocks; in erofs_scan_devices() 272 if (sbi->blkszbits < 9 || sbi->blkszbits > PAGE_SHIFT) { in erofs_read_superblock() 299 sbi->sb_size); in erofs_read_superblock() 313 sbi->dif0.blocks = (sbi->dif0.blocks << 32) | in erofs_read_superblock() 484 if (!sbi->fsid) in erofs_fc_parse_param() 644 if (erofs_sb_has_fragments(sbi) && sbi->packed_nid) { in erofs_fc_fill_super() 761 kfree(sbi); in erofs_sb_free() 783 sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); in erofs_init_fs_context() 784 if (!sbi) in erofs_init_fs_context() 789 kfree(sbi); in erofs_init_fs_context() [all …]
|
| /linux-6.15/fs/omfs/ |
| H A D | inode.c | 45 err = omfs_allocate_range(dir->i_sb, sbi->s_mirrors, sbi->s_mirrors, in omfs_new_inode() 267 kfree(sbi); in omfs_put_super() 305 if (sbi->s_dmask == sbi->s_fmask) { in omfs_show_options() 353 block = clus_to_blk(sbi, sbi->s_bitmap_ino); in omfs_get_imap() 433 sbi->s_fmask = sbi->s_dmask = option; in parse_options() 462 if (!sbi) in omfs_fill_super() 469 sbi->s_dmask = sbi->s_fmask = current_umask(); in omfs_fill_super() 515 if (sbi->s_blocksize < sbi->s_sys_blocksize || in omfs_fill_super() 532 sbi->s_block_shift = get_bitmask_order(sbi->s_blocksize) - in omfs_fill_super() 553 sbi->s_bitmap_ino > sbi->s_num_blocks) { in omfs_fill_super() [all …]
|
| /linux-6.15/fs/affs/ |
| H A D | bitmap.c | 59 bh = sbi->s_bmap_bh; in affs_free_block() 65 sbi->s_bmap_bh = bh; in affs_free_block() 96 sbi->s_bmap_bh = NULL; in affs_free_block() 97 sbi->s_last_bmap = ~0; in affs_free_block() 126 sbi = AFFS_SB(sb); in affs_alloc_block() 165 bm = sbi->s_bitmap; in affs_alloc_block() 171 bh = sbi->s_bmap_bh; in affs_alloc_block() 265 sbi->s_bmap_count = (sbi->s_partition_size - sbi->s_reserved + in affs_init_bitmap() 266 sbi->s_bmap_bits - 1) / sbi->s_bmap_bits; in affs_init_bitmap() 315 offset = (sbi->s_partition_size - sbi->s_reserved) % sbi->s_bmap_bits; in affs_init_bitmap() [all …]
|
| H A D | super.c | 67 struct affs_sb_info *sbi; in flush_superblock() local 71 sb = sbi->sb; in flush_superblock() 74 sbi->work_queued = 0; in flush_superblock() 89 if (!sbi->work_queued) { in affs_mark_sb_dirty() 287 if (sbi->s_root_block != (sbi->s_reserved + sbi->s_partition_size - 1) / 2) in affs_show_options() 297 if (sbi->s_volume[0]) in affs_show_options() 331 if (!sbi) in affs_fill_super() 334 sb->s_fs_info = sbi; in affs_fill_super() 335 sbi->sb = sb; in affs_fill_super() 590 if (sbi) { in affs_kill_sb() [all …]
|
| /linux-6.15/fs/ufs/ |
| H A D | cylinder.c | 39 uspi = sbi->s_uspi; in ufs_read_cylinder() 96 uspi = sbi->s_uspi; in ufs_put_cylinder() 140 uspi = sbi->s_uspi; in ufs_load_cylinder() 175 for (i = 0; i < sbi->s_cg_loaded && sbi->s_cgno[i] != cgno; i++); in ufs_load_cylinder() 176 if (i < sbi->s_cg_loaded && sbi->s_cgno[i] == cgno) { in ufs_load_cylinder() 177 cg = sbi->s_cgno[i]; in ufs_load_cylinder() 180 sbi->s_cgno[j] = sbi->s_cgno[j-1]; in ufs_load_cylinder() 181 sbi->s_ucpi[j] = sbi->s_ucpi[j-1]; in ufs_load_cylinder() 194 ucpi = sbi->s_ucpi[sbi->s_cg_loaded - 1]; in ufs_load_cylinder() 196 sbi->s_cgno[j] = sbi->s_cgno[j-1]; in ufs_load_cylinder() [all …]
|
| /linux-6.15/fs/hpfs/ |
| H A D | super.c | 118 kfree(sbi); in free_sbi() 445 sbi->sb_uid = ctx->uid; sbi->sb_gid = ctx->gid; in hpfs_reconfigure() 448 sbi->sb_eas = ctx->eas; sbi->sb_chk = ctx->chk; in hpfs_reconfigure() 450 sbi->sb_err = ctx->errs; sbi->sb_timeshift = ctx->timeshift; in hpfs_reconfigure() 471 if (!sbi->sb_chk) in hpfs_show_options() 475 if (!sbi->sb_err) in hpfs_show_options() 483 if (!sbi->sb_eas) in hpfs_show_options() 519 sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); in hpfs_fill_super() 520 if (!sbi) { in hpfs_fill_super() 621 if (sbi->sb_chk) { in hpfs_fill_super() [all …]
|
| /linux-6.15/fs/ntfs3/ |
| H A D | super.c | 473 sbi->volume.major_ver, sbi->volume.minor_ver, in ntfs3_volinfo() 474 sbi->cluster_size, sbi->used.bitmap.nbits, in ntfs3_volinfo() 476 sbi->mft.bitmap.nbits - wnd_zeroes(&sbi->mft.bitmap), in ntfs3_volinfo() 689 kfree(sbi); in ntfs3_free_sbi() 978 sbi->cluster_mask = sbi->cluster_size - 1; in ntfs_init_from_boot() 979 sbi->cluster_mask_inv = ~(u64)sbi->cluster_mask; in ntfs_init_from_boot() 1217 sbi->sb = sb; in ntfs_fill_super() 1357 sbi->mft.used = ni->i_valid >> sbi->record_bits; in ntfs_fill_super() 1731 if (sbi) { in ntfs_fs_free() 1774 if (!sbi) in __ntfs_init_fs_context() [all …]
|
| /linux-6.15/fs/ext2/ |
| H A D | super.c | 202 kfree(sbi); in ext2_put_super() 895 sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); in ext2_fill_super() 896 if (!sbi) in ext2_fill_super() 902 kfree(sbi); in ext2_fill_super() 1057 sbi->s_itb_per_group = sbi->s_inodes_per_group / in ext2_fill_super() 1094 sbi->s_blocks_per_group, sbi->s_inodes_per_group + 3); in ext2_fill_super() 1097 if (sbi->s_inodes_per_group < sbi->s_inodes_per_block || in ext2_fill_super() 1119 (u64)sbi->s_groups_count * sbi->s_inodes_per_group); in ext2_fill_super() 1133 sbi->s_debts = kcalloc(sbi->s_groups_count, sizeof(*sbi->s_debts), GFP_KERNEL); in ext2_fill_super() 1258 kfree(sbi); in ext2_fill_super() [all …]
|
| /linux-6.15/fs/minix/ |
| H A D | inode.c | 49 sbi->s_ms->s_state = sbi->s_mount_state; in minix_put_super() 59 kfree(sbi); in minix_put_super() 123 ms = sbi->s_ms; in minix_reconfigure() 158 if (sbi->s_imap_blocks == 0 || sbi->s_zmap_blocks == 0) in minix_check_superblock() 186 if (!sbi) in minix_fill_super() 200 sbi->s_ms = ms; in minix_fill_super() 258 i = (sbi->s_imap_blocks + sbi->s_zmap_blocks) * sizeof(bh); in minix_fill_super() 263 sbi->s_zmap = &map[sbi->s_imap_blocks]; in minix_fill_super() 292 (sbi->s_nzones - sbi->s_firstdatazone + 1), in minix_fill_super() 371 kfree(sbi); in minix_fill_super() [all …]
|