Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+25 -21
+22
fs/fscache/operation.c
··· 21 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 46 * fscache_enqueue_operation - Enqueue an operation for processing 25 47 * @op: The operation to enqueue 26 48 *
+3 -21
include/linux/fscache-cache.h
··· 119 119 extern void fscache_enqueue_operation(struct fscache_operation *); 120 120 extern void fscache_op_complete(struct fscache_operation *, bool); 121 121 extern void fscache_put_operation(struct fscache_operation *); 122 - 123 - /** 124 - * fscache_operation_init - Do basic initialisation of an operation 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 - } 122 + extern void fscache_operation_init(struct fscache_operation *, 123 + fscache_operation_processor_t, 124 + fscache_operation_release_t); 143 125 144 126 /* 145 127 * data read operation