* those stale RPC(with older generation) will not be sent, otherwise it
* will cause update lllog corruption */
__u64 ou_generation;
+
+ /* dedicate update thread */
+ struct task_struct *ou_update_task;
+ struct lu_env ou_env;
};
struct osp_rpc_lock {
/* send update thread */
struct osp_updates *opd_update;
- /* dedicate update thread */
- struct ptlrpc_thread opd_update_thread;
/*
* OST synchronization thread
/* processing of changes from previous mount is done? */
int opd_sync_prev_done;
/* found records */
- struct ptlrpc_thread opd_sync_thread;
+ struct task_struct *opd_sync_task;
wait_queue_head_t opd_sync_waitq;
/* list of in flight rpcs */
struct list_head opd_sync_in_flight_list;
static inline struct osp_device *lu2osp_dev(struct lu_device *d)
{
LASSERT(lu_device_is_osp(d));
- return container_of0(d, struct osp_device, opd_dt_dev.dd_lu_dev);
+ return container_of_safe(d, struct osp_device, opd_dt_dev.dd_lu_dev);
}
static inline struct lu_device *osp2lu_dev(struct osp_device *d)
static inline struct osp_device *dt2osp_dev(struct dt_device *d)
{
LASSERT(lu_device_is_osp(&d->dd_lu_dev));
- return container_of0(d, struct osp_device, opd_dt_dev);
+ return container_of_safe(d, struct osp_device, opd_dt_dev);
}
static inline struct osp_object *lu2osp_obj(struct lu_object *o)
{
LASSERT(ergo(o != NULL, lu_device_is_osp(o->lo_dev)));
- return container_of0(o, struct osp_object, opo_obj.do_lu);
+ return container_of_safe(o, struct osp_object, opo_obj.do_lu);
}
static inline struct lu_object *osp2lu_obj(struct osp_object *obj)
static inline struct osp_object *osp_obj(const struct lu_object *o)
{
LASSERT(lu_device_is_osp(o->lo_dev));
- return container_of0(o, struct osp_object, opo_obj.do_lu);
+ return container_of_safe(o, struct osp_object, opo_obj.do_lu);
}
static inline struct osp_object *dt2osp_obj(const struct dt_object *d)
static inline struct dt_object *osp_object_child(struct osp_object *o)
{
- return container_of0(lu_object_next(osp2lu_obj(o)),
- struct dt_object, do_lu);
+ return container_of(lu_object_next(osp2lu_obj(o)),
+ struct dt_object, do_lu);
}
static inline struct seq_server_site *osp_seq_site(struct osp_device *osp)
ret; \
})
-static inline bool osp_send_update_thread_running(struct osp_device *osp)
-{
- return osp->opd_update_thread.t_flags & SVC_RUNNING;
-}
-
-static inline bool osp_send_update_thread_stopped(struct osp_device *osp)
-{
- return osp->opd_update_thread.t_flags & SVC_STOPPED;
-}
-
typedef int (*osp_update_interpreter_t)(const struct lu_env *env,
struct object_update_reply *rep,
struct ptlrpc_request *req,
int osp_xattr_del(const struct lu_env *env, struct dt_object *dt,
const char *name, struct thandle *th);
int osp_invalidate(const struct lu_env *env, struct dt_object *dt);
+bool osp_check_stale(struct dt_object *dt);
void osp_obj_invalidate_cache(struct osp_object *obj);
int osp_trans_stop(const struct lu_env *env, struct dt_device *dt,