+struct vvp_thread_info {
+ struct ost_lvb vti_lvb;
+ struct cl_2queue vti_queue;
+ struct iovec vti_local_iov;
+ struct ccc_io_args vti_args;
+ struct ra_io_arg vti_ria;
+ struct kiocb vti_kiocb;
+};
+
+struct ccc_object *cl_inode2ccc(struct inode *inode);
+
+static inline struct vvp_thread_info *vvp_env_info(const struct lu_env *env)
+{
+ extern struct lu_context_key vvp_key;
+ struct vvp_thread_info *info;
+
+ info = lu_context_key_get(&env->le_ctx, &vvp_key);
+ LASSERT(info != NULL);
+ return info;
+}
+
+void vvp_write_pending (struct ccc_object *club, struct ccc_page *page);
+void vvp_write_complete(struct ccc_object *club, struct ccc_page *page);
+
+struct vvp_io {
+ union {
+ struct {
+ read_actor_t cui_actor;
+ void *cui_target;
+ } read;
+ struct vvp_fault_io {
+ /**
+ * Inode modification time that is checked across DLM
+ * lock request.
+ */
+ time_t ft_mtime;
+ struct vm_area_struct *ft_vma;
+ /**
+ * Virtual address at which fault occurred.
+ */
+ unsigned long ft_address;
+ /**
+ * Fault type, as to be supplied to filemap_nopage().
+ */
+ int *ft_type;
+ } fault;
+ } u;
+ /**
+ * Read-ahead state used by read and page-fault IO contexts.
+ */
+ struct ll_ra_read cui_bead;
+ /**
+ * Set when cui_bead has been initialized.
+ */
+ int cui_ra_window_set;
+ /**
+ * If IO was created directly in low level method like
+ * ->prepare_write(), this field stores the number of method calls
+ * that constitute this IO. This field is decremented by ll_cl_fini(),
+ * and cl_io is destroyed, when it reaches 0. When oneshot IO
+ * completes, this fields is set to -1.
+ */
+
+ int cui_oneshot;
+ /**
+ * Partially truncated page, that vvp_io_trunc_start() keeps locked
+ * across truncate.
+ */
+ struct cl_page *cui_partpage;
+};
+
+struct vvp_session {
+ struct vvp_io vs_ios;
+};
+
+static inline struct vvp_session *vvp_env_session(const struct lu_env *env)
+{
+ extern struct lu_context_key vvp_session_key;
+ struct vvp_session *ses;
+
+ ses = lu_context_key_get(env->le_ses, &vvp_session_key);
+ LASSERT(ses != NULL);
+ return ses;
+}
+
+static inline struct vvp_io *vvp_env_io(const struct lu_env *env)
+{
+ return &vvp_env_session(env)->vs_ios;
+}
+