Lines Matching full: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()
567 struct ntfs_sb_info *sbi = sb->s_fs_info; in ntfs_create_procdir() local
573 sbi->procdir = e; in ntfs_create_procdir()
579 struct ntfs_sb_info *sbi = sb->s_fs_info; in ntfs_remove_procdir() local
581 if (!sbi->procdir) in ntfs_remove_procdir()
584 remove_proc_entry("label", sbi->procdir); in ntfs_remove_procdir()
585 remove_proc_entry("volinfo", sbi->procdir); in ntfs_remove_procdir()
587 sbi->procdir = NULL; in ntfs_remove_procdir()
641 static noinline void ntfs3_put_sbi(struct ntfs_sb_info *sbi) in ntfs3_put_sbi() argument
643 wnd_close(&sbi->mft.bitmap); in ntfs3_put_sbi()
644 wnd_close(&sbi->used.bitmap); in ntfs3_put_sbi()
646 if (sbi->mft.ni) { in ntfs3_put_sbi()
647 iput(&sbi->mft.ni->vfs_inode); in ntfs3_put_sbi()
648 sbi->mft.ni = NULL; in ntfs3_put_sbi()
651 if (sbi->security.ni) { in ntfs3_put_sbi()
652 iput(&sbi->security.ni->vfs_inode); in ntfs3_put_sbi()
653 sbi->security.ni = NULL; in ntfs3_put_sbi()
656 if (sbi->reparse.ni) { in ntfs3_put_sbi()
657 iput(&sbi->reparse.ni->vfs_inode); in ntfs3_put_sbi()
658 sbi->reparse.ni = NULL; in ntfs3_put_sbi()
661 if (sbi->objid.ni) { in ntfs3_put_sbi()
662 iput(&sbi->objid.ni->vfs_inode); in ntfs3_put_sbi()
663 sbi->objid.ni = NULL; in ntfs3_put_sbi()
666 if (sbi->volume.ni) { in ntfs3_put_sbi()
667 iput(&sbi->volume.ni->vfs_inode); in ntfs3_put_sbi()
668 sbi->volume.ni = NULL; in ntfs3_put_sbi()
671 ntfs_update_mftmirr(sbi, 0); in ntfs3_put_sbi()
673 indx_clear(&sbi->security.index_sii); in ntfs3_put_sbi()
674 indx_clear(&sbi->security.index_sdh); in ntfs3_put_sbi()
675 indx_clear(&sbi->reparse.index_r); in ntfs3_put_sbi()
676 indx_clear(&sbi->objid.index_o); in ntfs3_put_sbi()
679 static void ntfs3_free_sbi(struct ntfs_sb_info *sbi) in ntfs3_free_sbi() argument
681 kfree(sbi->new_rec); in ntfs3_free_sbi()
682 kvfree(ntfs_put_shared(sbi->upcase)); in ntfs3_free_sbi()
683 kvfree(sbi->def_table); in ntfs3_free_sbi()
684 kfree(sbi->compress.lznt); in ntfs3_free_sbi()
686 xpress_free_decompressor(sbi->compress.xpress); in ntfs3_free_sbi()
687 lzx_free_decompressor(sbi->compress.lzx); in ntfs3_free_sbi()
689 kfree(sbi); in ntfs3_free_sbi()
694 struct ntfs_sb_info *sbi = sb->s_fs_info; in ntfs_put_super() local
699 ntfs_set_state(sbi, NTFS_DIRTY_CLEAR); in ntfs_put_super()
700 ntfs3_put_sbi(sbi); in ntfs_put_super()
706 struct ntfs_sb_info *sbi = sb->s_fs_info; in ntfs_statfs() local
707 struct wnd_bitmap *wnd = &sbi->used.bitmap; in ntfs_statfs()
710 buf->f_bsize = sbi->cluster_size; in ntfs_statfs()
714 buf->f_fsid.val[0] = sbi->volume.ser_num; in ntfs_statfs()
715 buf->f_fsid.val[1] = (sbi->volume.ser_num >> 32); in ntfs_statfs()
724 struct ntfs_sb_info *sbi = sb->s_fs_info; in ntfs_show_options() local
725 struct ntfs_mount_options *opts = sbi->options; in ntfs_show_options()
778 struct ntfs_sb_info *sbi = sb->s_fs_info; in ntfs_sync_fs() local
785 ni = sbi->security.ni; in ntfs_sync_fs()
793 ni = sbi->objid.ni; in ntfs_sync_fs()
801 ni = sbi->reparse.ni; in ntfs_sync_fs()
810 ntfs_set_state(sbi, NTFS_DIRTY_CLEAR); in ntfs_sync_fs()
812 ntfs_update_mftmirr(sbi, wait); in ntfs_sync_fs()
918 struct ntfs_sb_info *sbi = sb->s_fs_info; in ntfs_init_from_boot() local
934 sbi->volume.blocks = dev_size >> PAGE_SHIFT; in ntfs_init_from_boot()
976 sbi->cluster_size = boot_sector_size * sct_per_clst; in ntfs_init_from_boot()
977 sbi->cluster_bits = cluster_bits = blksize_bits(sbi->cluster_size); in ntfs_init_from_boot()
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()
1003 sbi->record_size = record_size; in ntfs_init_from_boot()
1004 sbi->record_bits = blksize_bits(record_size); in ntfs_init_from_boot()
1005 sbi->attr_size_tr = (5 * record_size >> 4); // ~320 bytes in ntfs_init_from_boot()
1021 sbi->index_size = (u32)boot->index_size << cluster_bits; in ntfs_init_from_boot()
1023 sbi->index_size = 1u << (-boot->index_size); in ntfs_init_from_boot()
1031 if (sbi->index_size < SECTOR_SIZE || !is_power_of_2(sbi->index_size)) { in ntfs_init_from_boot()
1033 sbi->index_size, boot->index_size); in ntfs_init_from_boot()
1037 if (sbi->index_size > MAXIMUM_BYTES_PER_INDEX) { in ntfs_init_from_boot()
1039 sbi->index_size); in ntfs_init_from_boot()
1043 sbi->volume.size = sectors * boot_sector_size; in ntfs_init_from_boot()
1045 gb = format_size_gb(sbi->volume.size + boot_sector_size, &mb); in ntfs_init_from_boot()
1060 sbi->mft.lbo = mlcn << cluster_bits; in ntfs_init_from_boot()
1061 sbi->mft.lbo2 = mlcn2 << cluster_bits; in ntfs_init_from_boot()
1064 if (sbi->cluster_size < boot_sector_size) { in ntfs_init_from_boot()
1066 sbi->cluster_size); in ntfs_init_from_boot()
1071 if (sbi->cluster_size < sector_size) { in ntfs_init_from_boot()
1076 sbi->cluster_size, sector_size); in ntfs_init_from_boot()
1080 sbi->max_bytes_per_attr = in ntfs_init_from_boot()
1085 sbi->volume.ser_num = le64_to_cpu(boot->serial_num); in ntfs_init_from_boot()
1088 if (dev_size < sbi->volume.size + boot_sector_size) { in ntfs_init_from_boot()
1099 clusters = sbi->volume.size >> cluster_bits; in ntfs_init_from_boot()
1113 sbi->used.bitmap.nbits = clusters; in ntfs_init_from_boot()
1121 sbi->new_rec = rec; in ntfs_init_from_boot()
1124 fn = (sbi->record_size >> SECTOR_SHIFT) + 1; in ntfs_init_from_boot()
1129 rec->total = cpu_to_le32(sbi->record_size); in ntfs_init_from_boot()
1132 sb_set_blocksize(sb, min_t(u32, sbi->cluster_size, PAGE_SIZE)); in ntfs_init_from_boot()
1134 sbi->block_mask = sb->s_blocksize - 1; in ntfs_init_from_boot()
1135 sbi->blocks_per_cluster = sbi->cluster_size >> sb->s_blocksize_bits; in ntfs_init_from_boot()
1136 sbi->volume.blocks = sbi->volume.size >> sb->s_blocksize_bits; in ntfs_init_from_boot()
1139 sbi->maxbytes = (clusters << cluster_bits) - 1; in ntfs_init_from_boot()
1143 sbi->maxbytes = -1; in ntfs_init_from_boot()
1144 sbi->maxbytes_sparse = -1; in ntfs_init_from_boot()
1148 sbi->maxbytes_sparse = (1ull << (cluster_bits + 32)) - 1; in ntfs_init_from_boot()
1157 sbi->zone_max = min_t(CLST, 0x20000000 >> cluster_bits, clusters >> 3); in ntfs_init_from_boot()
1199 struct ntfs_sb_info *sbi = sb->s_fs_info; in ntfs_fill_super() local
1217 sbi->sb = sb; in ntfs_fill_super()
1218 sbi->options = options = fc->fs_private; in ntfs_fill_super()
1238 sbi->discard_granularity = bdev_discard_granularity(bdev); in ntfs_fill_super()
1239 sbi->discard_granularity_mask_inv = in ntfs_fill_super()
1240 ~(u64)(sbi->discard_granularity - 1); in ntfs_fill_super()
1251 * 'cause 'sbi->volume.ni' is used in 'ntfs_set_state'. in ntfs_fill_super()
1273 UTF16_LITTLE_ENDIAN, sbi->volume.label, in ntfs_fill_super()
1274 sizeof(sbi->volume.label)); in ntfs_fill_super()
1276 sbi->volume.label[0] = 0; in ntfs_fill_super()
1291 sbi->volume.major_ver = info->major_ver; in ntfs_fill_super()
1292 sbi->volume.minor_ver = info->minor_ver; in ntfs_fill_super()
1293 sbi->volume.flags = info->flags; in ntfs_fill_super()
1294 sbi->volume.ni = ni; in ntfs_fill_super()
1296 sbi->volume.real_dirty = true; in ntfs_fill_super()
1310 sbi->mft.recs_mirr = ntfs_up_cluster(sbi, inode->i_size) >> in ntfs_fill_super()
1311 sbi->record_bits; in ntfs_fill_super()
1327 err = ntfs_loadlog_and_replay(ni, sbi); in ntfs_fill_super()
1333 if ((sbi->flags & NTFS_FLAGS_NEED_REPLAY) && !ro) { in ntfs_fill_super()
1339 if ((sbi->volume.flags & VOLUME_FLAG_DIRTY) && !ro && !options->force) { in ntfs_fill_super()
1358 sbi->mft.used = ni->i_valid >> sbi->record_bits; in ntfs_fill_super()
1359 tt = inode->i_size >> sbi->record_bits; in ntfs_fill_super()
1360 sbi->mft.next_free = MFT_REC_USER; in ntfs_fill_super()
1362 err = wnd_init(&sbi->mft.bitmap, sb, tt); in ntfs_fill_super()
1372 sbi->mft.ni = ni; in ntfs_fill_super()
1392 tt = sbi->used.bitmap.nbits; in ntfs_fill_super()
1399 err = wnd_init(&sbi->used.bitmap, sb, tt); in ntfs_fill_super()
1408 err = ntfs_refresh_zone(sbi); in ntfs_fill_super()
1435 if (wnd_set_used_safe(&sbi->used.bitmap, lcn, len, &tt) || tt) { in ntfs_fill_super()
1437 ntfs_set_state(sbi, NTFS_DIRTY_ERROR); in ntfs_fill_super()
1475 sbi->def_table = t = kvmalloc(bytes, GFP_KERNEL); in ntfs_fill_super()
1482 err = inode_read_data(inode, sbi->def_table, bytes); in ntfs_fill_super()
1495 sbi->def_entries = 1; in ntfs_fill_super()
1506 sbi->reparse.max_size = sz; in ntfs_fill_super()
1508 sbi->ea_max_size = sz; in ntfs_fill_super()
1512 sbi->def_entries += 1; in ntfs_fill_super()
1533 err = inode_read_data(inode, sbi->upcase, 0x10000 * sizeof(short)); in ntfs_fill_super()
1541 u16 *dst = sbi->upcase; in ntfs_fill_super()
1548 shared = ntfs_set_shared(sbi->upcase, 0x10000 * sizeof(short)); in ntfs_fill_super()
1549 if (shared && sbi->upcase != shared) { in ntfs_fill_super()
1550 kvfree(sbi->upcase); in ntfs_fill_super()
1551 sbi->upcase = shared; in ntfs_fill_super()
1556 if (is_ntfs3(sbi)) { in ntfs_fill_super()
1558 err = ntfs_security_init(sbi); in ntfs_fill_super()
1565 err = ntfs_extend_init(sbi); in ntfs_fill_super()
1572 err = ntfs_reparse_init(sbi); in ntfs_fill_super()
1579 err = ntfs_objid_init(sbi); in ntfs_fill_super()
1644 ntfs3_put_sbi(sbi); in ntfs_fill_super()
1646 ntfs3_put_sbi(sbi); in ntfs_fill_super()
1652 struct ntfs_sb_info *sbi = sb->s_fs_info; in ntfs_unmap_meta() local
1654 sector_t devblock = (u64)lcn * sbi->blocks_per_cluster; in ntfs_unmap_meta()
1655 unsigned long blocks = (u64)len * sbi->blocks_per_cluster; in ntfs_unmap_meta()
1679 int ntfs_discard(struct ntfs_sb_info *sbi, CLST lcn, CLST len) in ntfs_discard() argument
1685 if (sbi->used.next_free_lcn == lcn + len) in ntfs_discard()
1686 sbi->used.next_free_lcn = lcn; in ntfs_discard()
1688 if (sbi->flags & NTFS_FLAGS_NODISCARD) in ntfs_discard()
1691 if (!sbi->options->discard) in ntfs_discard()
1694 lbo = (u64)lcn << sbi->cluster_bits; in ntfs_discard()
1695 bytes = (u64)len << sbi->cluster_bits; in ntfs_discard()
1698 start = (lbo + sbi->discard_granularity - 1) & in ntfs_discard()
1699 sbi->discard_granularity_mask_inv; in ntfs_discard()
1701 end = (lbo + bytes) & sbi->discard_granularity_mask_inv; in ntfs_discard()
1703 sb = sbi->sb; in ntfs_discard()
1711 sbi->flags |= NTFS_FLAGS_NODISCARD; in ntfs_discard()
1730 struct ntfs_sb_info *sbi = fc->s_fs_info; in ntfs_fs_free() local
1732 if (sbi) { in ntfs_fs_free()
1733 ntfs3_put_sbi(sbi); in ntfs_fs_free()
1734 ntfs3_free_sbi(sbi); in ntfs_fs_free()
1751 * ntfs_init_fs_context - Initialize sbi and opts
1759 struct ntfs_sb_info *sbi; in __ntfs_init_fs_context() local
1774 sbi = kzalloc(sizeof(struct ntfs_sb_info), GFP_NOFS); in __ntfs_init_fs_context()
1775 if (!sbi) in __ntfs_init_fs_context()
1778 sbi->upcase = kvmalloc(0x10000 * sizeof(short), GFP_KERNEL); in __ntfs_init_fs_context()
1779 if (!sbi->upcase) in __ntfs_init_fs_context()
1782 ratelimit_state_init(&sbi->msg_ratelimit, DEFAULT_RATELIMIT_INTERVAL, in __ntfs_init_fs_context()
1785 mutex_init(&sbi->compress.mtx_lznt); in __ntfs_init_fs_context()
1787 mutex_init(&sbi->compress.mtx_xpress); in __ntfs_init_fs_context()
1788 mutex_init(&sbi->compress.mtx_lzx); in __ntfs_init_fs_context()
1791 fc->s_fs_info = sbi; in __ntfs_init_fs_context()
1798 kfree(sbi); in __ntfs_init_fs_context()
1811 struct ntfs_sb_info *sbi = sb->s_fs_info; in ntfs3_kill_sb() local
1815 if (sbi->options) in ntfs3_kill_sb()
1816 put_mount_options(sbi->options); in ntfs3_kill_sb()
1817 ntfs3_free_sbi(sbi); in ntfs3_kill_sb()