Make struct fuse_req::ctr a C11 _Atomic
authorBernd Schubert <bschubert@ddn.com>
Tue, 4 Jun 2024 11:56:09 +0000 (13:56 +0200)
committerBernd Schubert <bschubert@ddn.com>
Tue, 4 Jun 2024 11:59:42 +0000 (13:59 +0200)
The variable is not modified exclusively with locks since commit
cef8c8b24902 ("Add support for no_interrupt") anymore.
That commit is safe, but might be error prone to future updates.
Changing it to a C11 _Atomic should avoid issues.

lib/fuse_i.h

index 7a2ae0465b9e3392c43705d9f7a7eaaeca5705af..a856782cf449d194a25779b5d77b4ee018443efe 100644 (file)
@@ -14,7 +14,7 @@ struct mount_opts;
 struct fuse_req {
        struct fuse_session *se;
        uint64_t unique;
-       int ctr;
+       _Atomic int ctr;
        pthread_mutex_t lock;
        struct fuse_ctx ctx;
        struct fuse_chan *ch;