Lines Matching refs:sb

115 	struct super_block *sb = inode->i_sb;  in __fat_get_block()  local
116 struct msdos_sb_info *sbi = MSDOS_SB(sb); in __fat_get_block()
125 map_bh(bh_result, sb, phys); in __fat_get_block()
132 if (iblock != MSDOS_I(inode)->mmu_private >> sb->s_blocksize_bits) { in __fat_get_block()
133 fat_fs_error(sb, "corrupted file size (i_pos %lld, %lld)", in __fat_get_block()
149 MSDOS_I(inode)->mmu_private += *max_blocks << sb->s_blocksize_bits; in __fat_get_block()
158 map_bh(bh_result, sb, phys); in __fat_get_block()
166 struct super_block *sb = inode->i_sb; in fat_get_block() local
173 bh_result->b_size = max_blocks << sb->s_blocksize_bits; in fat_get_block()
335 static void fat_hash_init(struct super_block *sb) in fat_hash_init() argument
337 struct msdos_sb_info *sbi = MSDOS_SB(sb); in fat_hash_init()
350 static void dir_hash_init(struct super_block *sb) in dir_hash_init() argument
352 struct msdos_sb_info *sbi = MSDOS_SB(sb); in dir_hash_init()
405 struct inode *fat_iget(struct super_block *sb, loff_t i_pos) in fat_iget() argument
407 struct msdos_sb_info *sbi = MSDOS_SB(sb); in fat_iget()
414 BUG_ON(i->vfs_inode.i_sb != sb); in fat_iget()
524 struct inode *fat_build_inode(struct super_block *sb, in fat_build_inode() argument
530 fat_lock_build_inode(MSDOS_SB(sb)); in fat_build_inode()
531 inode = fat_iget(sb, i_pos); in fat_build_inode()
534 inode = new_inode(sb); in fat_build_inode()
539 inode->i_ino = iunique(sb, MSDOS_ROOT_INO); in fat_build_inode()
550 fat_unlock_build_inode(MSDOS_SB(sb)); in fat_build_inode()
569 static void fat_set_state(struct super_block *sb, in fat_set_state() argument
574 struct msdos_sb_info *sbi = MSDOS_SB(sb); in fat_set_state()
577 if ((sb->s_flags & MS_RDONLY) && !force) in fat_set_state()
584 fat_msg(sb, KERN_WARNING, "Volume was not properly " in fat_set_state()
590 bh = sb_bread(sb, 0); in fat_set_state()
592 fat_msg(sb, KERN_ERR, "unable to read boot sector " in fat_set_state()
626 static void fat_put_super(struct super_block *sb) in fat_put_super() argument
628 struct msdos_sb_info *sbi = MSDOS_SB(sb); in fat_put_super()
630 fat_set_state(sb, 0, 0); in fat_put_super()
640 static struct inode *fat_alloc_inode(struct super_block *sb) in fat_alloc_inode() argument
697 static int fat_remount(struct super_block *sb, int *flags, char *data) in fat_remount() argument
700 struct msdos_sb_info *sbi = MSDOS_SB(sb); in fat_remount()
703 sync_filesystem(sb); in fat_remount()
707 if (new_rdonly != (sb->s_flags & MS_RDONLY)) { in fat_remount()
709 fat_set_state(sb, 0, 0); in fat_remount()
711 fat_set_state(sb, 1, 1); in fat_remount()
718 struct super_block *sb = dentry->d_sb; in fat_statfs() local
719 struct msdos_sb_info *sbi = MSDOS_SB(sb); in fat_statfs()
720 u64 id = huge_encode_dev(sb->s_bdev->bd_dev); in fat_statfs()
744 struct super_block *sb = inode->i_sb; in __fat_write_inode() local
745 struct msdos_sb_info *sbi = MSDOS_SB(sb); in __fat_write_inode()
761 bh = sb_bread(sb, blocknr); in __fat_write_inode()
763 fat_msg(sb, KERN_ERR, "unable to read inode block " in __fat_write_inode()
804 struct super_block *sb = inode->i_sb; in fat_write_inode() local
806 mutex_lock(&MSDOS_SB(sb)->s_lock); in fat_write_inode()
807 err = fat_clusters_flush(sb); in fat_write_inode()
808 mutex_unlock(&MSDOS_SB(sb)->s_lock); in fat_write_inode()
1022 static int parse_options(struct super_block *sb, char *options, int is_vfat, in parse_options() argument
1237 fat_msg(sb, KERN_INFO, "\"%s\" option is obsolete, " in parse_options()
1243 fat_msg(sb, KERN_ERR, in parse_options()
1254 fat_msg(sb, KERN_WARNING, "utf8 is not a recommended IO charset" in parse_options()
1265 sb->s_flags |= MS_RDONLY; in parse_options()
1266 sb->s_export_op = &fat_export_ops_nostale; in parse_options()
1307 static unsigned long calc_fat_clusters(struct super_block *sb) in calc_fat_clusters() argument
1309 struct msdos_sb_info *sbi = MSDOS_SB(sb); in calc_fat_clusters()
1313 unsigned long ent_per_sec = sb->s_blocksize * 8 / sbi->fat_bits; in calc_fat_clusters()
1317 return sbi->fat_length * sb->s_blocksize * 8 / sbi->fat_bits; in calc_fat_clusters()
1345 static int fat_read_bpb(struct super_block *sb, struct fat_boot_sector *b, in fat_read_bpb() argument
1373 fat_msg(sb, KERN_ERR, in fat_read_bpb()
1379 fat_msg(sb, KERN_ERR, "bogus number of FAT structure"); in fat_read_bpb()
1390 fat_msg(sb, KERN_ERR, "invalid media value (0x%02x)", in fat_read_bpb()
1399 fat_msg(sb, KERN_ERR, "bogus logical sector size %u", in fat_read_bpb()
1406 fat_msg(sb, KERN_ERR, "bogus sectors per cluster %u", in fat_read_bpb()
1417 static int fat_read_static_bpb(struct super_block *sb, in fat_read_static_bpb() argument
1428 bd_sects = i_size_read(sb->s_bdev->bd_inode) / SECTOR_SIZE; in fat_read_static_bpb()
1433 fat_msg(sb, KERN_ERR, in fat_read_static_bpb()
1444 fat_msg(sb, KERN_ERR, in fat_read_static_bpb()
1458 fat_msg(sb, KERN_WARNING, in fat_read_static_bpb()
1465 fat_msg(sb, KERN_INFO, in fat_read_static_bpb()
1486 int fat_fill_super(struct super_block *sb, void *data, int silent, int isvfat, in fat_fill_super() argument
1509 sb->s_fs_info = sbi; in fat_fill_super()
1511 sb->s_flags |= MS_NODIRATIME; in fat_fill_super()
1512 sb->s_magic = MSDOS_SUPER_MAGIC; in fat_fill_super()
1513 sb->s_op = &fat_sops; in fat_fill_super()
1514 sb->s_export_op = &fat_export_ops; in fat_fill_super()
1519 error = parse_options(sb, data, isvfat, silent, &debug, &sbi->options); in fat_fill_super()
1523 setup(sb); /* flavour-specific stuff that needs options */ in fat_fill_super()
1526 sb_min_blocksize(sb, 512); in fat_fill_super()
1527 bh = sb_bread(sb, 0); in fat_fill_super()
1529 fat_msg(sb, KERN_ERR, "unable to read boot sector"); in fat_fill_super()
1533 error = fat_read_bpb(sb, (struct fat_boot_sector *)bh->b_data, silent, in fat_fill_super()
1536 error = fat_read_static_bpb(sb, in fat_fill_super()
1549 if (logical_sector_size < sb->s_blocksize) { in fat_fill_super()
1550 fat_msg(sb, KERN_ERR, "logical sector size too small for device" in fat_fill_super()
1555 if (logical_sector_size > sb->s_blocksize) { in fat_fill_super()
1558 if (!sb_set_blocksize(sb, logical_sector_size)) { in fat_fill_super()
1559 fat_msg(sb, KERN_ERR, "unable to set blocksize %u", in fat_fill_super()
1565 bh_resize = sb_bread(sb, 0); in fat_fill_super()
1567 fat_msg(sb, KERN_ERR, "unable to read boot sector" in fat_fill_super()
1569 sb->s_blocksize); in fat_fill_super()
1576 sbi->cluster_size = sb->s_blocksize * sbi->sec_per_clus; in fat_fill_super()
1586 sb->s_maxbytes = 0xffffffff; in fat_fill_super()
1602 fsinfo_bh = sb_bread(sb, sbi->fsinfo_sector); in fat_fill_super()
1604 fat_msg(sb, KERN_ERR, "bread failed, FSINFO block" in fat_fill_super()
1611 fat_msg(sb, KERN_WARNING, "Invalid FSINFO signature: " in fat_fill_super()
1632 sbi->dir_per_block = sb->s_blocksize / sizeof(struct msdos_dir_entry); in fat_fill_super()
1639 fat_msg(sb, KERN_ERR, "bogus directory-entries per block" in fat_fill_super()
1645 * sizeof(struct msdos_dir_entry) / sb->s_blocksize; in fat_fill_super()
1663 fat_clusters = calc_fat_clusters(sb); in fat_fill_super()
1665 if (total_clusters > MAX_FAT(sb)) { in fat_fill_super()
1667 fat_msg(sb, KERN_ERR, "count of clusters too big (%u)", in fat_fill_super()
1682 fat_hash_init(sb); in fat_fill_super()
1683 dir_hash_init(sb); in fat_fill_super()
1684 fat_ent_access_init(sb); in fat_fill_super()
1698 fat_msg(sb, KERN_ERR, "codepage %s not found", buf); in fat_fill_super()
1706 fat_msg(sb, KERN_ERR, "IO charset %s not found", in fat_fill_super()
1713 fat_inode = new_inode(sb); in fat_fill_super()
1719 fsinfo_inode = new_inode(sb); in fat_fill_super()
1726 root_inode = new_inode(sb); in fat_fill_super()
1739 sb->s_root = d_make_root(root_inode); in fat_fill_super()
1740 if (!sb->s_root) { in fat_fill_super()
1741 fat_msg(sb, KERN_ERR, "get root inode failed"); in fat_fill_super()
1746 struct request_queue *q = bdev_get_queue(sb->s_bdev); in fat_fill_super()
1748 fat_msg(sb, KERN_WARNING, in fat_fill_super()
1753 fat_set_state(sb, 1, 0); in fat_fill_super()
1759 fat_msg(sb, KERN_INFO, "Can't find a valid FAT filesystem"); in fat_fill_super()
1770 sb->s_fs_info = NULL; in fat_fill_super()
1806 int fat_flush_inodes(struct super_block *sb, struct inode *i1, struct inode *i2) in fat_flush_inodes() argument
1809 if (!MSDOS_SB(sb)->options.flush) in fat_flush_inodes()
1816 struct address_space *mapping = sb->s_bdev->bd_inode->i_mapping; in fat_flush_inodes()