Lines Matching refs:sbi

82 	struct ntfs_sb_info *sbi = sb->s_fs_info;  in ntfs_printk()  local
85 if (!___ratelimit(&sbi->msg_ratelimit, "ntfs3")) in ntfs_printk()
109 struct ntfs_sb_info *sbi = sb->s_fs_info; in ntfs_inode_printk() local
115 if (!___ratelimit(&sbi->msg_ratelimit, "ntfs3")) in ntfs_inode_printk()
408 struct ntfs_sb_info *sbi = sb->s_fs_info; in ntfs_fs_reconfigure() local
419 if (ro_rw && (sbi->flags & NTFS_FLAGS_NEED_REPLAY)) { in ntfs_fs_reconfigure()
432 if (new_opts->nls != sbi->options->nls) in ntfs_fs_reconfigure()
437 if (ro_rw && (sbi->volume.flags & VOLUME_FLAG_DIRTY) && in ntfs_fs_reconfigure()
446 swap(sbi->options, fc->fs_private); in ntfs_fs_reconfigure()
470 struct ntfs_sb_info *sbi = sb->s_fs_info; in ntfs3_volinfo() local
473 sbi->volume.major_ver, sbi->volume.minor_ver, in ntfs3_volinfo()
474 sbi->cluster_size, sbi->used.bitmap.nbits, in ntfs3_volinfo()
475 sbi->mft.bitmap.nbits, in ntfs3_volinfo()
476 sbi->mft.bitmap.nbits - wnd_zeroes(&sbi->mft.bitmap), in ntfs3_volinfo()
477 sbi->volume.real_dirty ? "dirty" : "clean", in ntfs3_volinfo()
478 (sbi->volume.flags & VOLUME_FLAG_DIRTY) ? "dirty" : "clean"); in ntfs3_volinfo()
492 struct ntfs_sb_info *sbi = sb->s_fs_info; in ntfs3_label_show() local
494 seq_printf(m, "%s\n", sbi->volume.label); in ntfs3_label_show()
592 static noinline void ntfs3_put_sbi(struct ntfs_sb_info *sbi) in ntfs3_put_sbi() argument
594 wnd_close(&sbi->mft.bitmap); in ntfs3_put_sbi()
595 wnd_close(&sbi->used.bitmap); in ntfs3_put_sbi()
597 if (sbi->mft.ni) { in ntfs3_put_sbi()
598 iput(&sbi->mft.ni->vfs_inode); in ntfs3_put_sbi()
599 sbi->mft.ni = NULL; in ntfs3_put_sbi()
602 if (sbi->security.ni) { in ntfs3_put_sbi()
603 iput(&sbi->security.ni->vfs_inode); in ntfs3_put_sbi()
604 sbi->security.ni = NULL; in ntfs3_put_sbi()
607 if (sbi->reparse.ni) { in ntfs3_put_sbi()
608 iput(&sbi->reparse.ni->vfs_inode); in ntfs3_put_sbi()
609 sbi->reparse.ni = NULL; in ntfs3_put_sbi()
612 if (sbi->objid.ni) { in ntfs3_put_sbi()
613 iput(&sbi->objid.ni->vfs_inode); in ntfs3_put_sbi()
614 sbi->objid.ni = NULL; in ntfs3_put_sbi()
617 if (sbi->volume.ni) { in ntfs3_put_sbi()
618 iput(&sbi->volume.ni->vfs_inode); in ntfs3_put_sbi()
619 sbi->volume.ni = NULL; in ntfs3_put_sbi()
622 ntfs_update_mftmirr(sbi, 0); in ntfs3_put_sbi()
624 indx_clear(&sbi->security.index_sii); in ntfs3_put_sbi()
625 indx_clear(&sbi->security.index_sdh); in ntfs3_put_sbi()
626 indx_clear(&sbi->reparse.index_r); in ntfs3_put_sbi()
627 indx_clear(&sbi->objid.index_o); in ntfs3_put_sbi()
630 static void ntfs3_free_sbi(struct ntfs_sb_info *sbi) in ntfs3_free_sbi() argument
632 kfree(sbi->new_rec); in ntfs3_free_sbi()
633 kvfree(ntfs_put_shared(sbi->upcase)); in ntfs3_free_sbi()
634 kvfree(sbi->def_table); in ntfs3_free_sbi()
635 kfree(sbi->compress.lznt); in ntfs3_free_sbi()
637 xpress_free_decompressor(sbi->compress.xpress); in ntfs3_free_sbi()
638 lzx_free_decompressor(sbi->compress.lzx); in ntfs3_free_sbi()
640 kfree(sbi); in ntfs3_free_sbi()
645 struct ntfs_sb_info *sbi = sb->s_fs_info; in ntfs_put_super() local
649 if (sbi->procdir) { in ntfs_put_super()
650 remove_proc_entry("label", sbi->procdir); in ntfs_put_super()
651 remove_proc_entry("volinfo", sbi->procdir); in ntfs_put_super()
653 sbi->procdir = NULL; in ntfs_put_super()
658 ntfs_set_state(sbi, NTFS_DIRTY_CLEAR); in ntfs_put_super()
659 ntfs3_put_sbi(sbi); in ntfs_put_super()
665 struct ntfs_sb_info *sbi = sb->s_fs_info; in ntfs_statfs() local
666 struct wnd_bitmap *wnd = &sbi->used.bitmap; in ntfs_statfs()
669 buf->f_bsize = sbi->cluster_size; in ntfs_statfs()
673 buf->f_fsid.val[0] = sbi->volume.ser_num; in ntfs_statfs()
674 buf->f_fsid.val[1] = (sbi->volume.ser_num >> 32); in ntfs_statfs()
683 struct ntfs_sb_info *sbi = sb->s_fs_info; in ntfs_show_options() local
684 struct ntfs_mount_options *opts = sbi->options; in ntfs_show_options()
737 struct ntfs_sb_info *sbi = sb->s_fs_info; in ntfs_sync_fs() local
744 ni = sbi->security.ni; in ntfs_sync_fs()
752 ni = sbi->objid.ni; in ntfs_sync_fs()
760 ni = sbi->reparse.ni; in ntfs_sync_fs()
769 ntfs_set_state(sbi, NTFS_DIRTY_CLEAR); in ntfs_sync_fs()
771 ntfs_update_mftmirr(sbi, wait); in ntfs_sync_fs()
877 struct ntfs_sb_info *sbi = sb->s_fs_info; in ntfs_init_from_boot() local
893 sbi->volume.blocks = dev_size >> PAGE_SHIFT; in ntfs_init_from_boot()
935 sbi->cluster_size = boot_sector_size * sct_per_clst; in ntfs_init_from_boot()
936 sbi->cluster_bits = cluster_bits = blksize_bits(sbi->cluster_size); in ntfs_init_from_boot()
937 sbi->cluster_mask = sbi->cluster_size - 1; in ntfs_init_from_boot()
938 sbi->cluster_mask_inv = ~(u64)sbi->cluster_mask; in ntfs_init_from_boot()
962 sbi->record_size = record_size; in ntfs_init_from_boot()
963 sbi->record_bits = blksize_bits(record_size); in ntfs_init_from_boot()
964 sbi->attr_size_tr = (5 * record_size >> 4); // ~320 bytes in ntfs_init_from_boot()
980 sbi->index_size = (u32)boot->index_size << cluster_bits; in ntfs_init_from_boot()
982 sbi->index_size = 1u << (-boot->index_size); in ntfs_init_from_boot()
990 if (sbi->index_size < SECTOR_SIZE || !is_power_of_2(sbi->index_size)) { in ntfs_init_from_boot()
992 sbi->index_size, boot->index_size); in ntfs_init_from_boot()
996 if (sbi->index_size > MAXIMUM_BYTES_PER_INDEX) { in ntfs_init_from_boot()
998 sbi->index_size); in ntfs_init_from_boot()
1002 sbi->volume.size = sectors * boot_sector_size; in ntfs_init_from_boot()
1004 gb = format_size_gb(sbi->volume.size + boot_sector_size, &mb); in ntfs_init_from_boot()
1019 sbi->mft.lbo = mlcn << cluster_bits; in ntfs_init_from_boot()
1020 sbi->mft.lbo2 = mlcn2 << cluster_bits; in ntfs_init_from_boot()
1023 if (sbi->cluster_size < boot_sector_size) { in ntfs_init_from_boot()
1025 sbi->cluster_size); in ntfs_init_from_boot()
1030 if (sbi->cluster_size < sector_size) { in ntfs_init_from_boot()
1035 sbi->cluster_size, sector_size); in ntfs_init_from_boot()
1039 sbi->max_bytes_per_attr = in ntfs_init_from_boot()
1044 sbi->volume.ser_num = le64_to_cpu(boot->serial_num); in ntfs_init_from_boot()
1047 if (dev_size < sbi->volume.size + boot_sector_size) { in ntfs_init_from_boot()
1058 clusters = sbi->volume.size >> cluster_bits; in ntfs_init_from_boot()
1072 sbi->used.bitmap.nbits = clusters; in ntfs_init_from_boot()
1080 sbi->new_rec = rec; in ntfs_init_from_boot()
1083 fn = (sbi->record_size >> SECTOR_SHIFT) + 1; in ntfs_init_from_boot()
1088 rec->total = cpu_to_le32(sbi->record_size); in ntfs_init_from_boot()
1091 sb_set_blocksize(sb, min_t(u32, sbi->cluster_size, PAGE_SIZE)); in ntfs_init_from_boot()
1093 sbi->block_mask = sb->s_blocksize - 1; in ntfs_init_from_boot()
1094 sbi->blocks_per_cluster = sbi->cluster_size >> sb->s_blocksize_bits; in ntfs_init_from_boot()
1095 sbi->volume.blocks = sbi->volume.size >> sb->s_blocksize_bits; in ntfs_init_from_boot()
1098 sbi->maxbytes = (clusters << cluster_bits) - 1; in ntfs_init_from_boot()
1102 sbi->maxbytes = -1; in ntfs_init_from_boot()
1103 sbi->maxbytes_sparse = -1; in ntfs_init_from_boot()
1107 sbi->maxbytes_sparse = (1ull << (cluster_bits + 32)) - 1; in ntfs_init_from_boot()
1116 sbi->zone_max = min_t(CLST, 0x20000000 >> cluster_bits, clusters >> 3); in ntfs_init_from_boot()
1158 struct ntfs_sb_info *sbi = sb->s_fs_info; in ntfs_fill_super() local
1176 sbi->sb = sb; in ntfs_fill_super()
1177 sbi->options = options = fc->fs_private; in ntfs_fill_super()
1196 sbi->discard_granularity = bdev_discard_granularity(bdev); in ntfs_fill_super()
1197 sbi->discard_granularity_mask_inv = in ntfs_fill_super()
1198 ~(u64)(sbi->discard_granularity - 1); in ntfs_fill_super()
1231 UTF16_LITTLE_ENDIAN, sbi->volume.label, in ntfs_fill_super()
1232 sizeof(sbi->volume.label)); in ntfs_fill_super()
1234 sbi->volume.label[0] = 0; in ntfs_fill_super()
1249 sbi->volume.major_ver = info->major_ver; in ntfs_fill_super()
1250 sbi->volume.minor_ver = info->minor_ver; in ntfs_fill_super()
1251 sbi->volume.flags = info->flags; in ntfs_fill_super()
1252 sbi->volume.ni = ni; in ntfs_fill_super()
1254 sbi->volume.real_dirty = true; in ntfs_fill_super()
1268 sbi->mft.recs_mirr = ntfs_up_cluster(sbi, inode->i_size) >> in ntfs_fill_super()
1269 sbi->record_bits; in ntfs_fill_super()
1285 err = ntfs_loadlog_and_replay(ni, sbi); in ntfs_fill_super()
1291 if ((sbi->flags & NTFS_FLAGS_NEED_REPLAY) && !ro) { in ntfs_fill_super()
1297 if ((sbi->volume.flags & VOLUME_FLAG_DIRTY) && !ro && !options->force) { in ntfs_fill_super()
1316 sbi->mft.used = ni->i_valid >> sbi->record_bits; in ntfs_fill_super()
1317 tt = inode->i_size >> sbi->record_bits; in ntfs_fill_super()
1318 sbi->mft.next_free = MFT_REC_USER; in ntfs_fill_super()
1320 err = wnd_init(&sbi->mft.bitmap, sb, tt); in ntfs_fill_super()
1330 sbi->mft.ni = ni; in ntfs_fill_super()
1350 tt = sbi->used.bitmap.nbits; in ntfs_fill_super()
1357 err = wnd_init(&sbi->used.bitmap, sb, tt); in ntfs_fill_super()
1366 err = ntfs_refresh_zone(sbi); in ntfs_fill_super()
1393 if (wnd_set_used_safe(&sbi->used.bitmap, lcn, len, &tt) || tt) { in ntfs_fill_super()
1395 ntfs_set_state(sbi, NTFS_DIRTY_ERROR); in ntfs_fill_super()
1433 sbi->def_table = t = kvmalloc(bytes, GFP_KERNEL); in ntfs_fill_super()
1440 err = inode_read_data(inode, sbi->def_table, bytes); in ntfs_fill_super()
1453 sbi->def_entries = 1; in ntfs_fill_super()
1464 sbi->reparse.max_size = sz; in ntfs_fill_super()
1466 sbi->ea_max_size = sz; in ntfs_fill_super()
1470 sbi->def_entries += 1; in ntfs_fill_super()
1491 err = inode_read_data(inode, sbi->upcase, 0x10000 * sizeof(short)); in ntfs_fill_super()
1499 u16 *dst = sbi->upcase; in ntfs_fill_super()
1506 shared = ntfs_set_shared(sbi->upcase, 0x10000 * sizeof(short)); in ntfs_fill_super()
1507 if (shared && sbi->upcase != shared) { in ntfs_fill_super()
1508 kvfree(sbi->upcase); in ntfs_fill_super()
1509 sbi->upcase = shared; in ntfs_fill_super()
1514 if (is_ntfs3(sbi)) { in ntfs_fill_super()
1516 err = ntfs_security_init(sbi); in ntfs_fill_super()
1523 err = ntfs_extend_init(sbi); in ntfs_fill_super()
1530 err = ntfs_reparse_init(sbi); in ntfs_fill_super()
1537 err = ntfs_objid_init(sbi); in ntfs_fill_super()
1603 sbi->procdir = e; in ntfs_fill_super()
1615 ntfs3_put_sbi(sbi); in ntfs_fill_super()
1617 ntfs3_put_sbi(sbi); in ntfs_fill_super()
1623 struct ntfs_sb_info *sbi = sb->s_fs_info; in ntfs_unmap_meta() local
1625 sector_t devblock = (u64)lcn * sbi->blocks_per_cluster; in ntfs_unmap_meta()
1626 unsigned long blocks = (u64)len * sbi->blocks_per_cluster; in ntfs_unmap_meta()
1650 int ntfs_discard(struct ntfs_sb_info *sbi, CLST lcn, CLST len) in ntfs_discard() argument
1656 if (sbi->used.next_free_lcn == lcn + len) in ntfs_discard()
1657 sbi->used.next_free_lcn = lcn; in ntfs_discard()
1659 if (sbi->flags & NTFS_FLAGS_NODISCARD) in ntfs_discard()
1662 if (!sbi->options->discard) in ntfs_discard()
1665 lbo = (u64)lcn << sbi->cluster_bits; in ntfs_discard()
1666 bytes = (u64)len << sbi->cluster_bits; in ntfs_discard()
1669 start = (lbo + sbi->discard_granularity - 1) & in ntfs_discard()
1670 sbi->discard_granularity_mask_inv; in ntfs_discard()
1672 end = (lbo + bytes) & sbi->discard_granularity_mask_inv; in ntfs_discard()
1674 sb = sbi->sb; in ntfs_discard()
1682 sbi->flags |= NTFS_FLAGS_NODISCARD; in ntfs_discard()
1701 struct ntfs_sb_info *sbi = fc->s_fs_info; in ntfs_fs_free() local
1703 if (sbi) { in ntfs_fs_free()
1704 ntfs3_put_sbi(sbi); in ntfs_fs_free()
1705 ntfs3_free_sbi(sbi); in ntfs_fs_free()
1730 struct ntfs_sb_info *sbi; in __ntfs_init_fs_context() local
1745 sbi = kzalloc(sizeof(struct ntfs_sb_info), GFP_NOFS); in __ntfs_init_fs_context()
1746 if (!sbi) in __ntfs_init_fs_context()
1749 sbi->upcase = kvmalloc(0x10000 * sizeof(short), GFP_KERNEL); in __ntfs_init_fs_context()
1750 if (!sbi->upcase) in __ntfs_init_fs_context()
1753 ratelimit_state_init(&sbi->msg_ratelimit, DEFAULT_RATELIMIT_INTERVAL, in __ntfs_init_fs_context()
1756 mutex_init(&sbi->compress.mtx_lznt); in __ntfs_init_fs_context()
1758 mutex_init(&sbi->compress.mtx_xpress); in __ntfs_init_fs_context()
1759 mutex_init(&sbi->compress.mtx_lzx); in __ntfs_init_fs_context()
1762 fc->s_fs_info = sbi; in __ntfs_init_fs_context()
1769 kfree(sbi); in __ntfs_init_fs_context()
1782 struct ntfs_sb_info *sbi = sb->s_fs_info; in ntfs3_kill_sb() local
1786 if (sbi->options) in ntfs3_kill_sb()
1787 put_mount_options(sbi->options); in ntfs3_kill_sb()
1788 ntfs3_free_sbi(sbi); in ntfs3_kill_sb()