Whamcloud - gitweb
LU-5108 llite: define per open file cache for ll_cl_context
[fs/lustre-release.git] / lustre / llite / llite_internal.h
index cb6a254..85ea3ab 100644 (file)
@@ -668,6 +668,8 @@ struct ll_file_data {
         * true: failure is known, not report again.
         * false: unknown failure, should report. */
        bool fd_write_failed;
+       rwlock_t fd_lock; /* protect lcc list */
+       struct list_head fd_lccs; /* list of ll_cl_context */
 };
 
 struct lov_stripe_md;
@@ -758,8 +760,9 @@ int ll_readahead(const struct lu_env *env, struct cl_io *io,
                 struct cl_page_list *queue, struct ll_readahead_state *ras,
                 bool hit);
 int vvp_io_write_commit(const struct lu_env *env, struct cl_io *io);
-struct ll_cl_context *ll_cl_init(struct file *file, struct page *vmpage);
-void ll_cl_fini(struct ll_cl_context *lcc);
+struct ll_cl_context *ll_cl_find(struct file *file);
+void ll_cl_add(struct file *file, const struct lu_env *env, struct cl_io *io);
+void ll_cl_remove(struct file *file, const struct lu_env *env);
 
 #ifndef MS_HAS_NEW_AOPS
 extern const struct address_space_operations ll_aops;
@@ -989,11 +992,11 @@ struct vvp_io_args {
 };
 
 struct ll_cl_context {
-        void           *lcc_cookie;
-        struct cl_io   *lcc_io;
-        struct cl_page *lcc_page;
-        struct lu_env  *lcc_env;
-        int             lcc_refcheck;
+       struct list_head         lcc_list;
+       void                    *lcc_cookie;
+       const struct lu_env     *lcc_env;
+       struct cl_io            *lcc_io;
+       struct cl_page          *lcc_page;
 };
 
 struct vvp_thread_info {