aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/inode.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2013-10-02 06:13:25 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2013-10-02 06:13:25 -0400
commit7b9cff467144c8c62268db1b0948df089caa0999 (patch)
treeabe7408d4cf28502bdbfc91983c02869898ccced /fs/gfs2/inode.c
parentaf5c269799feaef110e59ce55b497cdd08712b0c (diff)
GFS2: Add allocation parameters structure
This patch adds a structure to contain allocation parameters with the intention of future expansion of this structure. The idea is that we should be able to add more information about the allocation in the future in order to allow the allocator to make a better job of placing the requests on-disk. There is no functional difference from applying this patch. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/inode.c')
-rw-r--r--fs/gfs2/inode.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index 4b79c19100d2..5a7ca3d1d1cf 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -379,6 +379,7 @@ static void munge_mode_uid_gid(const struct gfs2_inode *dip,
379static int alloc_dinode(struct gfs2_inode *ip, u32 flags) 379static int alloc_dinode(struct gfs2_inode *ip, u32 flags)
380{ 380{
381 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); 381 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
382 struct gfs2_alloc_parms ap = { .target = RES_DINODE, .aflags = flags, };
382 int error; 383 int error;
383 int dblocks = 1; 384 int dblocks = 1;
384 385
@@ -386,7 +387,7 @@ static int alloc_dinode(struct gfs2_inode *ip, u32 flags)
386 if (error) 387 if (error)
387 goto out; 388 goto out;
388 389
389 error = gfs2_inplace_reserve(ip, RES_DINODE, flags); 390 error = gfs2_inplace_reserve(ip, &ap);
390 if (error) 391 if (error)
391 goto out_quota; 392 goto out_quota;
392 393
@@ -472,6 +473,7 @@ static int link_dinode(struct gfs2_inode *dip, const struct qstr *name,
472 struct gfs2_inode *ip, int arq) 473 struct gfs2_inode *ip, int arq)
473{ 474{
474 struct gfs2_sbd *sdp = GFS2_SB(&dip->i_inode); 475 struct gfs2_sbd *sdp = GFS2_SB(&dip->i_inode);
476 struct gfs2_alloc_parms ap = { .target = sdp->sd_max_dirres, };
475 int error; 477 int error;
476 478
477 if (arq) { 479 if (arq) {
@@ -479,7 +481,7 @@ static int link_dinode(struct gfs2_inode *dip, const struct qstr *name,
479 if (error) 481 if (error)
480 goto fail_quota_locks; 482 goto fail_quota_locks;
481 483
482 error = gfs2_inplace_reserve(dip, sdp->sd_max_dirres, 0); 484 error = gfs2_inplace_reserve(dip, &ap);
483 if (error) 485 if (error)
484 goto fail_quota_locks; 486 goto fail_quota_locks;
485 487
@@ -874,11 +876,12 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir,
874 error = 0; 876 error = 0;
875 877
876 if (alloc_required) { 878 if (alloc_required) {
879 struct gfs2_alloc_parms ap = { .target = sdp->sd_max_dirres, };
877 error = gfs2_quota_lock_check(dip); 880 error = gfs2_quota_lock_check(dip);
878 if (error) 881 if (error)
879 goto out_gunlock; 882 goto out_gunlock;
880 883
881 error = gfs2_inplace_reserve(dip, sdp->sd_max_dirres, 0); 884 error = gfs2_inplace_reserve(dip, &ap);
882 if (error) 885 if (error)
883 goto out_gunlock_q; 886 goto out_gunlock_q;
884 887
@@ -1387,11 +1390,12 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry,
1387 goto out_gunlock; 1390 goto out_gunlock;
1388 1391
1389 if (alloc_required) { 1392 if (alloc_required) {
1393 struct gfs2_alloc_parms ap = { .target = sdp->sd_max_dirres, };
1390 error = gfs2_quota_lock_check(ndip); 1394 error = gfs2_quota_lock_check(ndip);
1391 if (error) 1395 if (error)
1392 goto out_gunlock; 1396 goto out_gunlock;
1393 1397
1394 error = gfs2_inplace_reserve(ndip, sdp->sd_max_dirres, 0); 1398 error = gfs2_inplace_reserve(ndip, &ap);
1395 if (error) 1399 if (error)
1396 goto out_gunlock_q; 1400 goto out_gunlock_q;
1397 1401