Lines Matching refs:sb

114 	struct super_block *sb = inode->i_sb;  in __fat_get_block()  local
115 struct msdos_sb_info *sbi = MSDOS_SB(sb); in __fat_get_block()
124 map_bh(bh_result, sb, phys); in __fat_get_block()
131 if (iblock != MSDOS_I(inode)->mmu_private >> sb->s_blocksize_bits) { in __fat_get_block()
132 fat_fs_error(sb, "corrupted file size (i_pos %lld, %lld)", in __fat_get_block()
148 MSDOS_I(inode)->mmu_private += *max_blocks << sb->s_blocksize_bits; in __fat_get_block()
157 map_bh(bh_result, sb, phys); in __fat_get_block()
165 struct super_block *sb = inode->i_sb; in fat_get_block() local
172 bh_result->b_size = max_blocks << sb->s_blocksize_bits; in fat_get_block()
334 static void fat_hash_init(struct super_block *sb) in fat_hash_init() argument
336 struct msdos_sb_info *sbi = MSDOS_SB(sb); in fat_hash_init()
349 static void dir_hash_init(struct super_block *sb) in dir_hash_init() argument
351 struct msdos_sb_info *sbi = MSDOS_SB(sb); in dir_hash_init()
404 struct inode *fat_iget(struct super_block *sb, loff_t i_pos) in fat_iget() argument
406 struct msdos_sb_info *sbi = MSDOS_SB(sb); in fat_iget()
413 BUG_ON(i->vfs_inode.i_sb != sb); in fat_iget()
523 struct inode *fat_build_inode(struct super_block *sb, in fat_build_inode() argument
529 fat_lock_build_inode(MSDOS_SB(sb)); in fat_build_inode()
530 inode = fat_iget(sb, i_pos); in fat_build_inode()
533 inode = new_inode(sb); in fat_build_inode()
538 inode->i_ino = iunique(sb, MSDOS_ROOT_INO); in fat_build_inode()
549 fat_unlock_build_inode(MSDOS_SB(sb)); in fat_build_inode()
568 static void fat_set_state(struct super_block *sb, in fat_set_state() argument
573 struct msdos_sb_info *sbi = MSDOS_SB(sb); in fat_set_state()
576 if ((sb->s_flags & MS_RDONLY) && !force) in fat_set_state()
583 fat_msg(sb, KERN_WARNING, "Volume was not properly " in fat_set_state()
589 bh = sb_bread(sb, 0); in fat_set_state()
591 fat_msg(sb, KERN_ERR, "unable to read boot sector " in fat_set_state()
625 static void fat_put_super(struct super_block *sb) in fat_put_super() argument
627 struct msdos_sb_info *sbi = MSDOS_SB(sb); in fat_put_super()
629 fat_set_state(sb, 0, 0); in fat_put_super()
639 static struct inode *fat_alloc_inode(struct super_block *sb) in fat_alloc_inode() argument
696 static int fat_remount(struct super_block *sb, int *flags, char *data) in fat_remount() argument
699 struct msdos_sb_info *sbi = MSDOS_SB(sb); in fat_remount()
702 sync_filesystem(sb); in fat_remount()
706 if (new_rdonly != (sb->s_flags & MS_RDONLY)) { in fat_remount()
708 fat_set_state(sb, 0, 0); in fat_remount()
710 fat_set_state(sb, 1, 1); in fat_remount()
717 struct super_block *sb = dentry->d_sb; in fat_statfs() local
718 struct msdos_sb_info *sbi = MSDOS_SB(sb); in fat_statfs()
719 u64 id = huge_encode_dev(sb->s_bdev->bd_dev); in fat_statfs()
743 struct super_block *sb = inode->i_sb; in __fat_write_inode() local
744 struct msdos_sb_info *sbi = MSDOS_SB(sb); in __fat_write_inode()
760 bh = sb_bread(sb, blocknr); in __fat_write_inode()
762 fat_msg(sb, KERN_ERR, "unable to read inode block " in __fat_write_inode()
803 struct super_block *sb = inode->i_sb; in fat_write_inode() local
805 mutex_lock(&MSDOS_SB(sb)->s_lock); in fat_write_inode()
806 err = fat_clusters_flush(sb); in fat_write_inode()
807 mutex_unlock(&MSDOS_SB(sb)->s_lock); in fat_write_inode()
1021 static int parse_options(struct super_block *sb, char *options, int is_vfat, in parse_options() argument
1236 fat_msg(sb, KERN_INFO, "\"%s\" option is obsolete, " in parse_options()
1242 fat_msg(sb, KERN_ERR, in parse_options()
1253 fat_msg(sb, KERN_WARNING, "utf8 is not a recommended IO charset" in parse_options()
1264 sb->s_flags |= MS_RDONLY; in parse_options()
1265 sb->s_export_op = &fat_export_ops_nostale; in parse_options()
1306 static unsigned long calc_fat_clusters(struct super_block *sb) in calc_fat_clusters() argument
1308 struct msdos_sb_info *sbi = MSDOS_SB(sb); in calc_fat_clusters()
1312 unsigned long ent_per_sec = sb->s_blocksize * 8 / sbi->fat_bits; in calc_fat_clusters()
1316 return sbi->fat_length * sb->s_blocksize * 8 / sbi->fat_bits; in calc_fat_clusters()
1344 static int fat_read_bpb(struct super_block *sb, struct fat_boot_sector *b, in fat_read_bpb() argument
1372 fat_msg(sb, KERN_ERR, in fat_read_bpb()
1378 fat_msg(sb, KERN_ERR, "bogus number of FAT structure"); in fat_read_bpb()
1389 fat_msg(sb, KERN_ERR, "invalid media value (0x%02x)", in fat_read_bpb()
1398 fat_msg(sb, KERN_ERR, "bogus logical sector size %u", in fat_read_bpb()
1405 fat_msg(sb, KERN_ERR, "bogus sectors per cluster %u", in fat_read_bpb()
1416 static int fat_read_static_bpb(struct super_block *sb, in fat_read_static_bpb() argument
1427 bd_sects = i_size_read(sb->s_bdev->bd_inode) / SECTOR_SIZE; in fat_read_static_bpb()
1432 fat_msg(sb, KERN_ERR, in fat_read_static_bpb()
1443 fat_msg(sb, KERN_ERR, in fat_read_static_bpb()
1457 fat_msg(sb, KERN_WARNING, in fat_read_static_bpb()
1464 fat_msg(sb, KERN_INFO, in fat_read_static_bpb()
1485 int fat_fill_super(struct super_block *sb, void *data, int silent, int isvfat, in fat_fill_super() argument
1508 sb->s_fs_info = sbi; in fat_fill_super()
1510 sb->s_flags |= MS_NODIRATIME; in fat_fill_super()
1511 sb->s_magic = MSDOS_SUPER_MAGIC; in fat_fill_super()
1512 sb->s_op = &fat_sops; in fat_fill_super()
1513 sb->s_export_op = &fat_export_ops; in fat_fill_super()
1518 error = parse_options(sb, data, isvfat, silent, &debug, &sbi->options); in fat_fill_super()
1522 setup(sb); /* flavour-specific stuff that needs options */ in fat_fill_super()
1525 sb_min_blocksize(sb, 512); in fat_fill_super()
1526 bh = sb_bread(sb, 0); in fat_fill_super()
1528 fat_msg(sb, KERN_ERR, "unable to read boot sector"); in fat_fill_super()
1532 error = fat_read_bpb(sb, (struct fat_boot_sector *)bh->b_data, silent, in fat_fill_super()
1535 error = fat_read_static_bpb(sb, in fat_fill_super()
1548 if (logical_sector_size < sb->s_blocksize) { in fat_fill_super()
1549 fat_msg(sb, KERN_ERR, "logical sector size too small for device" in fat_fill_super()
1554 if (logical_sector_size > sb->s_blocksize) { in fat_fill_super()
1557 if (!sb_set_blocksize(sb, logical_sector_size)) { in fat_fill_super()
1558 fat_msg(sb, KERN_ERR, "unable to set blocksize %u", in fat_fill_super()
1564 bh_resize = sb_bread(sb, 0); in fat_fill_super()
1566 fat_msg(sb, KERN_ERR, "unable to read boot sector" in fat_fill_super()
1568 sb->s_blocksize); in fat_fill_super()
1575 sbi->cluster_size = sb->s_blocksize * sbi->sec_per_clus; in fat_fill_super()
1585 sb->s_maxbytes = 0xffffffff; in fat_fill_super()
1601 fsinfo_bh = sb_bread(sb, sbi->fsinfo_sector); in fat_fill_super()
1603 fat_msg(sb, KERN_ERR, "bread failed, FSINFO block" in fat_fill_super()
1610 fat_msg(sb, KERN_WARNING, "Invalid FSINFO signature: " in fat_fill_super()
1631 sbi->dir_per_block = sb->s_blocksize / sizeof(struct msdos_dir_entry); in fat_fill_super()
1638 fat_msg(sb, KERN_ERR, "bogus directory-entries per block" in fat_fill_super()
1644 * sizeof(struct msdos_dir_entry) / sb->s_blocksize; in fat_fill_super()
1662 fat_clusters = calc_fat_clusters(sb); in fat_fill_super()
1664 if (total_clusters > MAX_FAT(sb)) { in fat_fill_super()
1666 fat_msg(sb, KERN_ERR, "count of clusters too big (%u)", in fat_fill_super()
1681 fat_hash_init(sb); in fat_fill_super()
1682 dir_hash_init(sb); in fat_fill_super()
1683 fat_ent_access_init(sb); in fat_fill_super()
1697 fat_msg(sb, KERN_ERR, "codepage %s not found", buf); in fat_fill_super()
1705 fat_msg(sb, KERN_ERR, "IO charset %s not found", in fat_fill_super()
1712 fat_inode = new_inode(sb); in fat_fill_super()
1718 fsinfo_inode = new_inode(sb); in fat_fill_super()
1725 root_inode = new_inode(sb); in fat_fill_super()
1738 sb->s_root = d_make_root(root_inode); in fat_fill_super()
1739 if (!sb->s_root) { in fat_fill_super()
1740 fat_msg(sb, KERN_ERR, "get root inode failed"); in fat_fill_super()
1745 struct request_queue *q = bdev_get_queue(sb->s_bdev); in fat_fill_super()
1747 fat_msg(sb, KERN_WARNING, in fat_fill_super()
1752 fat_set_state(sb, 1, 0); in fat_fill_super()
1758 fat_msg(sb, KERN_INFO, "Can't find a valid FAT filesystem"); in fat_fill_super()
1769 sb->s_fs_info = NULL; in fat_fill_super()
1805 int fat_flush_inodes(struct super_block *sb, struct inode *i1, struct inode *i2) in fat_flush_inodes() argument
1808 if (!MSDOS_SB(sb)->options.flush) in fat_flush_inodes()
1815 struct address_space *mapping = sb->s_bdev->bd_inode->i_mapping; in fat_flush_inodes()