Lines Matching refs:sb
46 static struct inode *befs_alloc_inode(struct super_block *sb);
50 static int befs_utf2nls(struct super_block *sb, const char *in, int in_len,
52 static int befs_nls2utf(struct super_block *sb, const char *in, int in_len,
59 static struct dentry *befs_fh_to_dentry(struct super_block *sb,
61 static struct dentry *befs_fh_to_parent(struct super_block *sb,
134 struct super_block *sb = inode->i_sb; in befs_get_block() local
140 befs_debug(sb, "---> befs_get_block() for inode %lu, block %ld", in befs_get_block()
143 befs_error(sb, "befs_get_block() was asked to write to " in befs_get_block()
149 res = befs_fblock2brun(sb, ds, block, &run); in befs_get_block()
151 befs_error(sb, in befs_get_block()
158 disk_off = (ulong) iaddr2blockno(sb, &run); in befs_get_block()
162 befs_debug(sb, "<--- %s for inode %lu, block %ld, disk address %lu", in befs_get_block()
173 struct super_block *sb = dir->i_sb; in befs_lookup() local
181 befs_debug(sb, "---> %s name %pd inode %ld", __func__, in befs_lookup()
185 if (BEFS_SB(sb)->nls) { in befs_lookup()
187 befs_nls2utf(sb, name, strlen(name), &utfname, &utfnamelen); in befs_lookup()
189 befs_debug(sb, "<--- %s ERROR", __func__); in befs_lookup()
192 ret = befs_btree_find(sb, ds, utfname, &offset); in befs_lookup()
196 ret = befs_btree_find(sb, ds, name, &offset); in befs_lookup()
200 befs_debug(sb, "<--- %s %pd not found", __func__, dentry); in befs_lookup()
203 befs_error(sb, "<--- %s Error", __func__); in befs_lookup()
208 befs_debug(sb, "<--- %s", __func__); in befs_lookup()
217 struct super_block *sb = inode->i_sb; in befs_readdir() local
224 befs_debug(sb, "---> %s name %pD, inode %ld, ctx->pos %lld", in befs_readdir()
228 result = befs_btree_read(sb, ds, ctx->pos, BEFS_NAME_LEN + 1, in befs_readdir()
232 befs_debug(sb, "<--- %s ERROR", __func__); in befs_readdir()
233 befs_error(sb, "IO error reading %pD (inode %lu)", in befs_readdir()
238 befs_debug(sb, "<--- %s END", __func__); in befs_readdir()
242 befs_debug(sb, "<--- %s Empty directory", __func__); in befs_readdir()
247 if (BEFS_SB(sb)->nls) { in befs_readdir()
252 befs_utf2nls(sb, keybuf, keysize, &nlsname, in befs_readdir()
255 befs_debug(sb, "<--- %s ERROR", __func__); in befs_readdir()
274 befs_alloc_inode(struct super_block *sb) in befs_alloc_inode() argument
302 static struct inode *befs_iget(struct super_block *sb, unsigned long ino) in befs_iget() argument
306 struct befs_sb_info *befs_sb = BEFS_SB(sb); in befs_iget()
310 befs_debug(sb, "---> %s inode = %lu", __func__, ino); in befs_iget()
312 inode = iget_locked(sb, ino); in befs_iget()
321 befs_ino->i_inode_num = blockno2iaddr(sb, inode->i_ino); in befs_iget()
323 befs_debug(sb, " real inode number [%u, %hu, %hu]", in befs_iget()
327 bh = sb_bread(sb, inode->i_ino); in befs_iget()
329 befs_error(sb, "unable to read inode block - " in befs_iget()
336 befs_dump_inode(sb, raw_inode); in befs_iget()
338 if (befs_check_inode(sb, raw_inode, inode->i_ino) != BEFS_OK) { in befs_iget()
339 befs_error(sb, "Bad inode: %lu", inode->i_ino); in befs_iget()
343 inode->i_mode = (umode_t) fs32_to_cpu(sb, raw_inode->mode); in befs_iget()
352 make_kuid(&init_user_ns, fs32_to_cpu(sb, raw_inode->uid)); in befs_iget()
355 make_kgid(&init_user_ns, fs32_to_cpu(sb, raw_inode->gid)); in befs_iget()
369 fs64_to_cpu(sb, raw_inode->last_modified_time) >> 16; in befs_iget()
374 befs_ino->i_inode_num = fsrun_to_cpu(sb, raw_inode->inode_num); in befs_iget()
375 befs_ino->i_parent = fsrun_to_cpu(sb, raw_inode->parent); in befs_iget()
376 befs_ino->i_attribute = fsrun_to_cpu(sb, raw_inode->attributes); in befs_iget()
377 befs_ino->i_flags = fs32_to_cpu(sb, raw_inode->flags); in befs_iget()
388 fsds_to_cpu(sb, &raw_inode->data.datastream); in befs_iget()
390 num_blks = befs_count_blocks(sb, &befs_ino->i_data.ds); in befs_iget()
413 befs_error(sb, "Inode %lu is not a regular file, " in befs_iget()
420 befs_debug(sb, "<--- %s", __func__); in befs_iget()
429 befs_debug(sb, "<--- %s - Bad inode", __func__); in befs_iget()
478 struct super_block *sb = inode->i_sb; in befs_symlink_readpage() local
485 befs_error(sb, "Long symlink with illegal length"); in befs_symlink_readpage()
488 befs_debug(sb, "Follow long symlink"); in befs_symlink_readpage()
490 if (befs_read_lsymlink(sb, data, link, len) != len) { in befs_symlink_readpage()
491 befs_error(sb, "Failed to read entire long symlink"); in befs_symlink_readpage()
510 befs_utf2nls(struct super_block *sb, const char *in, in befs_utf2nls() argument
513 struct nls_table *nls = BEFS_SB(sb)->nls; in befs_utf2nls()
524 befs_debug(sb, "---> %s", __func__); in befs_utf2nls()
527 befs_error(sb, "%s called with no NLS table loaded", __func__); in befs_utf2nls()
552 befs_debug(sb, "<--- %s", __func__); in befs_utf2nls()
557 befs_error(sb, "Name using character set %s contains a character that " in befs_utf2nls()
559 befs_debug(sb, "<--- %s", __func__); in befs_utf2nls()
587 befs_nls2utf(struct super_block *sb, const char *in, in befs_nls2utf() argument
590 struct nls_table *nls = BEFS_SB(sb)->nls; in befs_nls2utf()
602 befs_debug(sb, "---> %s\n", __func__); in befs_nls2utf()
605 befs_error(sb, "%s called with no NLS table loaded.", in befs_nls2utf()
632 befs_debug(sb, "<--- %s", __func__); in befs_nls2utf()
637 befs_error(sb, "Name using character set %s contains a character that " in befs_nls2utf()
639 befs_debug(sb, "<--- %s", __func__); in befs_nls2utf()
644 static struct inode *befs_nfs_get_inode(struct super_block *sb, uint64_t ino, in befs_nfs_get_inode() argument
648 return befs_iget(sb, ino); in befs_nfs_get_inode()
654 static struct dentry *befs_fh_to_dentry(struct super_block *sb, in befs_fh_to_dentry() argument
657 return generic_fh_to_dentry(sb, fid, fh_len, fh_type, in befs_fh_to_dentry()
664 static struct dentry *befs_fh_to_parent(struct super_block *sb, in befs_fh_to_parent() argument
667 return generic_fh_to_parent(sb, fid, fh_len, fh_type, in befs_fh_to_parent()
797 befs_put_super(struct super_block *sb) in befs_put_super() argument
799 kfree(BEFS_SB(sb)->mount_opts.iocharset); in befs_put_super()
800 BEFS_SB(sb)->mount_opts.iocharset = NULL; in befs_put_super()
801 unload_nls(BEFS_SB(sb)->nls); in befs_put_super()
802 kfree(sb->s_fs_info); in befs_put_super()
803 sb->s_fs_info = NULL; in befs_put_super()
813 befs_fill_super(struct super_block *sb, void *data, int silent) in befs_fill_super() argument
824 sb->s_fs_info = kzalloc(sizeof(*befs_sb), GFP_KERNEL); in befs_fill_super()
825 if (sb->s_fs_info == NULL) in befs_fill_super()
828 befs_sb = BEFS_SB(sb); in befs_fill_super()
832 befs_error(sb, "cannot parse mount options"); in befs_fill_super()
836 befs_debug(sb, "---> %s", __func__); in befs_fill_super()
838 if (!sb_rdonly(sb)) { in befs_fill_super()
839 befs_warning(sb, in befs_fill_super()
841 sb->s_flags |= SB_RDONLY; in befs_fill_super()
852 blocksize = sb_min_blocksize(sb, 1024); in befs_fill_super()
855 befs_error(sb, "unable to set blocksize"); in befs_fill_super()
859 bh = sb_bread(sb, sb_block); in befs_fill_super()
862 befs_error(sb, "unable to read superblock"); in befs_fill_super()
870 befs_debug(sb, "Using PPC superblock location"); in befs_fill_super()
872 befs_debug(sb, "Using x86 superblock location"); in befs_fill_super()
877 if ((befs_load_sb(sb, disk_sb) != BEFS_OK) || in befs_fill_super()
878 (befs_check_sb(sb) != BEFS_OK)) in befs_fill_super()
881 befs_dump_super_block(sb, disk_sb); in befs_fill_super()
887 befs_error(sb, "blocks count: %llu is larger than the host can use", in befs_fill_super()
896 sb->s_magic = BEFS_SUPER_MAGIC; in befs_fill_super()
898 sb_set_blocksize(sb, (ulong) befs_sb->block_size); in befs_fill_super()
899 sb->s_op = &befs_sops; in befs_fill_super()
900 sb->s_export_op = &befs_export_operations; in befs_fill_super()
901 root = befs_iget(sb, iaddr2blockno(sb, &(befs_sb->root_dir))); in befs_fill_super()
906 sb->s_root = d_make_root(root); in befs_fill_super()
907 if (!sb->s_root) { in befs_fill_super()
909 befs_error(sb, "get root inode failed"); in befs_fill_super()
915 befs_debug(sb, "Loading nls: %s", in befs_fill_super()
919 befs_warning(sb, "Cannot load nls %s" in befs_fill_super()
926 befs_debug(sb, "Loading default nls"); in befs_fill_super()
937 kfree(sb->s_fs_info); in befs_fill_super()
938 sb->s_fs_info = NULL; in befs_fill_super()
945 befs_remount(struct super_block *sb, int *flags, char *data) in befs_remount() argument
947 sync_filesystem(sb); in befs_remount()
956 struct super_block *sb = dentry->d_sb; in befs_statfs() local
957 u64 id = huge_encode_dev(sb->s_bdev->bd_dev); in befs_statfs()
959 befs_debug(sb, "---> %s", __func__); in befs_statfs()
962 buf->f_bsize = sb->s_blocksize; in befs_statfs()
963 buf->f_blocks = BEFS_SB(sb)->num_blocks; in befs_statfs()
964 buf->f_bfree = BEFS_SB(sb)->num_blocks - BEFS_SB(sb)->used_blocks; in befs_statfs()
972 befs_debug(sb, "<--- %s", __func__); in befs_statfs()