Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 7348
b: refs/heads/master
c: 8fc2751
h: refs/heads/master
v: v3
  • Loading branch information
Mark Bellon authored and Linus Torvalds committed Sep 7, 2005
1 parent f342c58 commit dbd2e21
Show file tree
Hide file tree
Showing 7 changed files with 187 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c92371566ea505cf455c208cdfb89046b3db87de
refs/heads/master: 8fc2751beb0941966d3a97b26544e8585e428c08
59 changes: 52 additions & 7 deletions trunk/fs/ext2/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <linux/config.h>
#include <linux/module.h>
#include <linux/string.h>
#include <linux/fs.h>
#include <linux/slab.h>
#include <linux/init.h>
#include <linux/blkdev.h>
Expand All @@ -27,6 +28,8 @@
#include <linux/buffer_head.h>
#include <linux/smp_lock.h>
#include <linux/vfs.h>
#include <linux/seq_file.h>
#include <linux/mount.h>
#include <asm/uaccess.h>
#include "ext2.h"
#include "xattr.h"
Expand Down Expand Up @@ -201,6 +204,26 @@ static void ext2_clear_inode(struct inode *inode)
#endif
}

static int ext2_show_options(struct seq_file *seq, struct vfsmount *vfs)
{
struct ext2_sb_info *sbi = EXT2_SB(vfs->mnt_sb);

if (sbi->s_mount_opt & EXT2_MOUNT_GRPID)
seq_puts(seq, ",grpid");
else
seq_puts(seq, ",nogrpid");

#if defined(CONFIG_QUOTA)
if (sbi->s_mount_opt & EXT2_MOUNT_USRQUOTA)
seq_puts(seq, ",usrquota");

if (sbi->s_mount_opt & EXT2_MOUNT_GRPQUOTA)
seq_puts(seq, ",grpquota");
#endif

return 0;
}

