• Home
  • Raw
  • Download

Lines Matching refs:sbi

62 	struct msdos_sb_info *sbi = MSDOS_SB(sb);  in __fat_get_block()  local
84 offset = (unsigned long)iblock & (sbi->sec_per_clus - 1); in __fat_get_block()
92 mapped_blocks = sbi->sec_per_clus - offset; in __fat_get_block()
250 struct msdos_sb_info *sbi = MSDOS_SB(sb); in fat_hash_init() local
253 spin_lock_init(&sbi->inode_hash_lock); in fat_hash_init()
255 INIT_HLIST_HEAD(&sbi->inode_hashtable[i]); in fat_hash_init()
265 struct msdos_sb_info *sbi = MSDOS_SB(inode->i_sb); in fat_attach() local
266 struct hlist_head *head = sbi->inode_hashtable + fat_hash(i_pos); in fat_attach()
268 spin_lock(&sbi->inode_hash_lock); in fat_attach()
271 spin_unlock(&sbi->inode_hash_lock); in fat_attach()
277 struct msdos_sb_info *sbi = MSDOS_SB(inode->i_sb); in fat_detach() local
278 spin_lock(&sbi->inode_hash_lock); in fat_detach()
281 spin_unlock(&sbi->inode_hash_lock); in fat_detach()
287 struct msdos_sb_info *sbi = MSDOS_SB(sb); in fat_iget() local
288 struct hlist_head *head = sbi->inode_hashtable + fat_hash(i_pos); in fat_iget()
293 spin_lock(&sbi->inode_hash_lock); in fat_iget()
302 spin_unlock(&sbi->inode_hash_lock); in fat_iget()
318 struct msdos_sb_info *sbi = MSDOS_SB(inode->i_sb); in fat_calc_dir_size() local
328 inode->i_size = (fclus + 1) << sbi->cluster_bits; in fat_calc_dir_size()
336 struct msdos_sb_info *sbi = MSDOS_SB(inode->i_sb); in fat_fill_inode() local
340 inode->i_uid = sbi->options.fs_uid; in fat_fill_inode()
341 inode->i_gid = sbi->options.fs_gid; in fat_fill_inode()
347 inode->i_mode = fat_make_mode(sbi, de->attr, S_IRWXUGO); in fat_fill_inode()
348 inode->i_op = sbi->dir_ops; in fat_fill_inode()
352 if (sbi->fat_bits == 32) in fat_fill_inode()
364 inode->i_mode = fat_make_mode(sbi, de->attr, in fat_fill_inode()
365 ((sbi->options.showexec && !is_exec(de->name + 8)) in fat_fill_inode()
368 if (sbi->fat_bits == 32) in fat_fill_inode()
379 if (sbi->options.sys_immutable) in fat_fill_inode()
384 inode->i_blocks = ((inode->i_size + (sbi->cluster_size - 1)) in fat_fill_inode()
385 & ~((loff_t)sbi->cluster_size - 1)) >> 9; in fat_fill_inode()
387 fat_time_fat2unix(sbi, &inode->i_mtime, de->time, de->date, 0); in fat_fill_inode()
388 if (sbi->options.isvfat) { in fat_fill_inode()
389 fat_time_fat2unix(sbi, &inode->i_ctime, de->ctime, in fat_fill_inode()
391 fat_time_fat2unix(sbi, &inode->i_atime, 0, de->adate, 0); in fat_fill_inode()
452 struct msdos_sb_info *sbi = MSDOS_SB(sb); in fat_put_super() local
454 if (sbi->nls_disk) { in fat_put_super()
455 unload_nls(sbi->nls_disk); in fat_put_super()
456 sbi->nls_disk = NULL; in fat_put_super()
457 sbi->options.codepage = fat_default_codepage; in fat_put_super()
459 if (sbi->nls_io) { in fat_put_super()
460 unload_nls(sbi->nls_io); in fat_put_super()
461 sbi->nls_io = NULL; in fat_put_super()
463 if (sbi->options.iocharset != fat_default_iocharset) { in fat_put_super()
464 kfree(sbi->options.iocharset); in fat_put_super()
465 sbi->options.iocharset = fat_default_iocharset; in fat_put_super()
469 kfree(sbi); in fat_put_super()
519 struct msdos_sb_info *sbi = MSDOS_SB(sb); in fat_remount() local
520 *flags |= MS_NODIRATIME | (sbi->options.isvfat ? 0 : MS_NOATIME); in fat_remount()
526 struct msdos_sb_info *sbi = MSDOS_SB(dentry->d_sb); in fat_statfs() local
529 if (sbi->free_clusters == -1 || !sbi->free_clus_valid) { in fat_statfs()
536 buf->f_bsize = sbi->cluster_size; in fat_statfs()
537 buf->f_blocks = sbi->max_cluster - FAT_START_ENT; in fat_statfs()
538 buf->f_bfree = sbi->free_clusters; in fat_statfs()
539 buf->f_bavail = sbi->free_clusters; in fat_statfs()
540 buf->f_namelen = sbi->options.isvfat ? 260 : 12; in fat_statfs()
545 static inline loff_t fat_i_pos_read(struct msdos_sb_info *sbi, in fat_i_pos_read() argument
550 spin_lock(&sbi->inode_hash_lock); in fat_i_pos_read()
554 spin_unlock(&sbi->inode_hash_lock); in fat_i_pos_read()
562 struct msdos_sb_info *sbi = MSDOS_SB(sb); in fat_write_inode() local
572 i_pos = fat_i_pos_read(sbi, inode); in fat_write_inode()
576 bh = sb_bread(sb, i_pos >> sbi->dir_per_block_bits); in fat_write_inode()
582 spin_lock(&sbi->inode_hash_lock); in fat_write_inode()
584 spin_unlock(&sbi->inode_hash_lock); in fat_write_inode()
590 [i_pos & (sbi->dir_per_block - 1)]; in fat_write_inode()
598 fat_time_unix2fat(sbi, &inode->i_mtime, &raw_entry->time, in fat_write_inode()
600 if (sbi->options.isvfat) { in fat_write_inode()
602 fat_time_unix2fat(sbi, &inode->i_ctime, &raw_entry->ctime, in fat_write_inode()
604 fat_time_unix2fat(sbi, &inode->i_atime, &atime, in fat_write_inode()
607 spin_unlock(&sbi->inode_hash_lock); in fat_write_inode()
768 struct msdos_sb_info *sbi = MSDOS_SB(mnt->mnt_sb); in fat_show_options() local
769 struct fat_mount_options *opts = &sbi->options; in fat_show_options()
780 if (sbi->nls_disk) in fat_show_options()
781 seq_printf(m, ",codepage=%s", sbi->nls_disk->charset); in fat_show_options()
783 if (sbi->nls_io) in fat_show_options()
784 seq_printf(m, ",iocharset=%s", sbi->nls_io->charset); in fat_show_options()
1154 struct msdos_sb_info *sbi = MSDOS_SB(sb); in fat_read_root() local
1158 inode->i_uid = sbi->options.fs_uid; in fat_read_root()
1159 inode->i_gid = sbi->options.fs_gid; in fat_read_root()
1162 inode->i_mode = fat_make_mode(sbi, ATTR_DIR, S_IRWXUGO); in fat_read_root()
1163 inode->i_op = sbi->dir_ops; in fat_read_root()
1165 if (sbi->fat_bits == 32) { in fat_read_root()
1166 MSDOS_I(inode)->i_start = sbi->root_cluster; in fat_read_root()
1172 inode->i_size = sbi->dir_entries * sizeof(struct msdos_dir_entry); in fat_read_root()
1174 inode->i_blocks = ((inode->i_size + (sbi->cluster_size - 1)) in fat_read_root()
1175 & ~((loff_t)sbi->cluster_size - 1)) >> 9; in fat_read_root()
1197 struct msdos_sb_info *sbi; in fat_fill_super() local
1211 sbi = kzalloc(sizeof(struct msdos_sb_info), GFP_KERNEL); in fat_fill_super()
1212 if (!sbi) in fat_fill_super()
1214 sb->s_fs_info = sbi; in fat_fill_super()
1220 sbi->dir_ops = fs_dir_inode_ops; in fat_fill_super()
1222 error = parse_options(data, isvfat, silent, &debug, &sbi->options); in fat_fill_super()
1271 sbi->sec_per_clus = b->sec_per_clus; in fat_fill_super()
1272 if (!is_power_of_2(sbi->sec_per_clus)) { in fat_fill_super()
1275 sbi->sec_per_clus); in fat_fill_super()
1304 sbi->cluster_size = sb->s_blocksize * sbi->sec_per_clus; in fat_fill_super()
1305 sbi->cluster_bits = ffs(sbi->cluster_size) - 1; in fat_fill_super()
1306 sbi->fats = b->fats; in fat_fill_super()
1307 sbi->fat_bits = 0; /* Don't know yet */ in fat_fill_super()
1308 sbi->fat_start = le16_to_cpu(b->reserved); in fat_fill_super()
1309 sbi->fat_length = le16_to_cpu(b->fat_length); in fat_fill_super()
1310 sbi->root_cluster = 0; in fat_fill_super()
1311 sbi->free_clusters = -1; /* Don't know yet */ in fat_fill_super()
1312 sbi->free_clus_valid = 0; in fat_fill_super()
1313 sbi->prev_free = FAT_START_ENT; in fat_fill_super()
1315 if (!sbi->fat_length && b->fat32_length) { in fat_fill_super()
1320 sbi->fat_bits = 32; in fat_fill_super()
1321 sbi->fat_length = le32_to_cpu(b->fat32_length); in fat_fill_super()
1322 sbi->root_cluster = le32_to_cpu(b->root_cluster); in fat_fill_super()
1327 sbi->fsinfo_sector = le16_to_cpu(b->info_sector); in fat_fill_super()
1328 if (sbi->fsinfo_sector == 0) in fat_fill_super()
1329 sbi->fsinfo_sector = 1; in fat_fill_super()
1331 fsinfo_bh = sb_bread(sb, sbi->fsinfo_sector); in fat_fill_super()
1334 " (sector = %lu)\n", sbi->fsinfo_sector); in fat_fill_super()
1347 sbi->fsinfo_sector); in fat_fill_super()
1349 if (sbi->options.usefree) in fat_fill_super()
1350 sbi->free_clus_valid = 1; in fat_fill_super()
1351 sbi->free_clusters = le32_to_cpu(fsinfo->free_clusters); in fat_fill_super()
1352 sbi->prev_free = le32_to_cpu(fsinfo->next_cluster); in fat_fill_super()
1361 sbi->vol_id = (((u32)bsx->vol_id[0]) | ((u32)bsx->vol_id[1] << 8) | in fat_fill_super()
1364 sbi->dir_per_block = sb->s_blocksize / sizeof(struct msdos_dir_entry); in fat_fill_super()
1365 sbi->dir_per_block_bits = ffs(sbi->dir_per_block) - 1; in fat_fill_super()
1367 sbi->dir_start = sbi->fat_start + sbi->fats * sbi->fat_length; in fat_fill_super()
1368 sbi->dir_entries = get_unaligned_le16(&b->dir_entries); in fat_fill_super()
1369 if (sbi->dir_entries & (sbi->dir_per_block - 1)) { in fat_fill_super()
1372 " (%u)\n", sbi->dir_entries); in fat_fill_super()
1377 rootdir_sectors = sbi->dir_entries in fat_fill_super()
1379 sbi->data_start = sbi->dir_start + rootdir_sectors; in fat_fill_super()
1384 total_clusters = (total_sectors - sbi->data_start) / sbi->sec_per_clus; in fat_fill_super()
1386 if (sbi->fat_bits != 32) in fat_fill_super()
1387 sbi->fat_bits = (total_clusters > MAX_FAT12) ? 16 : 12; in fat_fill_super()
1390 fat_clusters = sbi->fat_length * sb->s_blocksize * 8 / sbi->fat_bits; in fat_fill_super()
1400 sbi->max_cluster = total_clusters + FAT_START_ENT; in fat_fill_super()
1402 if (sbi->free_clusters != -1 && sbi->free_clusters > total_clusters) in fat_fill_super()
1403 sbi->free_clusters = -1; in fat_fill_super()
1405 sbi->prev_free %= sbi->max_cluster; in fat_fill_super()
1406 if (sbi->prev_free < FAT_START_ENT) in fat_fill_super()
1407 sbi->prev_free = FAT_START_ENT; in fat_fill_super()
1424 sprintf(buf, "cp%d", sbi->options.codepage); in fat_fill_super()
1425 sbi->nls_disk = load_nls(buf); in fat_fill_super()
1426 if (!sbi->nls_disk) { in fat_fill_super()
1432 if (sbi->options.isvfat) { in fat_fill_super()
1433 sbi->nls_io = load_nls(sbi->options.iocharset); in fat_fill_super()
1434 if (!sbi->nls_io) { in fat_fill_super()
1436 sbi->options.iocharset); in fat_fill_super()
1469 if (sbi->nls_io) in fat_fill_super()
1470 unload_nls(sbi->nls_io); in fat_fill_super()
1471 if (sbi->nls_disk) in fat_fill_super()
1472 unload_nls(sbi->nls_disk); in fat_fill_super()
1473 if (sbi->options.iocharset != fat_default_iocharset) in fat_fill_super()
1474 kfree(sbi->options.iocharset); in fat_fill_super()
1476 kfree(sbi); in fat_fill_super()