diff options
author | Arkadiusz Mi?kiewicz <arekm@maven.pl> | 2010-09-26 02:10:18 -0400 |
---|---|---|
committer | Alex Elder <aelder@sgi.com> | 2010-10-18 16:08:08 -0400 |
commit | 6743099ce57a40509a86849a22317ed4b7516911 (patch) | |
tree | c26c8192713b02cc7a96a4094dcf896395cc7f81 /fs/xfs/xfs_vnodeops.c | |
parent | 1a1a3e97bad42e92cd2f32e81c396c8ee0bddb28 (diff) |
xfs: Extend project quotas to support 32bit project ids
This patch adds support for 32bit project quota identifiers.
On disk format is backward compatible with 16bit projid numbers. projid
on disk is now kept in two 16bit values - di_projid_lo (which holds the
same position as old 16bit projid value) and new di_projid_hi (takes
existing padding) and converts from/to 32bit value on the fly.
xfs_admin (for existing fs), mkfs.xfs (for new fs) needs to be used
to enable PROJID32BIT support.
Signed-off-by: Arkadiusz MiĆkiewicz <arekm@maven.pl>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Alex Elder <aelder@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_vnodeops.c')
-rw-r--r-- | fs/xfs/xfs_vnodeops.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c index f4195f6b8bc4..8e4a63c4151a 100644 --- a/fs/xfs/xfs_vnodeops.c +++ b/fs/xfs/xfs_vnodeops.c | |||
@@ -114,7 +114,7 @@ xfs_setattr( | |||
114 | */ | 114 | */ |
115 | ASSERT(udqp == NULL); | 115 | ASSERT(udqp == NULL); |
116 | ASSERT(gdqp == NULL); | 116 | ASSERT(gdqp == NULL); |
117 | code = xfs_qm_vop_dqalloc(ip, uid, gid, ip->i_d.di_projid, | 117 | code = xfs_qm_vop_dqalloc(ip, uid, gid, xfs_get_projid(ip), |
118 | qflags, &udqp, &gdqp); | 118 | qflags, &udqp, &gdqp); |
119 | if (code) | 119 | if (code) |
120 | return code; | 120 | return code; |
@@ -1268,7 +1268,7 @@ xfs_create( | |||
1268 | boolean_t unlock_dp_on_error = B_FALSE; | 1268 | boolean_t unlock_dp_on_error = B_FALSE; |
1269 | uint cancel_flags; | 1269 | uint cancel_flags; |
1270 | int committed; | 1270 | int committed; |
1271 | xfs_prid_t prid; | 1271 | prid_t prid; |
1272 | struct xfs_dquot *udqp = NULL; | 1272 | struct xfs_dquot *udqp = NULL; |
1273 | struct xfs_dquot *gdqp = NULL; | 1273 | struct xfs_dquot *gdqp = NULL; |
1274 | uint resblks; | 1274 | uint resblks; |
@@ -1281,9 +1281,9 @@ xfs_create( | |||
1281 | return XFS_ERROR(EIO); | 1281 | return XFS_ERROR(EIO); |
1282 | 1282 | ||
1283 | if (dp->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) | 1283 | if (dp->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) |
1284 | prid = dp->i_d.di_projid; | 1284 | prid = xfs_get_projid(dp); |
1285 | else | 1285 | else |
1286 | prid = dfltprid; | 1286 | prid = XFS_PROJID_DEFAULT; |
1287 | 1287 | ||
1288 | /* | 1288 | /* |
1289 | * Make sure that we have allocated dquot(s) on disk. | 1289 | * Make sure that we have allocated dquot(s) on disk. |
@@ -1882,7 +1882,7 @@ xfs_link( | |||
1882 | * the tree quota mechanism could be circumvented. | 1882 | * the tree quota mechanism could be circumvented. |
1883 | */ | 1883 | */ |
1884 | if (unlikely((tdp->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) && | 1884 | if (unlikely((tdp->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) && |
1885 | (tdp->i_d.di_projid != sip->i_d.di_projid))) { | 1885 | (xfs_get_projid(tdp) != xfs_get_projid(sip)))) { |
1886 | error = XFS_ERROR(EXDEV); | 1886 | error = XFS_ERROR(EXDEV); |
1887 | goto error_return; | 1887 | goto error_return; |
1888 | } | 1888 | } |
@@ -1956,7 +1956,7 @@ xfs_symlink( | |||
1956 | int byte_cnt; | 1956 | int byte_cnt; |
1957 | int n; | 1957 | int n; |
1958 | xfs_buf_t *bp; | 1958 | xfs_buf_t *bp; |
1959 | xfs_prid_t prid; | 1959 | prid_t prid; |
1960 | struct xfs_dquot *udqp, *gdqp; | 1960 | struct xfs_dquot *udqp, *gdqp; |
1961 | uint resblks; | 1961 | uint resblks; |
1962 | 1962 | ||
@@ -1979,9 +1979,9 @@ xfs_symlink( | |||
1979 | 1979 | ||
1980 | udqp = gdqp = NULL; | 1980 | udqp = gdqp = NULL; |
1981 | if (dp->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) | 1981 | if (dp->i_d.di_flags & XFS_DIFLAG_PROJINHERIT) |
1982 | prid = dp->i_d.di_projid; | 1982 | prid = xfs_get_projid(dp); |
1983 | else | 1983 | else |
1984 | prid = (xfs_prid_t)dfltprid; | 1984 | prid = XFS_PROJID_DEFAULT; |
1985 | 1985 | ||
1986 | /* | 1986 | /* |
1987 | * Make sure that we have allocated dquot(s) on disk. | 1987 | * Make sure that we have allocated dquot(s) on disk. |