diff options
author | Miklos Szeredi <mszeredi@suse.cz> | 2015-07-01 17:25:58 +0300 |
---|---|---|
committer | Miklos Szeredi <mszeredi@suse.cz> | 2015-07-01 17:25:58 +0300 |
commit | 825d6d3395e88a616e4c953984d77eeacbad4310 (patch) | |
tree | 1a8644c118994d7d7a743665cb657fd21a450443 /fs/fuse/fuse_i.h | |
parent | 0d8e84b0432beb6d11a1c82deeb9dc1a7bee02c0 (diff) | |
download | linux-825d6d3395e88a616e4c953984d77eeacbad4310.tar.xz |
fuse: req use bitops
Finer grained locking will mean there's no single lock to protect
modification of bitfileds in fuse_req.
So move to using bitops. Can use the non-atomic variants for those which
happen while the request definitely has only one reference.
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Reviewed-by: Ashish Samant <ashish.samant@oracle.com>
Diffstat (limited to 'fs/fuse/fuse_i.h')
-rw-r--r-- | fs/fuse/fuse_i.h | 49 |
1 files changed, 23 insertions, 26 deletions
diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index 7354dc142a50..4503e995c7b2 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h @@ -267,6 +267,27 @@ struct fuse_io_priv { }; /** + * Request flags + * + * FR_ISREPLY: set if the request has reply + * FR_FORCE: force sending of the request even if interrupted + * FR_BACKGROUND: request is sent in the background + * FR_WAITING: request is counted as "waiting" + * FR_ABORTED: the request was aborted + * FR_INTERRUPTED: the request has been interrupted + * FR_LOCKED: data is being copied to/from the request + */ +enum fuse_req_flag { + FR_ISREPLY, + FR_FORCE, + FR_BACKGROUND, + FR_WAITING, + FR_ABORTED, + FR_INTERRUPTED, + FR_LOCKED, +}; + +/** * A request to the client */ struct fuse_req { @@ -283,32 +304,8 @@ struct fuse_req { /** Unique ID for the interrupt request */ u64 intr_unique; - /* - * The following bitfields are either set once before the - * request is queued or setting/clearing them is protected by - * fuse_conn->lock - */ - - /** True if the request has reply */ - unsigned isreply:1; - - /** Force sending of the request even if interrupted */ - unsigned force:1; - - /** The request was aborted */ - unsigned aborted:1; - - /** Request is sent in the background */ - unsigned background:1; - - /** The request has been interrupted */ - unsigned interrupted:1; - - /** Data is being copied to/from the request */ - unsigned locked:1; - - /** Request is counted as "waiting" */ - unsigned waiting:1; + /* Request flags, updated with test/set/clear_bit() */ + unsigned long flags; /** State of the request */ enum fuse_req_state state; |