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 /include/linux | |
| 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 'include/linux')
| -rw-r--r-- | include/linux/fscache-cache.h | 24 |
1 files changed, 3 insertions, 21 deletions
diff --git a/include/linux/fscache-cache.h b/include/linux/fscache-cache.h index ca3d550da11e..0e26d49972e3 100644 --- a/include/linux/fscache-cache.h +++ b/include/linux/fscache-cache.h | |||
| @@ -119,27 +119,9 @@ extern void fscache_op_work_func(struct work_struct *work); | |||
| 119 | extern void fscache_enqueue_operation(struct fscache_operation *); | 119 | extern void fscache_enqueue_operation(struct fscache_operation *); |
| 120 | extern void fscache_op_complete(struct fscache_operation *, bool); | 120 | extern void fscache_op_complete(struct fscache_operation *, bool); |
| 121 | extern void fscache_put_operation(struct fscache_operation *); | 121 | extern void fscache_put_operation(struct fscache_operation *); |
| 122 | 122 | extern void fscache_operation_init(struct fscache_operation *, | |
| 123 | /** | 123 | fscache_operation_processor_t, |
| 124 | * fscache_operation_init - Do basic initialisation of an operation | 124 | fscache_operation_release_t); |
| 125 | * @op: The operation to initialise | ||
| 126 | * @release: The release function to assign | ||
| 127 | * | ||
| 128 | * Do basic initialisation of an operation. The caller must still set flags, | ||
| 129 | * object and processor if needed. | ||
| 130 | */ | ||
| 131 | static inline void fscache_operation_init(struct fscache_operation *op, | ||
| 132 | fscache_operation_processor_t processor, | ||
| 133 | fscache_operation_release_t release) | ||
| 134 | { | ||
| 135 | INIT_WORK(&op->work, fscache_op_work_func); | ||
| 136 | atomic_set(&op->usage, 1); | ||
| 137 | op->state = FSCACHE_OP_ST_INITIALISED; | ||
| 138 | op->debug_id = atomic_inc_return(&fscache_op_debug_id); | ||
| 139 | op->processor = processor; | ||
| 140 | op->release = release; | ||
| 141 | INIT_LIST_HEAD(&op->pend_link); | ||
| 142 | } | ||
| 143 | 125 | ||
| 144 | /* | 126 | /* |
| 145 | * data read operation | 127 | * data read operation |
