diff options
author | David Howells <dhowells@redhat.com> | 2015-02-25 08:26:39 -0500 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2015-04-02 09:28:53 -0400 |
commit | 1339ec98e32b4bc8efb6fbb71c006a465130aaba (patch) | |
tree | 78b13a5a55590da6f4fc69b7a39d359255397a34 /fs/fscache | |
parent | 418b7eb9e1011bc11220a03ad0045885d04698d2 (diff) |
FS-Cache: Out of line fscache_operation_init()
Out of line fscache_operation_init() so that it can access internal FS-Cache
features, such as stats, in a later commit.
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Steve Dickson <steved@redhat.com>
Acked-by: Jeff Layton <jeff.layton@primarydata.com>
Diffstat (limited to 'fs/fscache')
-rw-r--r-- | fs/fscache/operation.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/fs/fscache/operation.c b/fs/fscache/operation.c index 67594a8d791a..61a6e78b85fa 100644 --- a/fs/fscache/operation.c +++ b/fs/fscache/operation.c | |||
@@ -21,6 +21,28 @@ atomic_t fscache_op_debug_id; | |||
21 | EXPORT_SYMBOL(fscache_op_debug_id); | 21 | EXPORT_SYMBOL(fscache_op_debug_id); |
22 | 22 | ||
23 | /** | 23 | /** |
24 | * fscache_operation_init - Do basic initialisation of an operation | ||
25 | * @op: The operation to initialise | ||
26 | * @release: The release function to assign | ||
27 | * | ||
28 | * Do basic initialisation of an operation. The caller must still set flags, | ||
29 | * object and processor if needed. | ||
30 | */ | ||
31 | void fscache_operation_init(struct fscache_operation *op, | ||
32 | fscache_operation_processor_t processor, | ||
33 | fscache_operation_release_t release) | ||
34 | { | ||
35 | INIT_WORK(&op->work, fscache_op_work_func); | ||
36 | atomic_set(&op->usage, 1); | ||
37 | op->state = FSCACHE_OP_ST_INITIALISED; | ||
38 | op->debug_id = atomic_inc_return(&fscache_op_debug_id); | ||
39 | op->processor = processor; | ||
40 | op->release = release; | ||
41 | INIT_LIST_HEAD(&op->pend_link); | ||
42 | } | ||
43 | EXPORT_SYMBOL(fscache_operation_init); | ||
44 | |||
45 | /** | ||
24 | * fscache_enqueue_operation - Enqueue an operation for processing | 46 | * fscache_enqueue_operation - Enqueue an operation for processing |
25 | * @op: The operation to enqueue | 47 | * @op: The operation to enqueue |
26 | * | 48 | * |