diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-16 22:19:33 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-16 22:19:33 -0400 |
commit | 84588e7a5d8220446d677d7b909a20ee7a4496b9 (patch) | |
tree | 5633f76cba4788cb2b073ac0c0f93541c267e7ee /fs/gfs2/quota.c | |
parent | a39ef1a7c6093bbd4e0a8197350b99cd635e5446 (diff) | |
parent | 3adc12e9648291149a1e3f354d0ad158fc2571e7 (diff) |
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs
Pull quota and udf updates from Jan Kara:
"The pull contains quota changes which complete unification of XFS and
VFS quota interfaces (so tools can use either interface to manipulate
any filesystem). There's also a patch to support project quotas in
VFS quota subsystem from Li Xi.
Finally there's a bunch of UDF fixes and cleanups and tiny cleanup in
reiserfs & ext3"
* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: (21 commits)
udf: Update ctime and mtime when directory is modified
udf: return correct errno for udf_update_inode()
ext3: Remove useless condition in if statement.
vfs: Add general support to enforce project quota limits
reiserfs: fix __RASSERT format string
udf: use int for allocated blocks instead of sector_t
udf: remove redundant buffer_head.h includes
udf: remove else after return in __load_block_bitmap()
udf: remove unused variable in udf_table_free_blocks()
quota: Fix maximum quota limit settings
quota: reorder flags in quota state
quota: paranoia: check quota tree root
quota: optimize i_dquot access
quota: Hook up Q_XSETQLIM for id 0 to ->set_info
xfs: Add support for Q_SETINFO
quota: Make ->set_info use structure with neccesary info to VFS and XFS
quota: Remove ->get_xstate and ->get_xstatev callbacks
gfs2: Convert to using ->get_state callback
xfs: Convert to using ->get_state callback
quota: Wire up Q_GETXSTATE and Q_GETXSTATV calls to work with ->get_state
...
Diffstat (limited to 'fs/gfs2/quota.c')
-rw-r--r-- | fs/gfs2/quota.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index 5c27e48aa76f..e3065cb9ab08 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c | |||
@@ -1494,32 +1494,34 @@ int gfs2_quotad(void *data) | |||
1494 | return 0; | 1494 | return 0; |
1495 | } | 1495 | } |
1496 | 1496 | ||
1497 | static int gfs2_quota_get_xstate(struct super_block *sb, | 1497 | static int gfs2_quota_get_state(struct super_block *sb, struct qc_state *state) |
1498 | struct fs_quota_stat *fqs) | ||
1499 | { | 1498 | { |
1500 | struct gfs2_sbd *sdp = sb->s_fs_info; | 1499 | struct gfs2_sbd *sdp = sb->s_fs_info; |
1501 | 1500 | ||
1502 | memset(fqs, 0, sizeof(struct fs_quota_stat)); | 1501 | memset(state, 0, sizeof(*state)); |
1503 | fqs->qs_version = FS_QSTAT_VERSION; | ||
1504 | 1502 | ||
1505 | switch (sdp->sd_args.ar_quota) { | 1503 | switch (sdp->sd_args.ar_quota) { |
1506 | case GFS2_QUOTA_ON: | 1504 | case GFS2_QUOTA_ON: |
1507 | fqs->qs_flags |= (FS_QUOTA_UDQ_ENFD | FS_QUOTA_GDQ_ENFD); | 1505 | state->s_state[USRQUOTA].flags |= QCI_LIMITS_ENFORCED; |
1506 | state->s_state[GRPQUOTA].flags |= QCI_LIMITS_ENFORCED; | ||
1508 | /*FALLTHRU*/ | 1507 | /*FALLTHRU*/ |
1509 | case GFS2_QUOTA_ACCOUNT: | 1508 | case GFS2_QUOTA_ACCOUNT: |
1510 | fqs->qs_flags |= (FS_QUOTA_UDQ_ACCT | FS_QUOTA_GDQ_ACCT); | 1509 | state->s_state[USRQUOTA].flags |= QCI_ACCT_ENABLED | |
1510 | QCI_SYSFILE; | ||
1511 | state->s_state[GRPQUOTA].flags |= QCI_ACCT_ENABLED | | ||
1512 | QCI_SYSFILE; | ||
1511 | break; | 1513 | break; |
1512 | case GFS2_QUOTA_OFF: | 1514 | case GFS2_QUOTA_OFF: |
1513 | break; | 1515 | break; |
1514 | } | 1516 | } |
1515 | |||
1516 | if (sdp->sd_quota_inode) { | 1517 | if (sdp->sd_quota_inode) { |
1517 | fqs->qs_uquota.qfs_ino = GFS2_I(sdp->sd_quota_inode)->i_no_addr; | 1518 | state->s_state[USRQUOTA].ino = |
1518 | fqs->qs_uquota.qfs_nblks = sdp->sd_quota_inode->i_blocks; | 1519 | GFS2_I(sdp->sd_quota_inode)->i_no_addr; |
1520 | state->s_state[USRQUOTA].blocks = sdp->sd_quota_inode->i_blocks; | ||
1519 | } | 1521 | } |
1520 | fqs->qs_uquota.qfs_nextents = 1; /* unsupported */ | 1522 | state->s_state[USRQUOTA].nextents = 1; /* unsupported */ |
1521 | fqs->qs_gquota = fqs->qs_uquota; /* its the same inode in both cases */ | 1523 | state->s_state[GRPQUOTA] = state->s_state[USRQUOTA]; |
1522 | fqs->qs_incoredqs = list_lru_count(&gfs2_qd_lru); | 1524 | state->s_incoredqs = list_lru_count(&gfs2_qd_lru); |
1523 | return 0; | 1525 | return 0; |
1524 | } | 1526 | } |
1525 | 1527 | ||
@@ -1664,7 +1666,7 @@ out_put: | |||
1664 | 1666 | ||
1665 | const struct quotactl_ops gfs2_quotactl_ops = { | 1667 | const struct quotactl_ops gfs2_quotactl_ops = { |
1666 | .quota_sync = gfs2_quota_sync, | 1668 | .quota_sync = gfs2_quota_sync, |
1667 | .get_xstate = gfs2_quota_get_xstate, | 1669 | .get_state = gfs2_quota_get_state, |
1668 | .get_dqblk = gfs2_get_dqblk, | 1670 | .get_dqblk = gfs2_get_dqblk, |
1669 | .set_dqblk = gfs2_set_dqblk, | 1671 | .set_dqblk = gfs2_set_dqblk, |
1670 | }; | 1672 | }; |