Message ID | 169020933088.160441.9405180953116076087.stgit@manet.1015granger.net (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | libfs: Add a lock class for the offset map's xa_lock | expand |
On Mon, 24 Jul 2023 10:43:57 -0400, Chuck Lever wrote: > Tie the dynamically-allocated xarray locks into a single class so > contention on the directory offset xarrays can be observed. > > Applied to the vfs.readdir branch of the vfs/vfs.git tree. Patches in the vfs.readdir branch should appear in linux-next soon. Please report any outstanding bugs that were missed during review in a new review to the original patch series allowing us to drop it. It's encouraged to provide Acked-bys and Reviewed-bys even though the patch has now been applied. If possible patch trailers will be updated. Note that commit hashes shown below are subject to change due to rebase, trailer updates or similar. If in doubt, please check the listed branch. tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git branch: vfs.readdir [1/1] libfs: Add a lock class for the offset map's xa_lock https://git.kernel.org/vfs/vfs/c/fc66c4c9dc90
diff --git a/fs/libfs.c b/fs/libfs.c index 68b0000dc518..fcc0f1f3c2dc 100644 --- a/fs/libfs.c +++ b/fs/libfs.c @@ -249,6 +249,8 @@ static unsigned long dentry2offset(struct dentry *dentry) return (unsigned long)dentry->d_fsdata; } +static struct lock_class_key simple_offset_xa_lock; + /** * simple_offset_init - initialize an offset_ctx * @octx: directory offset map to be initialized @@ -257,6 +259,7 @@ static unsigned long dentry2offset(struct dentry *dentry) void simple_offset_init(struct offset_ctx *octx) { xa_init_flags(&octx->xa, XA_FLAGS_ALLOC1); + lockdep_set_class(&octx->xa.xa_lock, &simple_offset_xa_lock); /* 0 is '.', 1 is '..', so always start with offset 2 */ octx->next_offset = 2;