summaryrefslogtreecommitdiff
path: root/fs/afs/internal.h
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2023-10-26 11:43:23 +0300
committerDavid Howells <dhowells@redhat.com>2023-12-24 18:22:53 +0300
commit2de5599f63babb416e09b1a6be429a47910dd47c (patch)
treeb8f836e51db7681fbedf1e46b205d2441119f81d /fs/afs/internal.h
parent075171fd22be33acf4ab354814bfa6de1c3412ce (diff)
downloadlinux-2de5599f63babb416e09b1a6be429a47910dd47c.tar.xz
afs: Wrap most op->error accesses with inline funcs
Wrap most op->error accesses with inline funcs which will make it easier for a subsequent patch to replace op->error with something else. Two functions are added to this end: (1) afs_op_error() - Get the error code. (2) afs_op_set_error() - Set the error code. Signed-off-by: David Howells <dhowells@redhat.com> cc: Marc Dionne <marc.dionne@auristor.com> cc: linux-afs@lists.infradead.org
Diffstat (limited to 'fs/afs/internal.h')
-rw-r--r--fs/afs/internal.h20
1 files changed, 15 insertions, 5 deletions
diff --git a/fs/afs/internal.h b/fs/afs/internal.h
index e43aef74c241..5c2d93023d17 100644
--- a/fs/afs/internal.h
+++ b/fs/afs/internal.h
@@ -1140,11 +1140,6 @@ extern bool afs_begin_vnode_operation(struct afs_operation *);
extern void afs_wait_for_operation(struct afs_operation *);
extern int afs_do_sync_operation(struct afs_operation *);
-static inline void afs_op_nomem(struct afs_operation *op)
-{
- op->error = -ENOMEM;
-}
-
static inline void afs_op_set_vnode(struct afs_operation *op, unsigned int n,
struct afs_vnode *vnode)
{
@@ -1238,6 +1233,21 @@ static inline void __afs_stat(atomic_t *s)
extern int afs_abort_to_error(u32);
extern void afs_prioritise_error(struct afs_error *, int, u32);
+static inline void afs_op_nomem(struct afs_operation *op)
+{
+ op->error = -ENOMEM;
+}
+
+static inline int afs_op_error(const struct afs_operation *op)
+{
+ return op->error;
+}
+
+static inline int afs_op_set_error(struct afs_operation *op, int error)
+{
+ return op->error = error;
+}
+
/*
* mntpt.c
*/