Lines Matching full:sbi
26 struct omfs_sb_info *sbi = OMFS_SB(sb); in omfs_bread() local
27 if (block >= sbi->s_num_blocks) in omfs_bread()
30 return sb_bread(sb, clus_to_blk(sbi, block)); in omfs_bread()
39 struct omfs_sb_info *sbi = OMFS_SB(dir->i_sb); in omfs_new_inode() local
45 err = omfs_allocate_range(dir->i_sb, sbi->s_mirrors, sbi->s_mirrors, in omfs_new_inode()
59 inode->i_size = sbi->s_sys_blocksize; in omfs_new_inode()
105 struct omfs_sb_info *sbi = OMFS_SB(inode->i_sb); in __omfs_write_inode() local
130 oi->i_head.h_body_size = cpu_to_be32(sbi->s_sys_blocksize - in __omfs_write_inode()
151 for (i = 1; i < sbi->s_mirrors; i++) { in __omfs_write_inode()
204 struct omfs_sb_info *sbi = OMFS_SB(sb); in omfs_iget() local
227 inode->i_uid = sbi->s_uid; in omfs_iget()
228 inode->i_gid = sbi->s_gid; in omfs_iget()
241 inode->i_mode = S_IFDIR | (S_IRWXUGO & ~sbi->s_dmask); in omfs_iget()
244 inode->i_size = sbi->s_sys_blocksize; in omfs_iget()
248 inode->i_mode = S_IFREG | (S_IRWXUGO & ~sbi->s_fmask); in omfs_iget()
265 struct omfs_sb_info *sbi = OMFS_SB(sb); in omfs_put_super() local
266 kfree(sbi->s_imap); in omfs_put_super()
267 kfree(sbi); in omfs_put_super()
274 struct omfs_sb_info *sbi = OMFS_SB(s); in omfs_statfs() local
278 buf->f_bsize = sbi->s_blocksize; in omfs_statfs()
279 buf->f_blocks = sbi->s_num_blocks; in omfs_statfs()
280 buf->f_files = sbi->s_num_blocks; in omfs_statfs()
295 struct omfs_sb_info *sbi = OMFS_SB(root->d_sb); in omfs_show_options() local
298 if (!uid_eq(sbi->s_uid, current_uid())) in omfs_show_options()
300 from_kuid_munged(&init_user_ns, sbi->s_uid)); in omfs_show_options()
301 if (!gid_eq(sbi->s_gid, current_gid())) in omfs_show_options()
303 from_kgid_munged(&init_user_ns, sbi->s_gid)); in omfs_show_options()
305 if (sbi->s_dmask == sbi->s_fmask) { in omfs_show_options()
306 if (sbi->s_fmask != cur_umask) in omfs_show_options()
307 seq_printf(m, ",umask=%o", sbi->s_fmask); in omfs_show_options()
309 if (sbi->s_dmask != cur_umask) in omfs_show_options()
310 seq_printf(m, ",dmask=%o", sbi->s_dmask); in omfs_show_options()
311 if (sbi->s_fmask != cur_umask) in omfs_show_options()
312 seq_printf(m, ",fmask=%o", sbi->s_fmask); in omfs_show_options()
337 struct omfs_sb_info *sbi = OMFS_SB(sb); in omfs_get_imap() local
342 bitmap_size = DIV_ROUND_UP(sbi->s_num_blocks, 8); in omfs_get_imap()
345 if (sbi->s_bitmap_ino == ~0ULL) in omfs_get_imap()
348 sbi->s_imap_size = array_size; in omfs_get_imap()
349 sbi->s_imap = kcalloc(array_size, sizeof(unsigned long *), GFP_KERNEL); in omfs_get_imap()
350 if (!sbi->s_imap) in omfs_get_imap()
353 block = clus_to_blk(sbi, sbi->s_bitmap_ino); in omfs_get_imap()
354 if (block >= sbi->s_num_blocks) in omfs_get_imap()
357 ptr = sbi->s_imap; in omfs_get_imap()
378 kfree(sbi->s_imap[count]); in omfs_get_imap()
380 kfree(sbi->s_imap); in omfs_get_imap()
382 sbi->s_imap = NULL; in omfs_get_imap()
383 sbi->s_imap_size = 0; in omfs_get_imap()
400 static int parse_options(char *options, struct omfs_sb_info *sbi) in parse_options() argument
419 sbi->s_uid = make_kuid(current_user_ns(), option); in parse_options()
420 if (!uid_valid(sbi->s_uid)) in parse_options()
426 sbi->s_gid = make_kgid(current_user_ns(), option); in parse_options()
427 if (!gid_valid(sbi->s_gid)) in parse_options()
433 sbi->s_fmask = sbi->s_dmask = option; in parse_options()
438 sbi->s_dmask = option; in parse_options()
443 sbi->s_fmask = option; in parse_options()
457 struct omfs_sb_info *sbi; in omfs_fill_super() local
461 sbi = kzalloc(sizeof(struct omfs_sb_info), GFP_KERNEL); in omfs_fill_super()
462 if (!sbi) in omfs_fill_super()
465 sb->s_fs_info = sbi; in omfs_fill_super()
467 sbi->s_uid = current_uid(); in omfs_fill_super()
468 sbi->s_gid = current_gid(); in omfs_fill_super()
469 sbi->s_dmask = sbi->s_fmask = current_umask(); in omfs_fill_super()
471 if (!parse_options((char *) data, sbi)) in omfs_fill_super()
496 sbi->s_num_blocks = be64_to_cpu(omfs_sb->s_num_blocks); in omfs_fill_super()
497 sbi->s_blocksize = be32_to_cpu(omfs_sb->s_blocksize); in omfs_fill_super()
498 sbi->s_mirrors = be32_to_cpu(omfs_sb->s_mirrors); in omfs_fill_super()
499 sbi->s_root_ino = be64_to_cpu(omfs_sb->s_root_block); in omfs_fill_super()
500 sbi->s_sys_blocksize = be32_to_cpu(omfs_sb->s_sys_blocksize); in omfs_fill_super()
501 mutex_init(&sbi->s_bitmap_lock); in omfs_fill_super()
503 if (sbi->s_num_blocks > OMFS_MAX_BLOCKS) { in omfs_fill_super()
505 (unsigned long long)sbi->s_num_blocks); in omfs_fill_super()
509 if (sbi->s_sys_blocksize > PAGE_SIZE) { in omfs_fill_super()
511 sbi->s_sys_blocksize); in omfs_fill_super()
515 if (sbi->s_blocksize < sbi->s_sys_blocksize || in omfs_fill_super()
516 sbi->s_blocksize > OMFS_MAX_BLOCK_SIZE) { in omfs_fill_super()
518 sbi->s_blocksize); in omfs_fill_super()
526 sb_set_blocksize(sb, sbi->s_sys_blocksize); in omfs_fill_super()
532 sbi->s_block_shift = get_bitmask_order(sbi->s_blocksize) - in omfs_fill_super()
533 get_bitmask_order(sbi->s_sys_blocksize); in omfs_fill_super()
541 sbi->s_bitmap_ino = be64_to_cpu(omfs_rb->r_bitmap); in omfs_fill_super()
542 sbi->s_clustersize = be32_to_cpu(omfs_rb->r_clustersize); in omfs_fill_super()
544 if (sbi->s_num_blocks != be64_to_cpu(omfs_rb->r_num_blocks)) { in omfs_fill_super()
547 (unsigned long long)sbi->s_num_blocks, in omfs_fill_super()
552 if (sbi->s_bitmap_ino != ~0ULL && in omfs_fill_super()
553 sbi->s_bitmap_ino > sbi->s_num_blocks) { in omfs_fill_super()
556 (unsigned long long) sbi->s_bitmap_ino, in omfs_fill_super()
557 (unsigned long long) sbi->s_num_blocks); in omfs_fill_super()
560 if (sbi->s_clustersize < 1 || in omfs_fill_super()
561 sbi->s_clustersize > OMFS_MAX_CLUSTER_SIZE) { in omfs_fill_super()
563 sbi->s_clustersize); in omfs_fill_super()
593 kfree(sbi); in omfs_fill_super()