switch (opt) { case Opt_integrity: if (result.negated)
ctx->flag |= JFS_NOINTEGRITY; else
ctx->flag &= ~JFS_NOINTEGRITY; break; case Opt_ignore: /* Silently ignore the quota options */ /* Don't do anything ;-) */ break; case Opt_iocharset: if (ctx->nls_map && ctx->nls_map != (void *) -1) {
unload_nls(ctx->nls_map);
ctx->nls_map = NULL;
} if (!strcmp(param->string, "none"))
ctx->nls_map = NULL; else {
nls_map = load_nls(param->string); if (!nls_map) {
pr_err("JFS: charset not found\n"); return -EINVAL;
}
ctx->nls_map = nls_map;
} break; case Opt_resize: if (!reconfigure) return -EINVAL;
ctx->resize = true;
ctx->newLVSize = result.uint_64; break; case Opt_resize_nosize: if (!reconfigure) return -EINVAL;
ctx->resize = true; break; case Opt_errors:
ctx->flag &= ~JFS_ERR_MASK;
ctx->flag |= result.uint_32; break;
#ifdef CONFIG_QUOTA case Opt_quota: case Opt_usrquota:
ctx->flag |= JFS_USRQUOTA; break; case Opt_grpquota:
ctx->flag |= JFS_GRPQUOTA; break; #else case Opt_usrquota: case Opt_grpquota: case Opt_quota:
pr_err("JFS: quota operations not supported\n"); break; #endif case Opt_uid:
ctx->uid = result.uid; break;
case Opt_gid:
ctx->gid = result.gid; break;
case Opt_umask: if (result.uint_32 & ~0777) {
pr_err("JFS: Invalid value of umask\n"); return -EINVAL;
}
ctx->umask = result.uint_32; break;
case Opt_discard: /* if set to 1, even copying files will cause * trimming :O * -> user has more control over the online trimming
*/
ctx->minblks_trim = 64;
ctx->flag |= JFS_DISCARD; break;
case Opt_nodiscard:
ctx->flag &= ~JFS_DISCARD; break;
case Opt_discard_minblk:
ctx->minblks_trim = result.uint_32;
ctx->flag |= JFS_DISCARD; break;
default: return -EINVAL;
}
return 0;
}
staticint jfs_reconfigure(struct fs_context *fc)
{ struct jfs_context *ctx = fc->fs_private; struct super_block *sb = fc->root->d_sb; int readonly = fc->sb_flags & SB_RDONLY; int rc = 0; int flag = ctx->flag; int ret;
sync_filesystem(sb);
/* Transfer results of parsing to the sbi */
JFS_SBI(sb)->flag = ctx->flag;
JFS_SBI(sb)->uid = ctx->uid;
JFS_SBI(sb)->gid = ctx->gid;
JFS_SBI(sb)->umask = ctx->umask;
JFS_SBI(sb)->minblks_trim = ctx->minblks_trim; if (ctx->nls_map != (void *) -1) {
unload_nls(JFS_SBI(sb)->nls_tab);
JFS_SBI(sb)->nls_tab = ctx->nls_map;
}
ctx->nls_map = NULL;
if (ctx->resize) { if (sb_rdonly(sb)) {
pr_err("JFS: resize requires volume to be mounted read-write\n"); return -EROFS;
}
if (!ctx->newLVSize) {
ctx->newLVSize = sb_bdev_nr_blocks(sb); if (ctx->newLVSize == 0)
pr_err("JFS: Cannot determine volume size\n");
}
rc = jfs_extendfs(sb, ctx->newLVSize, 0); if (rc) return rc;
}
if (sb_rdonly(sb) && !readonly) { /* * Invalidate any previously read metadata. fsck may have * changed the on-disk data since we mounted r/o
*/
truncate_inode_pages(JFS_SBI(sb)->direct_inode->i_mapping, 0);
JFS_SBI(sb)->flag = flag;
ret = jfs_mount_rw(sb, 1);
/* mark the fs r/w for quota activity */
sb->s_flags &= ~SB_RDONLY;
dquot_resume(sb, -1); return ret;
} if (!sb_rdonly(sb) && readonly) {
rc = dquot_suspend(sb, -1); if (rc < 0) return rc;
rc = jfs_umount_rw(sb);
JFS_SBI(sb)->flag = flag; return rc;
} if ((JFS_SBI(sb)->flag & JFS_NOINTEGRITY) != (flag & JFS_NOINTEGRITY)) { if (!sb_rdonly(sb)) {
rc = jfs_umount_rw(sb); if (rc) return rc;
rc = jfs_mount(sb); if (rc) { if (!silent)
jfs_err("jfs_mount failed w/return code = %d", rc); goto out_mount_failed;
} if (sb_rdonly(sb))
sbi->log = NULL; else {
rc = jfs_mount_rw(sb, 0); if (rc) { if (!silent) {
jfs_err("jfs_mount_rw failed, return code = %d",
rc);
} goto out_no_rw;
}
}
sb->s_magic = JFS_SUPER_MAGIC;
if (sbi->mntflag & JFS_OS2)
set_default_d_op(sb, &jfs_ci_dentry_operations);
inode = jfs_iget(sb, ROOT_I); if (IS_ERR(inode)) {
ret = PTR_ERR(inode); goto out_no_rw;
}
sb->s_root = d_make_root(inode); if (!sb->s_root) goto out_no_root;
/* logical blocks are represented by 40 bits in pxd_t, etc. * and page cache is indexed by long
*/
sb->s_maxbytes = min(((loff_t)sb->s_blocksize) << 40, MAX_LFS_FILESIZE);
sb->s_time_gran = 1; return 0;
out_no_root:
jfs_err("jfs_read_super: get root dentry failed");
/* log == NULL indicates read-only mount */ if (log) { /* * Write quota structures to quota file, sync_blockdev() will * write them to disk later
*/
dquot_writeback_dquots(sb, -1);
jfs_flush_journal(log, wait);
jfs_syncpt(log, 0);
}
if (uid_valid(sbi->uid))
seq_printf(seq, ",uid=%d", from_kuid(&init_user_ns, sbi->uid)); if (gid_valid(sbi->gid))
seq_printf(seq, ",gid=%d", from_kgid(&init_user_ns, sbi->gid)); if (sbi->umask != -1)
seq_printf(seq, ",umask=%03o", sbi->umask); if (sbi->flag & JFS_NOINTEGRITY)
seq_puts(seq, ",nointegrity"); if (sbi->flag & JFS_DISCARD)
seq_printf(seq, ",discard=%u", sbi->minblks_trim); if (sbi->nls_tab)
seq_printf(seq, ",iocharset=%s", sbi->nls_tab->charset); if (sbi->flag & JFS_ERR_CONTINUE)
seq_printf(seq, ",errors=continue"); if (sbi->flag & JFS_ERR_PANIC)
seq_printf(seq, ",errors=panic");
#ifdef CONFIG_QUOTA if (sbi->flag & JFS_USRQUOTA)
seq_puts(seq, ",usrquota");
if (sbi->flag & JFS_GRPQUOTA)
seq_puts(seq, ",grpquota"); #endif
return 0;
}
#ifdef CONFIG_QUOTA
/* Read data from quotafile - avoid pagecache and such because we cannot afford * acquiring the locks... As quota files are never truncated and quota code * itself serializes the operations (and no one else should touch the files)
* we don't have to be afraid of races */ static ssize_t jfs_quota_read(struct super_block *sb, int type, char *data,
size_t len, loff_t off)
{ struct inode *inode = sb_dqopt(sb)->files[type];
sector_t blk = off >> sb->s_blocksize_bits; int err = 0; int offset = off & (sb->s_blocksize - 1); int tocopy;
size_t toread; struct buffer_head tmp_bh; struct buffer_head *bh;
loff_t i_size = i_size_read(inode);
if (off > i_size) return 0; if (off+len > i_size)
len = i_size-off;
toread = len; while (toread > 0) {
tocopy = min_t(size_t, sb->s_blocksize - offset, toread);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.