| /linux/fs/f2fs/ |
| H A D | segment.h | 31 static inline void sanity_check_seg_type(struct f2fs_sb_info *sbi, in sanity_check_seg_type() argument 34 f2fs_bug_on(sbi, seg_type >= NR_PERSISTENT_LOG); in sanity_check_seg_type() 37 #define MAIN_BLKADDR(sbi) \ argument 38 (SM_I(sbi) ? SM_I(sbi)->main_blkaddr : \ 39 le32_to_cpu(F2FS_RAW_SUPER(sbi)->main_blkaddr)) 40 #define SEG0_BLKADDR(sbi) \ argument 41 (SM_I(sbi) ? SM_I(sbi)->seg0_blkaddr : \ 42 le32_to_cpu(F2FS_RAW_SUPER(sbi)->segment0_blkaddr)) 44 #define MAIN_SEGS(sbi) (SM_I(sbi)->main_segments) argument 45 #define MAIN_SECS(sbi) ((sbi)->total_sections) argument [all …]
|
| H A D | super.c | 74 int f2fs_build_fault_attr(struct f2fs_sb_info *sbi, unsigned long rate, in f2fs_build_fault_attr() argument 77 struct f2fs_fault_info *ffi = &F2FS_OPTION(sbi).fault_info; in f2fs_build_fault_attr() 89 f2fs_info(sbi, "build fault injection rate: %lu", rate); in f2fs_build_fault_attr() 96 f2fs_info(sbi, "build fault injection type: 0x%lx", type); in f2fs_build_fault_attr() 382 void f2fs_printk(struct f2fs_sb_info *sbi, bool limit_rate, in f2fs_printk() argument 395 if (sbi) in f2fs_printk() 397 KERN_SOH_ASCII, level, sbi->sb->s_id, &vaf); in f2fs_printk() 402 if (sbi) in f2fs_printk() 404 KERN_SOH_ASCII, level, sbi->sb->s_id, &vaf); in f2fs_printk() 451 static inline void limit_reserve_root(struct f2fs_sb_info *sbi) in limit_reserve_root() argument [all …]
|
| H A D | segment.c | 171 bool f2fs_need_SSR(struct f2fs_sb_info *sbi) in f2fs_need_SSR() argument 173 int node_secs = get_blocktype_secs(sbi, F2FS_DIRTY_NODES); in f2fs_need_SSR() 174 int dent_secs = get_blocktype_secs(sbi, F2FS_DIRTY_DENTS); in f2fs_need_SSR() 175 int imeta_secs = get_blocktype_secs(sbi, F2FS_DIRTY_IMETA); in f2fs_need_SSR() 177 if (f2fs_lfs_mode(sbi)) in f2fs_need_SSR() 179 if (sbi->gc_mode == GC_URGENT_HIGH) in f2fs_need_SSR() 181 if (unlikely(is_sbi_flag_set(sbi, SBI_CP_DISABLED))) in f2fs_need_SSR() 184 return free_sections(sbi) <= (node_secs + 2 * dent_secs + imeta_secs + in f2fs_need_SSR() 185 SM_I(sbi)->min_ssr_sections + reserved_sections(sbi)); in f2fs_need_SSR() 227 struct f2fs_sb_info *sbi = F2FS_I_SB(inode); in __replace_atomic_write_block() local [all …]
|
| H A D | checkpoint.c | 29 void f2fs_stop_checkpoint(struct f2fs_sb_info *sbi, bool end_io, in f2fs_stop_checkpoint() argument 32 f2fs_build_fault_attr(sbi, 0, 0, FAULT_ALL); in f2fs_stop_checkpoint() 34 f2fs_flush_merged_writes(sbi); in f2fs_stop_checkpoint() 35 f2fs_handle_critical_error(sbi, reason); in f2fs_stop_checkpoint() 41 struct folio *f2fs_grab_meta_folio(struct f2fs_sb_info *sbi, pgoff_t index) in f2fs_grab_meta_folio() argument 43 struct address_space *mapping = META_MAPPING(sbi); in f2fs_grab_meta_folio() 57 static struct folio *__get_meta_folio(struct f2fs_sb_info *sbi, pgoff_t index, in __get_meta_folio() argument 60 struct address_space *mapping = META_MAPPING(sbi); in __get_meta_folio() 63 .sbi = sbi, in __get_meta_folio() 93 f2fs_update_iostat(sbi, NULL, FS_META_READ_IO, F2FS_BLKSIZE); in __get_meta_folio() [all …]
|
| H A D | gc.c | 33 struct f2fs_sb_info *sbi = data; in gc_thread_func() local 34 struct f2fs_gc_kthread *gc_th = sbi->gc_thread; in gc_thread_func() 35 wait_queue_head_t *wq = &sbi->gc_thread->gc_wait_queue_head; in gc_thread_func() 36 wait_queue_head_t *fggc_wq = &sbi->gc_thread->fggc_wq; in gc_thread_func() 56 if (test_opt(sbi, GC_MERGE) && waitqueue_active(fggc_wq)) { in gc_thread_func() 59 } else if (f2fs_sb_has_blkzoned(sbi)) { in gc_thread_func() 67 if (f2fs_readonly(sbi->sb)) { in gc_thread_func() 68 stat_other_skip_bggc_count(sbi); in gc_thread_func() 74 if (sbi->sb->s_writers.frozen >= SB_FREEZE_WRITE) { in gc_thread_func() 76 stat_other_skip_bggc_count(sbi); in gc_thread_func() [all …]
|
| H A D | debug.c | 32 void f2fs_update_sit_info(struct f2fs_sb_info *sbi) in f2fs_update_sit_info() argument 34 struct f2fs_stat_info *si = F2FS_STAT(sbi); in f2fs_update_sit_info() 42 blks_per_sec = CAP_BLKS_PER_SEC(sbi); in f2fs_update_sit_info() 44 for (segno = 0; segno < MAIN_SEGS(sbi); segno += SEGS_PER_SEC(sbi)) { in f2fs_update_sit_info() 45 vblocks = get_valid_blocks(sbi, segno, true); in f2fs_update_sit_info() 54 dist = div_u64(MAIN_SECS(sbi) * hblks_per_sec * hblks_per_sec, 100); in f2fs_update_sit_info() 63 static void update_multidevice_stats(struct f2fs_sb_info *sbi) in update_multidevice_stats() argument 65 struct f2fs_stat_info *si = F2FS_STAT(sbi); in update_multidevice_stats() 69 if (!f2fs_is_multi_device(sbi)) in update_multidevice_stats() 72 memset(dev_stats, 0, sizeof(struct f2fs_dev_stats) * sbi->s_ndevs); in update_multidevice_stats() [all …]
|
| H A D | iostat.c | 20 static inline unsigned long long iostat_get_avg_bytes(struct f2fs_sb_info *sbi, in iostat_get_avg_bytes() argument 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() 29 name":", sbi->iostat_bytes[type], \ 30 sbi->iostat_count[type], \ 31 iostat_get_avg_bytes(sbi, type)) 36 struct f2fs_sb_info *sbi = F2FS_SB(sb); in iostat_info_seq_show() local 38 if (!sbi->iostat_enable) in iostat_info_seq_show() 88 static inline void __record_iostat_latency(struct f2fs_sb_info *sbi) in __record_iostat_latency() argument 92 struct iostat_lat_info *io_lat = sbi->iostat_io_lat; in __record_iostat_latency() [all …]
|
| H A D | shrinker.c | 19 static unsigned long __count_nat_entries(struct f2fs_sb_info *sbi) in __count_nat_entries() argument 21 return NM_I(sbi)->nat_cnt[RECLAIMABLE_NAT]; in __count_nat_entries() 24 static unsigned long __count_free_nids(struct f2fs_sb_info *sbi) in __count_free_nids() argument 26 long count = NM_I(sbi)->nid_cnt[FREE_NID] - MAX_FREE_NIDS; in __count_free_nids() 31 static unsigned long __count_extent_cache(struct f2fs_sb_info *sbi, in __count_extent_cache() argument 34 struct extent_tree_info *eti = &sbi->extent_tree[type]; in __count_extent_cache() 43 struct f2fs_sb_info *sbi; in f2fs_shrink_count() local 50 sbi = list_entry(p, struct f2fs_sb_info, s_list); in f2fs_shrink_count() 53 if (!mutex_trylock(&sbi->umount_mutex)) { in f2fs_shrink_count() 60 count += __count_extent_cache(sbi, EX_READ); in f2fs_shrink_count() [all …]
|
| H A D | sysfs.c | 56 ssize_t (*show)(struct f2fs_attr *a, struct f2fs_sb_info *sbi, char *buf); 57 ssize_t (*store)(struct f2fs_attr *a, struct f2fs_sb_info *sbi, 71 struct f2fs_sb_info *sbi, char *buf); 73 static unsigned char *__struct_ptr(struct f2fs_sb_info *sbi, int struct_type) in __struct_ptr() argument 76 return (unsigned char *)sbi->gc_thread; in __struct_ptr() 78 return (unsigned char *)SM_I(sbi); in __struct_ptr() 80 return (unsigned char *)SM_I(sbi)->dcc_info; in __struct_ptr() 82 return (unsigned char *)NM_I(sbi); in __struct_ptr() 84 return (unsigned char *)sbi; in __struct_ptr() 88 return (unsigned char *)&F2FS_OPTION(sbi).fault_info; in __struct_ptr() [all …]
|
| H A D | f2fs.h | 34 #define f2fs_bug_on(sbi, condition) BUG_ON(condition) argument 36 #define f2fs_bug_on(sbi, condition) \ argument 39 set_sbi_flag(sbi, SBI_NEED_FSCK); \ 138 #define F2FS_OPTION(sbi) ((sbi)->mount_opt) argument 139 #define clear_opt(sbi, option) \ argument 140 (F2FS_OPTION(sbi).opt &= ~BIT(F2FS_MOUNT_##option)) 141 #define set_opt(sbi, option) \ argument 142 (F2FS_OPTION(sbi).opt |= BIT(F2FS_MOUNT_##option)) 143 #define test_opt(sbi, option) \ argument 144 (F2FS_OPTION(sbi).opt & BIT(F2FS_MOUNT_##option)) [all …]
|
| H A D | node.c | 30 static inline bool is_invalid_nid(struct f2fs_sb_info *sbi, nid_t nid) in is_invalid_nid() argument 32 return nid < F2FS_ROOT_INO(sbi) || nid >= NM_I(sbi)->max_nid; in is_invalid_nid() 38 int f2fs_check_nid_range(struct f2fs_sb_info *sbi, nid_t nid) in f2fs_check_nid_range() argument 40 if (unlikely(is_invalid_nid(sbi, nid))) { in f2fs_check_nid_range() 41 set_sbi_flag(sbi, SBI_NEED_FSCK); in f2fs_check_nid_range() 42 f2fs_warn(sbi, "%s: out-of-range nid=%x, run fsck to fix.", in f2fs_check_nid_range() 44 f2fs_handle_error(sbi, ERROR_CORRUPTED_INODE); in f2fs_check_nid_range() 50 bool f2fs_available_free_memory(struct f2fs_sb_info *sbi, int type) in f2fs_available_free_memory() argument 52 struct f2fs_nm_info *nm_i = NM_I(sbi); in f2fs_available_free_memory() 53 struct discard_cmd_control *dcc = SM_I(sbi)->dcc_info; in f2fs_available_free_memory() [all …]
|
| H A D | inode.c | 120 bool f2fs_enable_inode_chksum(struct f2fs_sb_info *sbi, struct folio *folio) in f2fs_enable_inode_chksum() argument 124 if (!f2fs_sb_has_inode_chksum(sbi)) in f2fs_enable_inode_chksum() 137 static __u32 f2fs_inode_chksum(struct f2fs_sb_info *sbi, struct folio *folio) in f2fs_inode_chksum() argument 148 chksum = f2fs_chksum(sbi->s_chksum_seed, (__u8 *)&ino, sizeof(ino)); in f2fs_inode_chksum() 159 bool f2fs_inode_chksum_verify(struct f2fs_sb_info *sbi, struct folio *folio) in f2fs_inode_chksum_verify() argument 164 if (unlikely(is_sbi_flag_set(sbi, SBI_IS_SHUTDOWN))) in f2fs_inode_chksum_verify() 168 if (!f2fs_enable_inode_chksum(sbi, folio)) in f2fs_inode_chksum_verify() 170 if (!f2fs_enable_inode_chksum(sbi, folio) || in f2fs_inode_chksum_verify() 178 calculated = f2fs_inode_chksum(sbi, folio); in f2fs_inode_chksum_verify() 181 f2fs_warn(sbi, "checksum invalid, nid = %lu, ino_of_node = %x, %x vs. %x", in f2fs_inode_chksum_verify() [all …]
|
| /linux/fs/autofs/ |
| H A D | inode.c | 12 struct autofs_info *autofs_new_ino(struct autofs_sb_info *sbi) in autofs_new_ino() argument 21 ino->sbi = sbi; in autofs_new_ino() 43 struct autofs_sb_info *sbi = autofs_sbi(sb); in autofs_kill_sb() local 51 if (sbi) { in autofs_kill_sb() 53 autofs_catatonic_mode(sbi); in autofs_kill_sb() 54 put_pid(sbi->oz_pgrp); in autofs_kill_sb() 59 if (sbi) in autofs_kill_sb() 60 kfree_rcu(sbi, rcu); in autofs_kill_sb() 65 struct autofs_sb_info *sbi = autofs_sbi(root->d_sb); in autofs_show_options() local 68 if (!sbi) in autofs_show_options() [all …]
|
| H A D | root.c | 69 struct autofs_sb_info *sbi = autofs_sbi(dentry->d_sb); in autofs_del_active() local 73 spin_lock(&sbi->lookup_lock); in autofs_del_active() 75 spin_unlock(&sbi->lookup_lock); in autofs_del_active() 81 struct autofs_sb_info *sbi = autofs_sbi(dentry->d_sb); in autofs_dir_open() local 86 if (autofs_oz_mode(sbi)) in autofs_dir_open() 98 spin_lock(&sbi->lookup_lock); in autofs_dir_open() 100 spin_unlock(&sbi->lookup_lock); in autofs_dir_open() 103 spin_unlock(&sbi->lookup_lock); in autofs_dir_open() 112 struct autofs_sb_info *sbi = autofs_sbi(de->d_sb); in autofs_dentry_release() local 119 if (sbi) { in autofs_dentry_release() [all …]
|
| /linux/fs/exfat/ |
| H A D | super.c | 28 static void exfat_free_iocharset(struct exfat_sb_info *sbi) in exfat_free_iocharset() argument 30 if (sbi->options.iocharset != exfat_default_iocharset) in exfat_free_iocharset() 31 kfree(sbi->options.iocharset); in exfat_free_iocharset() 46 struct exfat_sb_info *sbi = EXFAT_SB(sb); in exfat_put_super() local 48 mutex_lock(&sbi->s_lock); in exfat_put_super() 50 exfat_free_bitmap(sbi); in exfat_put_super() 51 brelse(sbi->boot_bh); in exfat_put_super() 52 mutex_unlock(&sbi->s_lock); in exfat_put_super() 58 struct exfat_sb_info *sbi = EXFAT_SB(sb); in exfat_statfs() local 62 buf->f_bsize = sbi->cluster_size; in exfat_statfs() [all …]
|
| H A D | balloc.c | 33 struct exfat_sb_info *sbi = EXFAT_SB(sb); in exfat_test_bitmap_range() local 41 if (!is_valid_cluster(sbi, start) || !is_valid_cluster(sbi, end - 1)) in exfat_test_bitmap_range() 49 bitmap_le = (__le_long *)sbi->vol_amap[i]->b_data; in exfat_test_bitmap_range() 76 struct exfat_sb_info *sbi = EXFAT_SB(sb); in exfat_allocate_bitmap() local 83 sbi->map_clu = le32_to_cpu(ep->dentry.bitmap.start_clu); in exfat_allocate_bitmap() 85 need_map_size = ((EXFAT_DATA_CLUSTER_COUNT(sbi) - 1) / BITS_PER_BYTE) in exfat_allocate_bitmap() 97 sbi->map_sectors = ((need_map_size - 1) >> in exfat_allocate_bitmap() 99 sbi->vol_amap = kvmalloc_array(sbi->map_sectors, in exfat_allocate_bitmap() 101 if (!sbi->vol_amap) in exfat_allocate_bitmap() 104 sector = exfat_cluster_to_sector(sbi, sbi->map_clu); in exfat_allocate_bitmap() [all …]
|
| /linux/fs/affs/ |
| H A D | bitmap.c | 41 struct affs_sb_info *sbi = AFFS_SB(sb); in affs_free_block() local 49 if (block > sbi->s_partition_size) in affs_free_block() 52 blk = block - sbi->s_reserved; in affs_free_block() 53 bmap = blk / sbi->s_bmap_bits; in affs_free_block() 54 bit = blk % sbi->s_bmap_bits; in affs_free_block() 55 bm = &sbi->s_bitmap[bmap]; in affs_free_block() 57 mutex_lock(&sbi->s_bmlock); in affs_free_block() 59 bh = sbi->s_bmap_bh; in affs_free_block() 60 if (sbi->s_last_bmap != bmap) { in affs_free_block() 65 sbi->s_bmap_bh = bh; in affs_free_block() [all …]
|
| H A D | super.c | 35 struct affs_sb_info *sbi = AFFS_SB(sb); in affs_commit_super() local 36 struct buffer_head *bh = sbi->s_root_bh; in affs_commit_super() 52 struct affs_sb_info *sbi = AFFS_SB(sb); in affs_put_super() local 55 cancel_delayed_work_sync(&sbi->sb_work); in affs_put_super() 67 struct affs_sb_info *sbi; in flush_superblock() local 70 sbi = container_of(work, struct affs_sb_info, sb_work.work); in flush_superblock() 71 sb = sbi->sb; in flush_superblock() 73 spin_lock(&sbi->work_lock); in flush_superblock() 74 sbi->work_queued = 0; in flush_superblock() 75 spin_unlock(&sbi->work_lock); in flush_superblock() [all …]
|
| /linux/fs/omfs/ |
| H A D | inode.c | 28 struct omfs_sb_info *sbi = OMFS_SB(sb); in omfs_bread() local 29 if (block >= sbi->s_num_blocks) in omfs_bread() 32 return sb_bread(sb, clus_to_blk(sbi, block)); in omfs_bread() 41 struct omfs_sb_info *sbi = OMFS_SB(dir->i_sb); in omfs_new_inode() local 47 err = omfs_allocate_range(dir->i_sb, sbi->s_mirrors, sbi->s_mirrors, in omfs_new_inode() 61 inode->i_size = sbi->s_sys_blocksize; in omfs_new_inode() 107 struct omfs_sb_info *sbi = OMFS_SB(inode->i_sb); in __omfs_write_inode() local 132 oi->i_head.h_body_size = cpu_to_be32(sbi->s_sys_blocksize - in __omfs_write_inode() 153 for (i = 1; i < sbi->s_mirrors; i++) { in __omfs_write_inode() 206 struct omfs_sb_info *sbi = OMFS_SB(sb); in omfs_iget() local [all …]
|
| /linux/fs/hfsplus/ |
| H A D | options.c | 65 struct hfsplus_sb_info *sbi = fc->s_fs_info; in hfsplus_parse_param() local 87 memcpy(&sbi->creator, param->string, 4); in hfsplus_parse_param() 94 memcpy(&sbi->type, param->string, 4); in hfsplus_parse_param() 97 sbi->umask = (umode_t)result.uint_32; in hfsplus_parse_param() 100 sbi->uid = result.uid; in hfsplus_parse_param() 101 set_bit(HFSPLUS_SB_UID, &sbi->flags); in hfsplus_parse_param() 104 sbi->gid = result.gid; in hfsplus_parse_param() 105 set_bit(HFSPLUS_SB_GID, &sbi->flags); in hfsplus_parse_param() 108 sbi->part = result.uint_32; in hfsplus_parse_param() 111 sbi->session = result.uint_32; in hfsplus_parse_param() [all …]
|
| /linux/fs/hpfs/ |
| H A D | super.c | 115 static void free_sbi(struct hpfs_sb_info *sbi) in free_sbi() argument 117 kfree(sbi->sb_cp_table); in free_sbi() 118 kfree(sbi->sb_bmp_dir); in free_sbi() 119 kfree(sbi); in free_sbi() 169 struct hpfs_sb_info *sbi = hpfs_sb(s); in hpfs_get_free_dnodes() local 170 if (sbi->sb_n_free_dnodes == (unsigned)-1) { in hpfs_get_free_dnodes() 171 unsigned c = hpfs_count_one_bitmap(s, sbi->sb_dmap); in hpfs_get_free_dnodes() 174 sbi->sb_n_free_dnodes = c; in hpfs_get_free_dnodes() 176 return sbi->sb_n_free_dnodes; in hpfs_get_free_dnodes() 182 struct hpfs_sb_info *sbi = hpfs_sb(s); in hpfs_statfs() local [all …]
|
| /linux/fs/ext2/ |
| H A D | super.c | 54 struct ext2_sb_info *sbi = EXT2_SB(sb); in ext2_error() local 55 struct ext2_super_block *es = sbi->s_es; in ext2_error() 58 spin_lock(&sbi->s_lock); in ext2_error() 59 sbi->s_mount_state |= EXT2_ERROR_FS; in ext2_error() 61 spin_unlock(&sbi->s_lock); in ext2_error() 175 struct ext2_sb_info *sbi = EXT2_SB(sb); in ext2_put_super() local 179 ext2_xattr_destroy_cache(sbi->s_ea_block_cache); in ext2_put_super() 180 sbi->s_ea_block_cache = NULL; in ext2_put_super() 183 struct ext2_super_block *es = sbi->s_es; in ext2_put_super() 185 spin_lock(&sbi->s_lock); in ext2_put_super() [all …]
|
| /linux/fs/minix/ |
| H A D | inode.c | 61 struct minix_sb_info *sbi = minix_sb(sb); in minix_put_super() local 64 if (sbi->s_version != MINIX_V3) /* s_state is now out from V3 sb */ in minix_put_super() 65 sbi->s_ms->s_state = sbi->s_mount_state; in minix_put_super() 66 mark_buffer_dirty(sbi->s_sbh); in minix_put_super() 68 for (i = 0; i < sbi->s_imap_blocks; i++) in minix_put_super() 69 brelse(sbi->s_imap[i]); in minix_put_super() 70 for (i = 0; i < sbi->s_zmap_blocks; i++) in minix_put_super() 71 brelse(sbi->s_zmap[i]); in minix_put_super() 72 brelse (sbi->s_sbh); in minix_put_super() 73 kfree(sbi->s_imap); in minix_put_super() [all …]
|
| /linux/fs/jfs/ |
| H A D | jfs_mount.c | 73 struct jfs_sb_info *sbi = JFS_SBI(sb); in jfs_mount() local 93 sbi->ipaimap = ipaimap; in jfs_mount() 116 sbi->ipbmap = ipbmap; in jfs_mount() 137 if ((sbi->mntflag & JFS_BAD_SAIT) == 0) { in jfs_mount() 144 sbi->ipaimap2 = ipaimap2; in jfs_mount() 158 sbi->ipaimap2 = NULL; in jfs_mount() 182 sbi->ipimap = ipimap; in jfs_mount() 223 struct jfs_sb_info *sbi = JFS_SBI(sb); in jfs_mount_rw() local 232 if (chkSuper(sb) || (sbi->state != FM_CLEAN)) in jfs_mount_rw() 235 truncate_inode_pages(sbi->ipimap->i_mapping, 0); in jfs_mount_rw() [all …]
|
| /linux/fs/fat/ |
| H A D | inode.c | 124 struct msdos_sb_info *sbi = MSDOS_SB(sb); in __fat_get_block() local 147 offset = (unsigned long)iblock & (sbi->sec_per_clus - 1); in __fat_get_block() 160 mapped_blocks = sbi->sec_per_clus - offset; in __fat_get_block() 379 struct msdos_sb_info *sbi = MSDOS_SB(sb); in fat_hash_init() local 382 spin_lock_init(&sbi->inode_hash_lock); in fat_hash_init() 384 INIT_HLIST_HEAD(&sbi->inode_hashtable[i]); in fat_hash_init() 394 struct msdos_sb_info *sbi = MSDOS_SB(sb); in dir_hash_init() local 397 spin_lock_init(&sbi->dir_hash_lock); in dir_hash_init() 399 INIT_HLIST_HEAD(&sbi->dir_hashtable[i]); in dir_hash_init() 404 struct msdos_sb_info *sbi = MSDOS_SB(inode->i_sb); in fat_attach() local [all …]
|