]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfsprogs: introduce liburcu support
authorDave Chinner <dchinner@redhat.com>
Wed, 29 Sep 2021 20:48:03 +0000 (16:48 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Wed, 29 Sep 2021 20:48:03 +0000 (16:48 -0400)
commite4da1b16e29f6fe6b34de9b9b0f97141fb2e1855
tree043f8b16839bc683e621196bd26d5e2b8696f8de
parentb42033308360655616fc9bd77678c46bf518b7c8
xfsprogs: introduce liburcu support

The upcoming buffer cache rework/kerenl sync-up requires atomic
variables. I could use C++11 atomics build into GCC, but they are a
pain to work with and shoe-horn into the kernel atomic variable API.

Much easier is to introduce a dependency on liburcu - the userspace
RCU library. This provides atomic variables that very closely match
the kernel atomic variable API, and it provides a very similar
memory model and memory barrier support to the kernel. And we get
RCU support that has an identical interface to the kernel and works
the same way.

Hence kernel code written with RCU algorithms and atomic variables
will just slot straight into the userspace xfsprogs code without us
having to think about whether the lockless algorithms will work in
userspace or not. This reduces glue and hoop jumping, and gets us
a step closer to having the entire userspace libxfs code MT safe.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
[chandan.babu@oracle.com: Add m4 macros to detect availability of liburcu]
Signed-off-by: Chandan Babu R <chandan.babu@oracle.com>
[sandeen: use dchinner's m4 macros]
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
21 files changed:
configure.ac
copy/Makefile
copy/xfs_copy.c
db/Makefile
debian/control
growfs/Makefile
include/builddefs.in
include/platform_defs.h.in
libfrog/workqueue.c
libxfs/init.c
libxfs/libxfs_priv.h
logprint/Makefile
m4/Makefile
m4/package_urcu.m4 [new file with mode: 0644]
mdrestore/Makefile
mkfs/Makefile
repair/Makefile
repair/prefetch.c
repair/progress.c
scrub/Makefile
scrub/progress.c