#ifdef CONFIG_QUOTA
static ssize_t ext2_quota_read(struct super_block *sb, int type, char *data, size_t len, loff_t off);
static ssize_t ext2_quota_write(struct super_block *sb, int type, const char *data, size_t len, loff_t off);
Expand All @@ -218,6 +241,7 @@ static struct super_operations ext2_sops = {
.statfs = ext2_statfs,
.remount_fs = ext2_remount,
.clear_inode = ext2_clear_inode,
.show_options = ext2_show_options,
#ifdef CONFIG_QUOTA
.quota_read = ext2_quota_read,
.quota_write = ext2_quota_write,
Expand Down Expand Up @@ -256,10 +280,11 @@ static unsigned long get_sb_block(void **data)

enum {
Opt_bsd_df, Opt_minix_df, Opt_grpid, Opt_nogrpid,
Opt_resgid, Opt_resuid, Opt_sb, Opt_err_cont, Opt_err_panic, Opt_err_ro,
Opt_nouid32, Opt_check, Opt_nocheck, Opt_debug, Opt_oldalloc, Opt_orlov, Opt_nobh,
Opt_user_xattr, Opt_nouser_xattr, Opt_acl, Opt_noacl, Opt_xip,
Opt_ignore, Opt_err,
Opt_resgid, Opt_resuid, Opt_sb, Opt_err_cont, Opt_err_panic,
Opt_err_ro, Opt_nouid32, Opt_check, Opt_nocheck, Opt_debug,
Opt_oldalloc, Opt_orlov, Opt_nobh, Opt_user_xattr, Opt_nouser_xattr,
Opt_acl, Opt_noacl, Opt_xip, Opt_ignore, Opt_err, Opt_quota,
Opt_usrquota, Opt_grpquota
};

static match_table_t tokens = {
Expand Down Expand Up @@ -288,10 +313,10 @@ static match_table_t tokens = {
{Opt_acl, "acl"},
{Opt_noacl, "noacl"},
{Opt_xip, "xip"},
{Opt_ignore, "grpquota"},
{Opt_grpquota, "grpquota"},
{Opt_ignore, "noquota"},
{Opt_ignore, "quota"},
{Opt_ignore, "usrquota"},
{Opt_quota, "quota"},
{Opt_usrquota, "usrquota"},
{Opt_err, NULL}
};

Expand Down Expand Up @@ -406,6 +431,26 @@ static int parse_options (char * options,
printk("EXT2 xip option not supported\n");
#endif
break;

#if defined(CONFIG_QUOTA)
case Opt_quota:
case Opt_usrquota:
set_opt(sbi->s_mount_opt, USRQUOTA);
break;

case Opt_grpquota:
set_opt(sbi->s_mount_opt, GRPQUOTA);
break;
#else
case Opt_quota:
case Opt_usrquota:
case Opt_grpquota:
printk(KERN_ERR
"EXT2-fs: quota operations not supported.\n");

break;
#endif

case Opt_ignore:
break;
default:
Expand Down
92 changes: 81 additions & 11 deletions trunk/fs/ext3/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <linux/mount.h>
#include <linux/namei.h>
#include <linux/quotaops.h>
#include <linux/seq_file.h>
#include <asm/uaccess.h>
#include "xattr.h"
#include "acl.h"
Expand Down Expand Up @@ -509,8 +510,41 @@ static void ext3_clear_inode(struct inode *inode)
kfree(rsv);
}

#ifdef CONFIG_QUOTA
static int ext3_show_options(struct seq_file *seq, struct vfsmount *vfs)
{
struct ext3_sb_info *sbi = EXT3_SB(vfs->mnt_sb);

if (sbi->s_mount_opt & EXT3_MOUNT_JOURNAL_DATA)
seq_puts(seq, ",data=journal");

if (sbi->s_mount_opt & EXT3_MOUNT_ORDERED_DATA)
seq_puts(seq, ",data=ordered");

if (sbi->s_mount_opt & EXT3_MOUNT_WRITEBACK_DATA)
seq_puts(seq, ",data=writeback");

#if defined(CONFIG_QUOTA)
if (sbi->s_jquota_fmt)
seq_printf(seq, ",jqfmt=%s",
(sbi->s_jquota_fmt == QFMT_VFS_OLD) ? "vfsold": "vfsv0");

if (sbi->s_qf_names[USRQUOTA])
seq_printf(seq, ",usrjquota=%s", sbi->s_qf_names[USRQUOTA]);

if (sbi->s_qf_names[GRPQUOTA])
seq_printf(seq, ",grpjquota=%s", sbi->s_qf_names[GRPQUOTA]);

if (sbi->s_mount_opt & EXT3_MOUNT_USRQUOTA)
seq_puts(seq, ",usrquota");

if (sbi->s_mount_opt & EXT3_MOUNT_GRPQUOTA)
seq_puts(seq, ",grpquota");
#endif

return 0;
}

#ifdef CONFIG_QUOTA
#define QTYPE2NAME(t) ((t)==USRQUOTA?"user":"group")
#define QTYPE2MOPT(on, t) ((t)==USRQUOTA?((on)##USRJQUOTA):((on)##GRPJQUOTA))

Expand Down Expand Up @@ -569,6 +603,7 @@ static struct super_operations ext3_sops = {
.statfs = ext3_statfs,
.remount_fs = ext3_remount,
.clear_inode = ext3_clear_inode,
.show_options = ext3_show_options,
#ifdef CONFIG_QUOTA
.quota_read = ext3_quota_read,
.quota_write = ext3_quota_write,
Expand All @@ -590,7 +625,8 @@ enum {
Opt_abort, Opt_data_journal, Opt_data_ordered, Opt_data_writeback,
Opt_usrjquota, Opt_grpjquota, Opt_offusrjquota, Opt_offgrpjquota,
Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0, Opt_quota, Opt_noquota,
Opt_ignore, Opt_barrier, Opt_err, Opt_resize,
Opt_ignore, Opt_barrier, Opt_err, Opt_resize, Opt_usrquota,
Opt_grpquota
};

static match_table_t tokens = {
Expand Down Expand Up @@ -634,10 +670,10 @@ static match_table_t tokens = {
{Opt_grpjquota, "grpjquota=%s"},
{Opt_jqfmt_vfsold, "jqfmt=vfsold"},
{Opt_jqfmt_vfsv0, "jqfmt=vfsv0"},
{Opt_quota, "grpquota"},
{Opt_grpquota, "grpquota"},
{Opt_noquota, "noquota"},
{Opt_quota, "quota"},
{Opt_quota, "usrquota"},
{Opt_usrquota, "usrquota"},
{Opt_barrier, "barrier=%u"},
{Opt_err, NULL},
{Opt_resize, "resize"},
Expand Down Expand Up @@ -903,7 +939,13 @@ static int parse_options (char * options, struct super_block *sb,
sbi->s_jquota_fmt = QFMT_VFS_V0;
break;
case Opt_quota:
case Opt_usrquota:
set_opt(sbi->s_mount_opt, QUOTA);
set_opt(sbi->s_mount_opt, USRQUOTA);
break;
case Opt_grpquota:
set_opt(sbi->s_mount_opt, QUOTA);
set_opt(sbi->s_mount_opt, GRPQUOTA);
break;
case Opt_noquota:
if (sb_any_quota_enabled(sb)) {
Expand All @@ -912,8 +954,13 @@ static int parse_options (char * options, struct super_block *sb,
return 0;
}
clear_opt(sbi->s_mount_opt, QUOTA);
clear_opt(sbi->s_mount_opt, USRQUOTA);
clear_opt(sbi->s_mount_opt, GRPQUOTA);
break;
#else
case Opt_quota:
case Opt_usrquota:
case Opt_grpquota:
case Opt_usrjquota:
case Opt_grpjquota:
case Opt_offusrjquota:
Expand All @@ -924,7 +971,6 @@ static int parse_options (char * options, struct super_block *sb,
"EXT3-fs: journalled quota options not "
"supported.\n");
break;
case Opt_quota:
case Opt_noquota:
break;
#endif
Expand Down Expand Up @@ -962,14 +1008,38 @@ static int parse_options (char * options, struct super_block *sb,
}
}
#ifdef CONFIG_QUOTA
if (!sbi->s_jquota_fmt && (sbi->s_qf_names[USRQUOTA] ||
sbi->s_qf_names[GRPQUOTA])) {
printk(KERN_ERR
"EXT3-fs: journalled quota format not specified.\n");
return 0;
if (sbi->s_qf_names[USRQUOTA] || sbi->s_qf_names[GRPQUOTA]) {
if ((sbi->s_mount_opt & EXT3_MOUNT_USRQUOTA) &&
sbi->s_qf_names[USRQUOTA])
clear_opt(sbi->s_mount_opt, USRQUOTA);

if ((sbi->s_mount_opt & EXT3_MOUNT_GRPQUOTA) &&
sbi->s_qf_names[GRPQUOTA])
clear_opt(sbi->s_mount_opt, GRPQUOTA);

if ((sbi->s_qf_names[USRQUOTA] &&
(sbi->s_mount_opt & EXT3_MOUNT_GRPQUOTA)) ||
(sbi->s_qf_names[GRPQUOTA] &&
(sbi->s_mount_opt & EXT3_MOUNT_USRQUOTA))) {
printk(KERN_ERR "EXT3-fs: old and new quota "
"format mixing.\n");
return 0;
}

if (!sbi->s_jquota_fmt) {
printk(KERN_ERR "EXT3-fs: journalled quota format "
"not specified.\n");
return 0;
}
} else {
if (sbi->s_jquota_fmt) {
printk(KERN_ERR "EXT3-fs: journalled quota format "
"specified with no journalling "
"enabled.\n");
return 0;
}
}
#endif

return 1;
}

Expand Down
3 changes: 3 additions & 0 deletions trunk/fs/jfs/jfs_filsys.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
#define JFS_ERR_CONTINUE 0x00000004 /* continue */
#define JFS_ERR_PANIC 0x00000008 /* panic */

#define JFS_USRQUOTA 0x00000010
#define JFS_GRPQUOTA 0x00000020

/* platform option (conditional compilation) */
#define JFS_AIX 0x80000000 /* AIX support */
/* POSIX name/directory support */
Expand Down
48 changes: 45 additions & 3 deletions trunk/fs/jfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@
#include <linux/parser.h>
#include <linux/completion.h>
#include <linux/vfs.h>
#include <linux/mount.h>
#include <linux/moduleparam.h>
#include <linux/posix_acl.h>
#include <asm/uaccess.h>
#include <linux/seq_file.h>

#include "jfs_incore.h"
#include "jfs_filsys.h"
Expand Down Expand Up @@ -192,7 +194,8 @@ static void jfs_put_super(struct super_block *sb)

enum {
Opt_integrity, Opt_nointegrity, Opt_iocharset, Opt_resize,
Opt_resize_nosize, Opt_errors, Opt_ignore, Opt_err,
Opt_resize_nosize, Opt_errors, Opt_ignore, Opt_err, Opt_quota,
Opt_usrquota, Opt_grpquota
};

static match_table_t tokens = {
Expand All @@ -204,8 +207,8 @@ static match_table_t tokens = {
{Opt_errors, "errors=%s"},
{Opt_ignore, "noquota"},
{Opt_ignore, "quota"},
{Opt_ignore, "usrquota"},
{Opt_ignore, "grpquota"},
{Opt_usrquota, "usrquota"},
{Opt_grpquota, "grpquota"},
{Opt_err, NULL}
};

Expand Down Expand Up @@ -293,6 +296,24 @@ static int parse_options(char *options, struct super_block *sb, s64 *newLVSize,
}
break;
}

#if defined(CONFIG_QUOTA)
case Opt_quota:
case Opt_usrquota:
*flag |= JFS_USRQUOTA;
break;
case Opt_grpquota:
*flag |= JFS_GRPQUOTA;
break;
#else
case Opt_usrquota:
case Opt_grpquota:
case Opt_quota:
printk(KERN_ERR
"JFS: quota operations not supported\n");
break;
#endif

default:
printk("jfs: Unrecognized mount option \"%s\" "
" or missing value\n", p);
Expand Down Expand Up @@ -539,6 +560,26 @@ static int jfs_sync_fs(struct super_block *sb, int wait)
return 0;
}

static int jfs_show_options(struct seq_file *seq, struct vfsmount *vfs)
{
struct jfs_sb_info *sbi = JFS_SBI(vfs->mnt_sb);

if (sbi->flag & JFS_NOINTEGRITY)
seq_puts(seq, ",nointegrity");
else
seq_puts(seq, ",integrity");

#if defined(CONFIG_QUOTA)
if (sbi->flag & JFS_USRQUOTA)
seq_puts(seq, ",usrquota");

if (sbi->flag & JFS_GRPQUOTA)
seq_puts(seq, ",grpquota");
#endif

return 0;
}

static struct super_operations jfs_super_operations = {
.alloc_inode = jfs_alloc_inode,
.destroy_inode = jfs_destroy_inode,
Expand All @@ -552,6 +593,7 @@ static struct super_operations jfs_super_operations = {
.unlockfs = jfs_unlockfs,
.statfs = jfs_statfs,
.remount_fs = jfs_remount,
.show_options = jfs_show_options
};

static struct export_operations jfs_export_operations = {
Expand Down
3 changes: 3 additions & 0 deletions trunk/include/linux/ext2_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,9 @@ struct ext2_inode {
#define EXT2_MOUNT_XATTR_USER 0x004000 /* Extended user attributes */
#define EXT2_MOUNT_POSIX_ACL 0x008000 /* POSIX Access Control Lists */
#define EXT2_MOUNT_XIP 0x010000 /* Execute in place */
#define EXT2_MOUNT_USRQUOTA 0x020000 /* user quota */
#define EXT2_MOUNT_GRPQUOTA 0x040000 /* group quota */


#define clear_opt(o, opt) o &= ~EXT2_MOUNT_##opt
#define set_opt(o, opt) o |= EXT2_MOUNT_##opt
Expand Down
2 changes: 2 additions & 0 deletions trunk/include/linux/ext3_fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,8 @@ struct ext3_inode {
#define EXT3_MOUNT_BARRIER 0x20000 /* Use block barriers */
#define EXT3_MOUNT_NOBH 0x40000 /* No bufferheads */
#define EXT3_MOUNT_QUOTA 0x80000 /* Some quota option set */
#define EXT3_MOUNT_USRQUOTA 0x100000 /* "old" user quota */
#define EXT3_MOUNT_GRPQUOTA 0x200000 /* "old" group quota */

/* Compatibility, for having both ext2_fs.h and ext3_fs.h included at once */
#ifndef _LINUX_EXT2_FS_H
Expand Down

0 comments on commit dbd2e21

Please sign in to comment.