* Internal interfaces of LOV layer.
*
* Author: Nikita Danilov <nikita.danilov@sun.com>
+ * Author: Jinshan Xiong <jinshan.xiong@intel.com>
*/
#ifndef LOV_CL_INTERNAL_H
* \see lov_object::lo_type
*/
struct rw_semaphore lo_type_guard;
- /**
- * Type of an object. Protected by lov_object::lo_type_guard.
- */
- enum lov_layout_type lo_type;
/**
- * True if layout is valid. This bit is cleared when layout lock
+ * Type of an object. Protected by lov_object::lo_type_guard.
+ */
+ enum lov_layout_type lo_type;
+ /**
+ * True if layout is invalid. This bit is cleared when layout lock
* is lost.
*/
- unsigned lo_lsm_invalid:1;
+ bool lo_layout_invalid;
/**
- * Layout metadata.
+ * How many IOs are on going on this object. Layout can be changed
+ * only if there is no active IO.
*/
- struct lov_stripe_md *lo_lsm;
+ cfs_atomic_t lo_active_ios;
/**
* Waitq - wait for no one else is using lo_lsm
*/
cfs_waitq_t lo_waitq;
+ /**
+ * Layout metadata. NULL if empty layout.
+ */
+ struct lov_stripe_md *lo_lsm;
union lov_layout_state {
struct lov_layout_raid0 {
* Set when sub-lock was canceled, while top-lock was being
* used, or unused.
*/
- int lls_cancel_race:1;
+ unsigned int lls_cancel_race:1;
/**
* An array of sub-locks
*
* lov_io::lis_cl::cis_object.
*/
struct lov_object *lis_object;
- /**
- * Lov stripe - this determines how this io fans out.
- * Hold a refcount to the lsm so it can't go away during IO.
- */
- struct lov_stripe_md *lis_lsm;
/**
* Original end-of-io position for this IO, set by the upper layer as
* cl_io::u::ci_rw::pos + cl_io::u::ci_rw::count. lov remembers this,