*/
struct osp_id_tracker {
spinlock_t otr_lock;
- __u32 otr_next_id;
- __u32 otr_committed_id;
+ __u64 otr_next_id;
+ __u64 otr_committed_id;
/* callback is register once per diskfs -- that's the whole point */
struct dt_txn_callback otr_tx_cb;
/* single node can run many clusters */
wait_queue_head_t osp_pre_user_waitq;
/* current precreation status: working, failed, stopping? */
int osp_pre_status;
- /* how many to precreate next time */
- int osp_pre_grow_count;
- int osp_pre_min_grow_count;
- int osp_pre_max_grow_count;
- /* whether to grow precreation window next time or not */
- int osp_pre_grow_slow;
+ /* how many objects to precreate next time */
+ int osp_pre_create_count;
+ int osp_pre_min_create_count;
+ int osp_pre_max_create_count;
+ /* whether to increase precreation window next time or not */
+ int osp_pre_create_slow;
/* cleaning up orphans or recreating missing objects */
int osp_pre_recovering;
};
struct osp_update_request_sub {
- struct object_update_request *ours_req;
+ struct object_update_request *ours_req; /* may be vmalloc'd */
size_t ours_req_size;
/* Linked to osp_update_request->our_req_list */
struct list_head ours_list;
};
-/**
- * Tracking the updates being executed on this dt_device.
- */
struct osp_update_request {
int our_flags;
/* update request result */
/* points to thandle if this update request belongs to one */
struct osp_thandle *our_th;
+
+ __u64 our_version;
+ /* protect our_list and flag */
+ spinlock_t our_list_lock;
/* linked to the list(ou_list) in osp_updates */
struct list_head our_list;
__u32 our_batchid;
- __u32 our_req_sent:1;
+ __u32 our_req_ready:1;
+
};
struct osp_updates {
/* osd api's commit cb control structure */
struct dt_txn_callback opd_syn_txn_cb;
/* last used change number -- semantically similar to transno */
- unsigned long opd_syn_last_used_id;
+ __u64 opd_syn_last_used_id;
/* last committed change number -- semantically similar to
* last_committed */
- unsigned long opd_syn_last_committed_id;
+ __u64 opd_syn_last_committed_id;
/* last processed (taken from llog) id */
- unsigned long opd_syn_last_processed_id;
+ __u64 opd_syn_last_processed_id;
struct osp_id_tracker *opd_syn_tracker;
struct list_head opd_syn_ontrack;
/* stop processing new requests until barrier=0 */
#define opd_pre_reserved opd_pre->osp_pre_reserved
#define opd_pre_user_waitq opd_pre->osp_pre_user_waitq
#define opd_pre_status opd_pre->osp_pre_status
-#define opd_pre_grow_count opd_pre->osp_pre_grow_count
-#define opd_pre_min_grow_count opd_pre->osp_pre_min_grow_count
-#define opd_pre_max_grow_count opd_pre->osp_pre_max_grow_count
-#define opd_pre_grow_slow opd_pre->osp_pre_grow_slow
+#define opd_pre_create_count opd_pre->osp_pre_create_count
+#define opd_pre_min_create_count opd_pre->osp_pre_min_create_count
+#define opd_pre_max_create_count opd_pre->osp_pre_max_create_count
+#define opd_pre_create_slow opd_pre->osp_pre_create_slow
#define opd_pre_recovering opd_pre->osp_pre_recovering
extern struct kmem_cache *osp_object_kmem;
struct lu_object_header opo_header;
struct dt_object opo_obj;
unsigned int opo_reserved:1,
- opo_non_exist:1;
+ opo_non_exist:1,
+ opo_stale:1;
/* read/write lock for md osp object */
struct rw_semaphore opo_sem;
struct list_head ot_stop_dcb_list;
struct osp_update_request *ot_our;
atomic_t ot_refcount;
- __u64 ot_version;
};
static inline struct osp_thandle *
}
struct osp_txn_info {
- __u32 oti_current_id;
+ __u64 oti_current_id;
};
extern struct lu_context_key osp_txn_key;
void osp_update_request_destroy(struct osp_update_request *update);
int osp_send_update_thread(void *arg);
-int osp_check_and_set_rpc_version(struct osp_thandle *oth);
+int osp_check_and_set_rpc_version(struct osp_thandle *oth,
+ struct osp_object *obj);
void osp_thandle_destroy(struct osp_thandle *oth);
static inline void osp_thandle_get(struct osp_thandle *oth)
struct osp_device *osp);
void osp_trans_callback(const struct lu_env *env,
struct osp_thandle *oth, int rc);
+void osp_invalidate_request(struct osp_device *osp);
/* osp_object.c */
int osp_attr_get(const struct lu_env *env, struct dt_object *dt,
struct lu_attr *attr);