X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Flov%2Flov_cl_internal.h;h=65009f9a8410470d708a96a8f611fea4a70510eb;hp=9add90cc2768962fad7c60b64ee967ab11e43eb6;hb=0b1ad400c8f64575292a7ff54a8ce872a124b19e;hpb=2b294992edce5af7b79d4300ed3aa1ea6a8db850 diff --git a/lustre/lov/lov_cl_internal.h b/lustre/lov/lov_cl_internal.h index 9add90c..65009f9 100644 --- a/lustre/lov/lov_cl_internal.h +++ b/lustre/lov/lov_cl_internal.h @@ -27,7 +27,7 @@ * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. * Use is subject to license terms. * - * Copyright (c) 2012, 2014, Intel Corporation. + * Copyright (c) 2012, 2015, Intel Corporation. */ /* * This file is part of Lustre, http://www.lustre.org/ @@ -72,19 +72,6 @@ * - top-page keeps a reference to its sub-page, and destroys it when it * is destroyed. * - * - sub-lock keep a reference to its top-locks. Top-lock keeps a - * reference (and a hold, see cl_lock_hold()) on its sub-locks when it - * actively using them (that is, in cl_lock_state::CLS_QUEUING, - * cl_lock_state::CLS_ENQUEUED, cl_lock_state::CLS_HELD states). When - * moving into cl_lock_state::CLS_CACHED state, top-lock releases a - * hold. From this moment top-lock has only a 'weak' reference to its - * sub-locks. This reference is protected by top-lock - * cl_lock::cll_guard, and will be automatically cleared by the sub-lock - * when the latter is destroyed. When a sub-lock is canceled, a - * reference to it is removed from the top-lock array, and top-lock is - * moved into CLS_NEW state. It is guaranteed that all sub-locks exist - * while their top-lock is in CLS_HELD or CLS_CACHED states. - * * - IO's are not reference counted. * * To implement a connection between top and sub entities, lov layer is split @@ -134,7 +121,7 @@ struct lov_device_emerg { * * \see cl_env_get() */ - int emrg_refcheck; + __u16 emrg_refcheck; }; struct lov_device { @@ -255,6 +242,8 @@ struct lov_object { * When top-object is destroyed (lov_delete_raid0()) * it releases its reference to a sub-object and waits * until the latter is finally destroyed. + * + * May be vmalloc'd, must be freed with OBD_FREE_LARGE. */ struct lovsub_object **lo_sub; /** @@ -394,41 +383,39 @@ struct lov_thread_info { * State that lov_io maintains for every sub-io. */ struct lov_io_sub { - int sub_stripe; - /** - * sub-io for a stripe. Ideally sub-io's can be stopped and resumed - * independently, with lov acting as a scheduler to maximize overall - * throughput. - */ - struct cl_io *sub_io; - /** - * Linkage into a list (hanging off lov_io::lis_active) of all - * sub-io's active for the current IO iteration. - */ + __u16 sub_stripe; + /** + * environment's refcheck. + * + * \see cl_env_get() + */ + __u16 sub_refcheck; + __u16 sub_reenter; + /** + * true, iff cl_io_init() was successfully executed against + * lov_io_sub::sub_io. + */ + __u16 sub_io_initialized:1, + /** + * True, iff lov_io_sub::sub_io and lov_io_sub::sub_env weren't + * allocated, but borrowed from a per-device emergency pool. + */ + sub_borrowed:1; + /** + * Linkage into a list (hanging off lov_io::lis_active) of all + * sub-io's active for the current IO iteration. + */ struct list_head sub_linkage; - /** - * true, iff cl_io_init() was successfully executed against - * lov_io_sub::sub_io. - */ - int sub_io_initialized; - /** - * True, iff lov_io_sub::sub_io and lov_io_sub::sub_env weren't - * allocated, but borrowed from a per-device emergency pool. - */ - int sub_borrowed; - /** - * environment, in which sub-io executes. - */ - struct lu_env *sub_env; - /** - * environment's refcheck. - * - * \see cl_env_get() - */ - int sub_refcheck; - int sub_refcheck2; - int sub_reenter; - void *sub_cookie; + /** + * sub-io for a stripe. Ideally sub-io's can be stopped and resumed + * independently, with lov acting as a scheduler to maximize overall + * throughput. + */ + struct cl_io *sub_io; + /** + * environment, in which sub-io executes. + */ + struct lu_env *sub_env; }; /** @@ -456,31 +443,32 @@ struct lov_io { * starting position within a file, for the current io loop iteration * (stripe), used by ci_io_loop(). */ - obd_off lis_pos; - /** - * end position with in a file, for the current stripe io. This is - * exclusive (i.e., next offset after last byte affected by io). - */ - obd_off lis_endpos; + loff_t lis_pos; + /** + * end position with in a file, for the current stripe io. This is + * exclusive (i.e., next offset after last byte affected by io). + */ + loff_t lis_endpos; - int lis_mem_frozen; - int lis_stripe_count; - int lis_active_subios; + int lis_mem_frozen; + int lis_stripe_count; + int lis_active_subios; - /** - * the index of ls_single_subio in ls_subios array - */ - int lis_single_subio_index; - struct cl_io lis_single_subio; + /** + * the index of ls_single_subio in ls_subios array + */ + int lis_single_subio_index; + struct cl_io lis_single_subio; - /** - * size of ls_subios array, actually the highest stripe # - */ - int lis_nr_subios; - struct lov_io_sub *lis_subs; - /** - * List of active sub-io's. - */ + /** + * size of ls_subios array, actually the highest stripe # + * May be vmalloc'd, must be freed with OBD_FREE_LARGE(). + */ + int lis_nr_subios; + struct lov_io_sub *lis_subs; + /** + * List of active sub-io's. + */ struct list_head lis_active; }; @@ -489,20 +477,6 @@ struct lov_session { struct lov_sublock_env ls_subenv; }; -/** - * State of transfer for lov. - */ -struct lov_req { - struct cl_req_slice lr_cl; -}; - -/** - * State of transfer for lovsub. - */ -struct lovsub_req { - struct cl_req_slice lsrq_cl; -}; - extern struct lu_device_type lov_device_type; extern struct lu_device_type lovsub_device_type; @@ -513,11 +487,9 @@ extern struct kmem_cache *lov_lock_kmem; extern struct kmem_cache *lov_object_kmem; extern struct kmem_cache *lov_thread_kmem; extern struct kmem_cache *lov_session_kmem; -extern struct kmem_cache *lov_req_kmem; extern struct kmem_cache *lovsub_lock_kmem; extern struct kmem_cache *lovsub_object_kmem; -extern struct kmem_cache *lovsub_req_kmem; extern struct kmem_cache *lov_lock_link_kmem; @@ -718,11 +690,6 @@ static inline struct lov_page *cl2lov_page(const struct cl_page_slice *slice) return container_of0(slice, struct lov_page, lps_cl); } -static inline struct lov_req *cl2lov_req(const struct cl_req_slice *slice) -{ - return container_of0(slice, struct lov_req, lr_cl); -} - static inline struct lovsub_page * cl2lovsub_page(const struct cl_page_slice *slice) { @@ -730,11 +697,6 @@ cl2lovsub_page(const struct cl_page_slice *slice) return container_of0(slice, struct lovsub_page, lsb_cl); } -static inline struct lovsub_req *cl2lovsub_req(const struct cl_req_slice *slice) -{ - return container_of0(slice, struct lovsub_req, lsrq_cl); -} - static inline struct lov_io *cl2lov_io(const struct lu_env *env, const struct cl_io_slice *ios) {