Lines Matching full:sb

62 static void jfs_handle_error(struct super_block *sb)  in jfs_handle_error()  argument
64 struct jfs_sb_info *sbi = JFS_SBI(sb); in jfs_handle_error()
66 if (sb_rdonly(sb)) in jfs_handle_error()
69 updateSuper(sb, FM_DIRTY); in jfs_handle_error()
73 sb->s_id); in jfs_handle_error()
76 sb->s_id); in jfs_handle_error()
77 sb->s_flags |= SB_RDONLY; in jfs_handle_error()
83 void jfs_error(struct super_block *sb, const char *fmt, ...) in jfs_error() argument
94 sb->s_id, __builtin_return_address(0), &vaf); in jfs_error()
98 jfs_handle_error(sb); in jfs_error()
101 static struct inode *jfs_alloc_inode(struct super_block *sb) in jfs_alloc_inode() argument
105 jfs_inode = alloc_inode_sb(sb, jfs_inode_cachep, GFP_NOFS); in jfs_alloc_inode()
157 static int jfs_quota_off(struct super_block *sb, int type);
158 static int jfs_quota_on(struct super_block *sb, int type, int format_id,
161 static void jfs_quota_off_umount(struct super_block *sb) in jfs_quota_off_umount() argument
166 jfs_quota_off(sb, type); in jfs_quota_off_umount()
180 static inline void jfs_quota_off_umount(struct super_block *sb) in jfs_quota_off_umount() argument
185 static void jfs_put_super(struct super_block *sb) in jfs_put_super() argument
187 struct jfs_sb_info *sbi = JFS_SBI(sb); in jfs_put_super()
192 jfs_quota_off_umount(sb); in jfs_put_super()
194 rc = jfs_umount(sb); in jfs_put_super()
364 struct super_block *sb = fc->root->d_sb; in jfs_reconfigure() local
370 sync_filesystem(sb); in jfs_reconfigure()
373 JFS_SBI(sb)->flag = ctx->flag; in jfs_reconfigure()
374 JFS_SBI(sb)->uid = ctx->uid; in jfs_reconfigure()
375 JFS_SBI(sb)->gid = ctx->gid; in jfs_reconfigure()
376 JFS_SBI(sb)->umask = ctx->umask; in jfs_reconfigure()
377 JFS_SBI(sb)->minblks_trim = ctx->minblks_trim; in jfs_reconfigure()
379 unload_nls(JFS_SBI(sb)->nls_tab); in jfs_reconfigure()
380 JFS_SBI(sb)->nls_tab = ctx->nls_map; in jfs_reconfigure()
385 if (sb_rdonly(sb)) { in jfs_reconfigure()
391 ctx->newLVSize = sb_bdev_nr_blocks(sb); in jfs_reconfigure()
396 rc = jfs_extendfs(sb, ctx->newLVSize, 0); in jfs_reconfigure()
401 if (sb_rdonly(sb) && !readonly) { in jfs_reconfigure()
406 truncate_inode_pages(JFS_SBI(sb)->direct_inode->i_mapping, 0); in jfs_reconfigure()
408 JFS_SBI(sb)->flag = flag; in jfs_reconfigure()
409 ret = jfs_mount_rw(sb, 1); in jfs_reconfigure()
412 sb->s_flags &= ~SB_RDONLY; in jfs_reconfigure()
414 dquot_resume(sb, -1); in jfs_reconfigure()
417 if (!sb_rdonly(sb) && readonly) { in jfs_reconfigure()
418 rc = dquot_suspend(sb, -1); in jfs_reconfigure()
421 rc = jfs_umount_rw(sb); in jfs_reconfigure()
422 JFS_SBI(sb)->flag = flag; in jfs_reconfigure()
425 if ((JFS_SBI(sb)->flag & JFS_NOINTEGRITY) != (flag & JFS_NOINTEGRITY)) { in jfs_reconfigure()
426 if (!sb_rdonly(sb)) { in jfs_reconfigure()
427 rc = jfs_umount_rw(sb); in jfs_reconfigure()
431 JFS_SBI(sb)->flag = flag; in jfs_reconfigure()
432 ret = jfs_mount_rw(sb, 1); in jfs_reconfigure()
436 JFS_SBI(sb)->flag = flag; in jfs_reconfigure()
441 static int jfs_fill_super(struct super_block *sb, struct fs_context *fc) in jfs_fill_super() argument
450 jfs_info("In jfs_read_super: s_flags=0x%lx", sb->s_flags); in jfs_fill_super()
456 sb->s_fs_info = sbi; in jfs_fill_super()
457 sb->s_max_links = JFS_LINK_MAX; in jfs_fill_super()
458 sb->s_time_min = 0; in jfs_fill_super()
459 sb->s_time_max = U32_MAX; in jfs_fill_super()
460 sbi->sb = sb; in jfs_fill_super()
474 if (!bdev_max_discard_sectors(sb->s_bdev)) { in jfs_fill_super()
483 sb->s_flags |= SB_POSIXACL; in jfs_fill_super()
494 sb_set_blocksize(sb, PSIZE); in jfs_fill_super()
499 sb->s_op = &jfs_super_operations; in jfs_fill_super()
500 sb->s_export_op = &jfs_export_operations; in jfs_fill_super()
501 sb->s_xattr = jfs_xattr_handlers; in jfs_fill_super()
503 sb->dq_op = &dquot_operations; in jfs_fill_super()
504 sb->s_qcop = &jfs_quotactl_ops; in jfs_fill_super()
505 sb->s_quota_types = QTYPE_MASK_USR | QTYPE_MASK_GRP; in jfs_fill_super()
511 inode = new_inode(sb); in jfs_fill_super()
516 inode->i_size = bdev_nr_bytes(sb->s_bdev); in jfs_fill_super()
523 rc = jfs_mount(sb); in jfs_fill_super()
529 if (sb_rdonly(sb)) in jfs_fill_super()
532 rc = jfs_mount_rw(sb, 0); in jfs_fill_super()
542 sb->s_magic = JFS_SUPER_MAGIC; in jfs_fill_super()
545 sb->s_d_op = &jfs_ci_dentry_operations; in jfs_fill_super()
547 inode = jfs_iget(sb, ROOT_I); in jfs_fill_super()
552 sb->s_root = d_make_root(inode); in jfs_fill_super()
553 if (!sb->s_root) in jfs_fill_super()
559 sb->s_maxbytes = min(((loff_t)sb->s_blocksize) << 40, MAX_LFS_FILESIZE); in jfs_fill_super()
560 sb->s_time_gran = 1; in jfs_fill_super()
567 rc = jfs_umount(sb); in jfs_fill_super()
582 static int jfs_freeze(struct super_block *sb) in jfs_freeze() argument
584 struct jfs_sb_info *sbi = JFS_SBI(sb); in jfs_freeze()
588 if (!sb_rdonly(sb)) { in jfs_freeze()
589 txQuiesce(sb); in jfs_freeze()
592 jfs_error(sb, "lmLogShutdown failed\n"); in jfs_freeze()
595 txResume(sb); in jfs_freeze()
599 rc = updateSuper(sb, FM_CLEAN); in jfs_freeze()
612 static int jfs_unfreeze(struct super_block *sb) in jfs_unfreeze() argument
614 struct jfs_sb_info *sbi = JFS_SBI(sb); in jfs_unfreeze()
618 if (!sb_rdonly(sb)) { in jfs_unfreeze()
619 rc = updateSuper(sb, FM_MOUNT); in jfs_unfreeze()
621 jfs_error(sb, "updateSuper failed\n"); in jfs_unfreeze()
626 jfs_error(sb, "lmLogInit failed\n"); in jfs_unfreeze()
628 txResume(sb); in jfs_unfreeze()
638 static int jfs_sync_fs(struct super_block *sb, int wait) in jfs_sync_fs() argument
640 struct jfs_log *log = JFS_SBI(sb)->log; in jfs_sync_fs()
648 dquot_writeback_dquots(sb, -1); in jfs_sync_fs()
694 static ssize_t jfs_quota_read(struct super_block *sb, int type, char *data, in jfs_quota_read() argument
697 struct inode *inode = sb_dqopt(sb)->files[type]; in jfs_quota_read()
698 sector_t blk = off >> sb->s_blocksize_bits; in jfs_quota_read()
700 int offset = off & (sb->s_blocksize - 1); in jfs_quota_read()
713 tocopy = min_t(size_t, sb->s_blocksize - offset, toread); in jfs_quota_read()
723 bh = sb_bread(sb, tmp_bh.b_blocknr); in jfs_quota_read()
738 static ssize_t jfs_quota_write(struct super_block *sb, int type, in jfs_quota_write() argument
741 struct inode *inode = sb_dqopt(sb)->files[type]; in jfs_quota_write()
742 sector_t blk = off >> sb->s_blocksize_bits; in jfs_quota_write()
744 int offset = off & (sb->s_blocksize - 1); in jfs_quota_write()
752 tocopy = min_t(size_t, sb->s_blocksize - offset, towrite); in jfs_quota_write()
759 if (offset || tocopy != sb->s_blocksize) in jfs_quota_write()
760 bh = sb_bread(sb, tmp_bh.b_blocknr); in jfs_quota_write()
762 bh = sb_getblk(sb, tmp_bh.b_blocknr); in jfs_quota_write()
797 static int jfs_quota_on(struct super_block *sb, int type, int format_id, in jfs_quota_on() argument
803 err = dquot_quota_on(sb, type, format_id, path); in jfs_quota_on()
818 static int jfs_quota_off(struct super_block *sb, int type) in jfs_quota_off() argument
820 struct inode *inode = sb_dqopt(sb)->files[type]; in jfs_quota_off()
826 err = dquot_quota_off(sb, type); in jfs_quota_off()
839 return dquot_quota_off(sb, type); in jfs_quota_off()
872 struct super_block *sb = fc->root->d_sb; in jfs_init_options() local
875 ctx->uid = JFS_SBI(sb)->uid; in jfs_init_options()
876 ctx->gid = JFS_SBI(sb)->gid; in jfs_init_options()
877 ctx->umask = JFS_SBI(sb)->umask; in jfs_init_options()
879 ctx->minblks_trim = JFS_SBI(sb)->minblks_trim; in jfs_init_options()
880 ctx->flag = JFS_SBI(sb)->flag; in jfs_init_options()