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
413 if (ro_rw && (sbi->flags & NTFS_FLAGS_NEED_REPLAY)) { in ntfs_fs_reconfigure()
426 if (new_opts->nls != sbi->options->nls) in ntfs_fs_reconfigure()
433 if (ro_rw && (sbi->volume.flags & VOLUME_FLAG_DIRTY) && in ntfs_fs_reconfigure()
440 swap(sbi->options, fc->fs_private); in ntfs_fs_reconfigure()
464 struct ntfs_sb_info *sbi = sb->s_fs_info; in ntfs3_volinfo() local
467 sbi->volume.major_ver, sbi->volume.minor_ver, in ntfs3_volinfo()
468 sbi->cluster_size, sbi->used.bitmap.nbits, in ntfs3_volinfo()
469 sbi->mft.bitmap.nbits, in ntfs3_volinfo()
470 sbi->mft.bitmap.nbits - wnd_zeroes(&sbi->mft.bitmap), in ntfs3_volinfo()
471 sbi->volume.real_dirty ? "dirty" : "clean", in ntfs3_volinfo()
472 (sbi->volume.flags & VOLUME_FLAG_DIRTY) ? "dirty" : "clean"); in ntfs3_volinfo()
486 struct ntfs_sb_info *sbi = sb->s_fs_info; in ntfs3_label_show() local
488 seq_printf(m, "%s\n", sbi->volume.label); in ntfs3_label_show()
586 static noinline void ntfs3_put_sbi(struct ntfs_sb_info *sbi) in ntfs3_put_sbi() argument
588 wnd_close(&sbi->mft.bitmap); in ntfs3_put_sbi()
589 wnd_close(&sbi->used.bitmap); in ntfs3_put_sbi()
591 if (sbi->mft.ni) { in ntfs3_put_sbi()
592 iput(&sbi->mft.ni->vfs_inode); in ntfs3_put_sbi()
593 sbi->mft.ni = NULL; in ntfs3_put_sbi()
596 if (sbi->security.ni) { in ntfs3_put_sbi()
597 iput(&sbi->security.ni->vfs_inode); in ntfs3_put_sbi()
598 sbi->security.ni = NULL; in ntfs3_put_sbi()
601 if (sbi->reparse.ni) { in ntfs3_put_sbi()
602 iput(&sbi->reparse.ni->vfs_inode); in ntfs3_put_sbi()
603 sbi->reparse.ni = NULL; in ntfs3_put_sbi()
606 if (sbi->objid.ni) { in ntfs3_put_sbi()
607 iput(&sbi->objid.ni->vfs_inode); in ntfs3_put_sbi()
608 sbi->objid.ni = NULL; in ntfs3_put_sbi()
611 if (sbi->volume.ni) { in ntfs3_put_sbi()
612 iput(&sbi->volume.ni->vfs_inode); in ntfs3_put_sbi()
613 sbi->volume.ni = NULL; in ntfs3_put_sbi()
616 ntfs_update_mftmirr(sbi, 0); in ntfs3_put_sbi()
618 indx_clear(&sbi->security.index_sii); in ntfs3_put_sbi()
619 indx_clear(&sbi->security.index_sdh); in ntfs3_put_sbi()
620 indx_clear(&sbi->reparse.index_r); in ntfs3_put_sbi()
621 indx_clear(&sbi->objid.index_o); in ntfs3_put_sbi()
624 static void ntfs3_free_sbi(struct ntfs_sb_info *sbi) in ntfs3_free_sbi() argument
626 kfree(sbi->new_rec); in ntfs3_free_sbi()
627 kvfree(ntfs_put_shared(sbi->upcase)); in ntfs3_free_sbi()
628 kfree(sbi->def_table); in ntfs3_free_sbi()
629 kfree(sbi->compress.lznt); in ntfs3_free_sbi()
631 xpress_free_decompressor(sbi->compress.xpress); in ntfs3_free_sbi()
632 lzx_free_decompressor(sbi->compress.lzx); in ntfs3_free_sbi()
634 kfree(sbi); in ntfs3_free_sbi()
639 struct ntfs_sb_info *sbi = sb->s_fs_info; in ntfs_put_super() local
643 if (sbi->procdir) { in ntfs_put_super()
644 remove_proc_entry("label", sbi->procdir); in ntfs_put_super()
645 remove_proc_entry("volinfo", sbi->procdir); in ntfs_put_super()
647 sbi->procdir = NULL; in ntfs_put_super()
652 ntfs_set_state(sbi, NTFS_DIRTY_CLEAR); in ntfs_put_super()
653 ntfs3_put_sbi(sbi); in ntfs_put_super()
659 struct ntfs_sb_info *sbi = sb->s_fs_info; in ntfs_statfs() local
660 struct wnd_bitmap *wnd = &sbi->used.bitmap; in ntfs_statfs()
663 buf->f_bsize = sbi->cluster_size; in ntfs_statfs()
667 buf->f_fsid.val[0] = sbi->volume.ser_num; in ntfs_statfs()
668 buf->f_fsid.val[1] = (sbi->volume.ser_num >> 32); in ntfs_statfs()
677 struct ntfs_sb_info *sbi = sb->s_fs_info; in ntfs_show_options() local
678 struct ntfs_mount_options *opts = sbi->options; in ntfs_show_options()
723 struct ntfs_sb_info *sbi = sb->s_fs_info; in ntfs_sync_fs() local
727 ni = sbi->security.ni; in ntfs_sync_fs()
735 ni = sbi->objid.ni; in ntfs_sync_fs()
743 ni = sbi->reparse.ni; in ntfs_sync_fs()
752 ntfs_set_state(sbi, NTFS_DIRTY_CLEAR); in ntfs_sync_fs()
754 ntfs_update_mftmirr(sbi, wait); in ntfs_sync_fs()
858 struct ntfs_sb_info *sbi = sb->s_fs_info; in ntfs_init_from_boot() local
873 sbi->volume.blocks = dev_size >> PAGE_SHIFT; in ntfs_init_from_boot()
915 sbi->cluster_size = boot_sector_size * sct_per_clst; in ntfs_init_from_boot()
916 sbi->cluster_bits = cluster_bits = blksize_bits(sbi->cluster_size); in ntfs_init_from_boot()
917 sbi->cluster_mask = sbi->cluster_size - 1; in ntfs_init_from_boot()
918 sbi->cluster_mask_inv = ~(u64)sbi->cluster_mask; in ntfs_init_from_boot()
942 sbi->record_size = record_size; in ntfs_init_from_boot()
943 sbi->record_bits = blksize_bits(record_size); in ntfs_init_from_boot()
944 sbi->attr_size_tr = (5 * record_size >> 4); // ~320 bytes in ntfs_init_from_boot()
960 sbi->index_size = (u32)boot->index_size << cluster_bits; in ntfs_init_from_boot()
962 sbi->index_size = 1u << (-boot->index_size); in ntfs_init_from_boot()
970 if (sbi->index_size < SECTOR_SIZE || !is_power_of_2(sbi->index_size)) { in ntfs_init_from_boot()
972 sbi->index_size, boot->index_size); in ntfs_init_from_boot()
976 if (sbi->index_size > MAXIMUM_BYTES_PER_INDEX) { in ntfs_init_from_boot()
978 sbi->index_size); in ntfs_init_from_boot()
982 sbi->volume.size = sectors * boot_sector_size; in ntfs_init_from_boot()
984 gb = format_size_gb(sbi->volume.size + boot_sector_size, &mb); in ntfs_init_from_boot()
999 sbi->mft.lbo = mlcn << cluster_bits; in ntfs_init_from_boot()
1000 sbi->mft.lbo2 = mlcn2 << cluster_bits; in ntfs_init_from_boot()
1003 if (sbi->cluster_size < boot_sector_size) { in ntfs_init_from_boot()
1005 sbi->cluster_size); in ntfs_init_from_boot()
1010 if (sbi->cluster_size < sector_size) { in ntfs_init_from_boot()
1015 sbi->cluster_size, sector_size); in ntfs_init_from_boot()
1019 sbi->max_bytes_per_attr = in ntfs_init_from_boot()
1024 sbi->volume.ser_num = le64_to_cpu(boot->serial_num); in ntfs_init_from_boot()
1027 if (dev_size < sbi->volume.size + boot_sector_size) { in ntfs_init_from_boot()
1038 clusters = sbi->volume.size >> cluster_bits; in ntfs_init_from_boot()
1052 sbi->used.bitmap.nbits = clusters; in ntfs_init_from_boot()
1060 sbi->new_rec = rec; in ntfs_init_from_boot()
1063 fn = (sbi->record_size >> SECTOR_SHIFT) + 1; in ntfs_init_from_boot()
1068 rec->total = cpu_to_le32(sbi->record_size); in ntfs_init_from_boot()
1071 sb_set_blocksize(sb, min_t(u32, sbi->cluster_size, PAGE_SIZE)); in ntfs_init_from_boot()
1073 sbi->block_mask = sb->s_blocksize - 1; in ntfs_init_from_boot()
1074 sbi->blocks_per_cluster = sbi->cluster_size >> sb->s_blocksize_bits; in ntfs_init_from_boot()
1075 sbi->volume.blocks = sbi->volume.size >> sb->s_blocksize_bits; in ntfs_init_from_boot()
1078 sbi->maxbytes = (clusters << cluster_bits) - 1; in ntfs_init_from_boot()
1082 sbi->maxbytes = -1; in ntfs_init_from_boot()
1083 sbi->maxbytes_sparse = -1; in ntfs_init_from_boot()
1087 sbi->maxbytes_sparse = (1ull << (cluster_bits + 32)) - 1; in ntfs_init_from_boot()
1096 sbi->zone_max = min_t(CLST, 0x20000000 >> cluster_bits, clusters >> 3); in ntfs_init_from_boot()
1140 struct ntfs_sb_info *sbi = sb->s_fs_info; in ntfs_fill_super() local
1158 sbi->sb = sb; in ntfs_fill_super()
1159 sbi->options = options = fc->fs_private; in ntfs_fill_super()
1178 sbi->discard_granularity = bdev_discard_granularity(bdev); in ntfs_fill_super()
1179 sbi->discard_granularity_mask_inv = in ntfs_fill_super()
1180 ~(u64)(sbi->discard_granularity - 1); in ntfs_fill_super()
1213 UTF16_LITTLE_ENDIAN, sbi->volume.label, in ntfs_fill_super()
1214 sizeof(sbi->volume.label)); in ntfs_fill_super()
1216 sbi->volume.label[0] = 0; in ntfs_fill_super()
1231 sbi->volume.major_ver = info->major_ver; in ntfs_fill_super()
1232 sbi->volume.minor_ver = info->minor_ver; in ntfs_fill_super()
1233 sbi->volume.flags = info->flags; in ntfs_fill_super()
1234 sbi->volume.ni = ni; in ntfs_fill_super()
1236 sbi->volume.real_dirty = true; in ntfs_fill_super()
1250 sbi->mft.recs_mirr = ntfs_up_cluster(sbi, inode->i_size) >> in ntfs_fill_super()
1251 sbi->record_bits; in ntfs_fill_super()
1267 err = ntfs_loadlog_and_replay(ni, sbi); in ntfs_fill_super()
1273 if ((sbi->flags & NTFS_FLAGS_NEED_REPLAY) && !ro) { in ntfs_fill_super()
1279 if ((sbi->volume.flags & VOLUME_FLAG_DIRTY) && !ro && !options->force) { in ntfs_fill_super()
1298 sbi->mft.used = ni->i_valid >> sbi->record_bits; in ntfs_fill_super()
1299 tt = inode->i_size >> sbi->record_bits; in ntfs_fill_super()
1300 sbi->mft.next_free = MFT_REC_USER; in ntfs_fill_super()
1302 err = wnd_init(&sbi->mft.bitmap, sb, tt); in ntfs_fill_super()
1312 sbi->mft.ni = ni; in ntfs_fill_super()
1332 tt = sbi->used.bitmap.nbits; in ntfs_fill_super()
1339 err = wnd_init(&sbi->used.bitmap, sb, tt); in ntfs_fill_super()
1348 err = ntfs_refresh_zone(sbi); in ntfs_fill_super()
1375 if (wnd_set_used_safe(&sbi->used.bitmap, lcn, len, &tt) || tt) { in ntfs_fill_super()
1377 ntfs_set_state(sbi, NTFS_DIRTY_ERROR); in ntfs_fill_super()
1415 sbi->def_table = t = kvmalloc(bytes, GFP_KERNEL); in ntfs_fill_super()
1442 sbi->def_entries = 1; in ntfs_fill_super()
1444 sbi->reparse.max_size = MAXIMUM_REPARSE_DATA_BUFFER_SIZE; in ntfs_fill_super()
1445 sbi->ea_max_size = 0x10000; /* default formatter value */ in ntfs_fill_super()
1455 sbi->reparse.max_size = sz; in ntfs_fill_super()
1457 sbi->ea_max_size = sz; in ntfs_fill_super()
1461 sbi->def_entries += 1; in ntfs_fill_super()
1483 u16 *dst = Add2Ptr(sbi->upcase, idx << PAGE_SHIFT); in ntfs_fill_super()
1503 shared = ntfs_set_shared(sbi->upcase, 0x10000 * sizeof(short)); in ntfs_fill_super()
1504 if (shared && sbi->upcase != shared) { in ntfs_fill_super()
1505 kvfree(sbi->upcase); in ntfs_fill_super()
1506 sbi->upcase = shared; in ntfs_fill_super()
1511 if (is_ntfs3(sbi)) { in ntfs_fill_super()
1513 err = ntfs_security_init(sbi); in ntfs_fill_super()
1520 err = ntfs_extend_init(sbi); in ntfs_fill_super()
1527 err = ntfs_reparse_init(sbi); in ntfs_fill_super()
1534 err = ntfs_objid_init(sbi); in ntfs_fill_super()
1600 sbi->procdir = e; in ntfs_fill_super()
1610 ntfs3_put_sbi(sbi); in ntfs_fill_super()
1612 ntfs3_put_sbi(sbi); in ntfs_fill_super()
1618 struct ntfs_sb_info *sbi = sb->s_fs_info; in ntfs_unmap_meta() local
1620 sector_t devblock = (u64)lcn * sbi->blocks_per_cluster; in ntfs_unmap_meta()
1621 unsigned long blocks = (u64)len * sbi->blocks_per_cluster; in ntfs_unmap_meta()
1645 int ntfs_discard(struct ntfs_sb_info *sbi, CLST lcn, CLST len) in ntfs_discard() argument
1651 if (sbi->used.next_free_lcn == lcn + len) in ntfs_discard()
1652 sbi->used.next_free_lcn = lcn; in ntfs_discard()
1654 if (sbi->flags & NTFS_FLAGS_NODISCARD) in ntfs_discard()
1657 if (!sbi->options->discard) in ntfs_discard()
1660 lbo = (u64)lcn << sbi->cluster_bits; in ntfs_discard()
1661 bytes = (u64)len << sbi->cluster_bits; in ntfs_discard()
1664 start = (lbo + sbi->discard_granularity - 1) & in ntfs_discard()
1665 sbi->discard_granularity_mask_inv; in ntfs_discard()
1667 end = (lbo + bytes) & sbi->discard_granularity_mask_inv; in ntfs_discard()
1669 sb = sbi->sb; in ntfs_discard()
1677 sbi->flags |= NTFS_FLAGS_NODISCARD; in ntfs_discard()
1696 struct ntfs_sb_info *sbi = fc->s_fs_info; in ntfs_fs_free() local
1698 if (sbi) { in ntfs_fs_free()
1699 ntfs3_put_sbi(sbi); in ntfs_fs_free()
1700 ntfs3_free_sbi(sbi); in ntfs_fs_free()
1725 struct ntfs_sb_info *sbi; in ntfs_init_fs_context() local
1740 sbi = kzalloc(sizeof(struct ntfs_sb_info), GFP_NOFS); in ntfs_init_fs_context()
1741 if (!sbi) in ntfs_init_fs_context()
1744 sbi->upcase = kvmalloc(0x10000 * sizeof(short), GFP_KERNEL); in ntfs_init_fs_context()
1745 if (!sbi->upcase) in ntfs_init_fs_context()
1748 ratelimit_state_init(&sbi->msg_ratelimit, DEFAULT_RATELIMIT_INTERVAL, in ntfs_init_fs_context()
1751 mutex_init(&sbi->compress.mtx_lznt); in ntfs_init_fs_context()
1753 mutex_init(&sbi->compress.mtx_xpress); in ntfs_init_fs_context()
1754 mutex_init(&sbi->compress.mtx_lzx); in ntfs_init_fs_context()
1757 fc->s_fs_info = sbi; in ntfs_init_fs_context()
1764 kfree(sbi); in ntfs_init_fs_context()
1772 struct ntfs_sb_info *sbi = sb->s_fs_info; in ntfs3_kill_sb() local
1776 if (sbi->options) in ntfs3_kill_sb()
1777 put_mount_options(sbi->options); in ntfs3_kill_sb()
1778 ntfs3_free_sbi(sbi); in ntfs3_kill_sb()