aboutsummaryrefslogtreecommitdiffstats
path: root/fs/gfs2/inode.c
diff options
context:
space:
mode:
authorSteven Whitehouse <swhiteho@redhat.com>2012-10-31 06:37:10 -0400
committerSteven Whitehouse <swhiteho@redhat.com>2012-11-07 08:33:17 -0500
commit9dbe9610b9df4efe0946299804ed46bb8f91dec2 (patch)
tree8d54797420ed9d0aef1c6bdd8f3b8dd5e9938d0a /fs/gfs2/inode.c
parentc9aecf73717f55e41ac11682a50bef8594547025 (diff)
GFS2: Add Orlov allocator
Just like ext3, this works on the root directory and any directory with the +T flag set. Also, just like ext3, any subdirectory created in one of the just mentioned cases will be allocated to a random resource group (GFS2 equivalent of a block group). If you are creating a set of directories, each of which will contain a job running on a different node, then by setting +T on the parent directory before creating the subdirectories, each will land up in a different resource group, and thus resource group contention between nodes will be kept to a minimum. Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2/inode.c')
-rw-r--r--fs/gfs2/inode.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index 749b05a960ef..ef3ce00bb528 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -385,13 +385,13 @@ static void munge_mode_uid_gid(const struct gfs2_inode *dip,
385 inode->i_gid = current_fsgid(); 385 inode->i_gid = current_fsgid();
386} 386}
387 387
388static int alloc_dinode(struct gfs2_inode *ip) 388static int alloc_dinode(struct gfs2_inode *ip, u32 flags)
389{ 389{
390 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode); 390 struct gfs2_sbd *sdp = GFS2_SB(&ip->i_inode);
391 int error; 391 int error;
392 int dblocks = 1; 392 int dblocks = 1;
393 393
394 error = gfs2_inplace_reserve(ip, RES_DINODE); 394 error = gfs2_inplace_reserve(ip, RES_DINODE, flags);
395 if (error) 395 if (error)
396 goto out; 396 goto out;
397 397
@@ -560,7 +560,7 @@ static int link_dinode(struct gfs2_inode *dip, const struct qstr *name,
560 if (error) 560 if (error)
561 goto fail_quota_locks; 561 goto fail_quota_locks;
562 562
563 error = gfs2_inplace_reserve(dip, sdp->sd_max_dirres); 563 error = gfs2_inplace_reserve(dip, sdp->sd_max_dirres, 0);
564 if (error) 564 if (error)
565 goto fail_quota_locks; 565 goto fail_quota_locks;
566 566
@@ -650,6 +650,7 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
650 struct gfs2_glock *io_gl; 650 struct gfs2_glock *io_gl;
651 int error; 651 int error;
652 struct buffer_head *bh = NULL; 652 struct buffer_head *bh = NULL;
653 u32 aflags = 0;
653 654
654 if (!name->len || name->len > GFS2_FNAMESIZE) 655 if (!name->len || name->len > GFS2_FNAMESIZE)
655 return -ENAMETOOLONG; 656 return -ENAMETOOLONG;
@@ -685,7 +686,11 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry,
685 munge_mode_uid_gid(dip, inode); 686 munge_mode_uid_gid(dip, inode);
686 ip->i_goal = dip->i_goal; 687 ip->i_goal = dip->i_goal;
687 688
688 error = alloc_dinode(ip); 689 if ((GFS2_I(sdp->sd_root_dir->d_inode) == dip) ||
690 (dip->i_diskflags & GFS2_DIF_TOPDIR))
691 aflags |= GFS2_AF_ORLOV;
692
693 error = alloc_dinode(ip, aflags);
689 if (error) 694 if (error)
690 goto fail_free_inode; 695 goto fail_free_inode;
691 696
@@ -897,7 +902,7 @@ static int gfs2_link(struct dentry *old_dentry, struct inode *dir,
897 if (error) 902 if (error)
898 goto out_gunlock; 903 goto out_gunlock;
899 904
900 error = gfs2_inplace_reserve(dip, sdp->sd_max_dirres); 905 error = gfs2_inplace_reserve(dip, sdp->sd_max_dirres, 0);
901 if (error) 906 if (error)
902 goto out_gunlock_q; 907 goto out_gunlock_q;
903 908
@@ -1378,7 +1383,7 @@ static int gfs2_rename(struct inode *odir, struct dentry *odentry,
1378 if (error) 1383 if (error)
1379 goto out_gunlock; 1384 goto out_gunlock;
1380 1385
1381 error = gfs2_inplace_reserve(ndip, sdp->sd_max_dirres); 1386 error = gfs2_inplace_reserve(ndip, sdp->sd_max_dirres, 0);
1382 if (error) 1387 if (error)
1383 goto out_gunlock_q; 1388 goto out_gunlock_q;
1384 1389