Whamcloud - gitweb
LU-8134 kernel: kernel update RHEL7.2 [3.10.0-327.18.2.el7]
[fs/lustre-release.git] / lustre / osc / osc_cl_internal.h
index 65658f6..dbfad66 100644 (file)
@@ -27,7 +27,7 @@
  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2012, 2014, Intel Corporation.
+ * Copyright (c) 2012, 2015, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -62,10 +62,12 @@ struct osc_extent;
  * State maintained by osc layer for each IO context.
  */
 struct osc_io {
-        /** super class */
-        struct cl_io_slice oi_cl;
-        /** true if this io is lockless. */
-        int                oi_lockless;
+       /** super class */
+       struct cl_io_slice oi_cl;
+       /** true if this io is lockless. */
+       int                oi_lockless:1,
+       /** true if this io is counted as active IO */
+                          oi_is_active:1;
        /** how many LRU pages are reserved for this IO */
        unsigned long      oi_lru_reserved;
 
@@ -86,13 +88,6 @@ struct osc_io {
 };
 
 /**
- * State of transfer for osc.
- */
-struct osc_req {
-        struct cl_req_slice    or_cl;
-};
-
-/**
  * State maintained by osc layer for the duration of a system call.
  */
 struct osc_session {
@@ -115,6 +110,8 @@ struct osc_thread_info {
        pgoff_t                 oti_next_index;
        pgoff_t                 oti_fn_index; /* first non-overlapped index */
        struct cl_sync_io       oti_anchor;
+       struct cl_req_attr      oti_req_attr;
+       struct lu_buf           oti_ladvise_buf;
 };
 
 struct osc_object {
@@ -165,13 +162,13 @@ struct osc_object {
        /**
         * Radix tree for caching pages
         */
-       struct radix_tree_root  oo_tree;
        spinlock_t              oo_tree_lock;
+       struct radix_tree_root  oo_tree;
        unsigned long           oo_npages;
 
        /* Protect osc_lock this osc_object has */
-       spinlock_t              oo_ol_spin;
        struct list_head        oo_ol_list;
+       spinlock_t              oo_ol_spin;
 
        /** number of active IOs of this object */
        atomic_t                oo_nr_ios;
@@ -379,7 +376,6 @@ extern struct kmem_cache *osc_lock_kmem;
 extern struct kmem_cache *osc_object_kmem;
 extern struct kmem_cache *osc_thread_kmem;
 extern struct kmem_cache *osc_session_kmem;
-extern struct kmem_cache *osc_req_kmem;
 extern struct kmem_cache *osc_extent_kmem;
 
 extern struct lu_device_type osc_device_type;
@@ -393,8 +389,6 @@ int osc_lock_init(const struct lu_env *env,
                   const struct cl_io *io);
 int osc_io_init  (const struct lu_env *env,
                   struct cl_object *obj, struct cl_io *io);
-int osc_req_init (const struct lu_env *env, struct cl_device *dev,
-                  struct cl_req *req);
 struct lu_object *osc_object_alloc(const struct lu_env *env,
                                    const struct lu_object_header *hdr,
                                    struct lu_device *dev);
@@ -548,6 +542,16 @@ static inline struct osc_page *oap2osc_page(struct osc_async_page *oap)
        return (struct osc_page *)container_of(oap, struct osc_page, ops_oap);
 }
 
+static inline struct osc_page *
+osc_cl_page_osc(struct cl_page *page, struct osc_object *osc)
+{
+       const struct cl_page_slice *slice;
+
+       LASSERT(osc != NULL);
+       slice = cl_object_page_slice(&osc->oo_cl, page);
+       return cl2osc_page(slice);
+}
+
 static inline struct osc_lock *cl2osc_lock(const struct cl_lock_slice *slice)
 {
         LINVRNT(osc_is_object(&slice->cls_obj->co_lu));
@@ -609,6 +613,9 @@ struct osc_extent {
                                oe_rw:1,
        /** sync extent, queued by osc_queue_sync_pages() */
                                oe_sync:1,
+       /** set if this extent has partial, sync pages.
+        * Extents with partial page(s) can't merge with others in RPC */
+                               oe_no_merge:1,
                                oe_srvlock:1,
                                oe_memalloc:1,
        /** an ACTIVE extent is going to be truncated, so when this extent