scoutfs: allocate inode numbers per directory

Having an inode number allocation pool in the super block meant that all
allocations across the mount are interleaved.  This means that
concurrent file creation in different directories will create
overlapping inode numbers.  This leads to lock contention as reasonable
work loads will tend to distribute work by directories.

The easy fix is to have per-directory inode number allocation pools.  We
take the opportunity to clean up the network request so that the caller
gets the allocation instead of having it be fed back in via a weird
callback.

Signed-off-by: Zach Brown <zab@versity.com>
This commit is contained in:
Zach Brown
2018-02-09 17:58:19 -08:00
committed by Zach Brown
parent a49061a7d9
commit 4ff1e3020f
7 changed files with 85 additions and 131 deletions
+1 -1
View File
@@ -545,7 +545,7 @@ static struct inode *lock_hold_create(struct inode *dir, struct dentry *dentry,
if (ret)
return ERR_PTR(ret);
ret = scoutfs_alloc_ino(sb, &ino);
ret = scoutfs_alloc_ino(dir, &ino);
if (ret)
return ERR_PTR(ret);