Whamcloud - gitweb
LU-5971 llite: rename ccc_object to vvp_object
[fs/lustre-release.git] / lustre / llite / vvp_internal.h
index c1e0a8a..5b8c747 100644 (file)
@@ -138,6 +138,8 @@ int cl_is_normalio(const struct lu_env *env, const struct cl_io *io);
 extern struct lu_context_key ccc_key;
 extern struct lu_context_key ccc_session_key;
 
+extern struct kmem_cache *vvp_object_kmem;
+
 struct ccc_thread_info {
        struct cl_lock          cti_lock;
        struct cl_lock_descr    cti_descr;
@@ -204,10 +206,10 @@ static inline struct ccc_io *ccc_env_io(const struct lu_env *env)
 /**
  * ccc-private object state.
  */
-struct ccc_object {
-       struct cl_object_header cob_header;
-       struct cl_object        cob_cl;
-       struct inode           *cob_inode;
+struct vvp_object {
+       struct cl_object_header vob_header;
+       struct cl_object        vob_cl;
+       struct inode           *vob_inode;
 
        /**
         * A list of dirty pages pending IO in the cache. Used by
@@ -215,24 +217,24 @@ struct ccc_object {
         *
         * \see ccc_page::cpg_pending_linkage
         */
-       struct list_head        cob_pending_list;
+       struct list_head        vob_pending_list;
 
        /**
         * Number of transient pages.  This is no longer protected by i_sem,
         * and needs to be atomic.  This is not actually used for anything,
         * and can probably be removed.
         */
-       atomic_t                cob_transient_pages;
+       atomic_t                vob_transient_pages;
        /**
         * Number of outstanding mmaps on this file.
         *
         * \see ll_vm_open(), ll_vm_close().
         */
-       atomic_t                cob_mmap_cnt;
+       atomic_t                vob_mmap_cnt;
 
        /**
         * various flags
-        * cob_discard_page_warned
+        * vob_discard_page_warned
         *     if pages belonging to this object are discarded when a client
         * is evicted, some debug info will be printed, this flag will be set
         * during processing the first discarded page, then avoid flooding
@@ -240,7 +242,7 @@ struct ccc_object {
         *
         * \see ll_dirty_page_discard_warn.
         */
-       unsigned int            cob_discard_page_warned:1;
+       unsigned int            vob_discard_page_warned:1;
 };
 
 /**
@@ -253,8 +255,7 @@ struct ccc_page {
                        cpg_write_queued:1;
        /**
         * Non-empty iff this page is already counted in
-        * ccc_object::cob_pending_list. Protected by
-        * ccc_object::cob_pending_guard. This list is only used as a flag,
+        * vvp_object::vob_pending_list. This list is only used as a flag,
         * that is, never iterated through, only checked for list_empty(), but
         * having a list is useful for debugging.
         */
@@ -297,31 +298,14 @@ void *ccc_session_key_init(const struct lu_context *ctx,
 void ccc_session_key_fini(const struct lu_context *ctx,
                          struct lu_context_key *key, void *data);
 
-struct lu_object *ccc_object_alloc(const struct lu_env *env,
-                                  const struct lu_object_header *hdr,
-                                  struct lu_device *dev,
-                                  const struct cl_object_operations *clops,
-                                  const struct lu_object_operations *luops);
-
 int ccc_req_init(const struct lu_env *env, struct cl_device *dev,
                 struct cl_req *req);
 void ccc_umount(const struct lu_env *env, struct cl_device *dev);
 int ccc_global_init(struct lu_device_type *device_type);
 void ccc_global_fini(struct lu_device_type *device_type);
-int ccc_object_init0(const struct lu_env *env, struct ccc_object *vob,
-                    const struct cl_object_conf *conf);
-int ccc_object_init(const struct lu_env *env, struct lu_object *obj,
-                   const struct lu_object_conf *conf);
-void ccc_object_free(const struct lu_env *env, struct lu_object *obj);
 int ccc_lock_init(const struct lu_env *env, struct cl_object *obj,
                  struct cl_lock *lock, const struct cl_io *io,
                  const struct cl_lock_operations *lkops);
-int ccc_attr_set(const struct lu_env *env, struct cl_object *obj,
-                const struct cl_attr *attr, unsigned valid);
-int ccc_object_glimpse(const struct lu_env *env,
-                      const struct cl_object *obj, struct ost_lvb *lvb);
-int ccc_conf_set(const struct lu_env *env, struct cl_object *obj,
-                const struct cl_object_conf *conf);
 int ccc_fail(const struct lu_env *env, const struct cl_page_slice *slice);
 void ccc_transient_page_verify(const struct cl_page *page);
 int  ccc_transient_page_own(const struct lu_env *env,
@@ -384,22 +368,34 @@ static inline struct vvp_device *cl2vvp_dev(const struct cl_device *d)
        return container_of0(d, struct vvp_device, vdv_cl);
 }
 
-struct lu_object *ccc2lu(struct ccc_object *vob);
-struct ccc_object *lu2ccc(const struct lu_object *obj);
-struct ccc_object *cl2ccc(const struct cl_object *obj);
+static inline struct vvp_object *cl2vvp(const struct cl_object *obj)
+{
+       return container_of0(obj, struct vvp_object, vob_cl);
+}
+
+static inline struct vvp_object *lu2vvp(const struct lu_object *obj)
+{
+       return container_of0(obj, struct vvp_object, vob_cl.co_lu);
+}
+
+static inline struct inode *vvp_object_inode(const struct cl_object *obj)
+{
+       return cl2vvp(obj)->vob_inode;
+}
+
+int vvp_object_invariant(const struct cl_object *obj);
+struct vvp_object *cl_inode2vvp(struct inode *inode);
+
 struct ccc_lock *cl2ccc_lock(const struct cl_lock_slice *slice);
 struct ccc_io *cl2ccc_io(const struct lu_env *env,
                         const struct cl_io_slice *slice);
 struct ccc_req *cl2ccc_req(const struct cl_req_slice *slice);
 struct page *cl2vm_page(const struct cl_page_slice *slice);
-struct inode *ccc_object_inode(const struct cl_object *obj);
-struct ccc_object *cl_inode2ccc(struct inode *inode);
 
 int cl_setattr_ost(struct inode *inode, const struct iattr *attr,
                   struct obd_capa *capa);
 
 struct cl_page *ccc_vmpage_page_transient(struct page *vmpage);
-int ccc_object_invariant(const struct cl_object *obj);
 int cl_file_inode_init(struct inode *inode, struct lustre_md *md);
 void cl_inode_fini(struct inode *inode);
 int cl_local_size(struct inode *inode);
@@ -469,7 +465,6 @@ int vvp_page_init(const struct lu_env *env, struct cl_object *obj,
 struct lu_object *vvp_object_alloc(const struct lu_env *env,
                                   const struct lu_object_header *hdr,
                                   struct lu_device *dev);
-struct ccc_object *cl_inode2ccc(struct inode *inode);
 
 extern const struct file_operations vvp_dump_pgcache_file_ops;