Whamcloud - gitweb
LU-2089 ofd: do not pin pages provided by osd
[fs/lustre-release.git] / lustre / include / lustre_net.h
index 5566584..8f7575e 100644 (file)
@@ -657,8 +657,10 @@ struct ptlrpc_hpreq_ops {
  * in Lustre.
  */
 struct ptlrpc_request {
-        /* Request type: one of PTL_RPC_MSG_* */
-        int rq_type;
+       /* Request type: one of PTL_RPC_MSG_* */
+       int rq_type;
+       /** Result of request processing */
+       int rq_status;
         /**
          * Linkage item through which this request is included into
          * sending/delayed lists on client and into rqbd list on server
@@ -678,18 +680,20 @@ struct ptlrpc_request {
         cfs_list_t rq_exp_list;
         /** server-side hp handlers */
         struct ptlrpc_hpreq_ops *rq_ops;
+
+       /** initial thread servicing this request */
+       struct ptlrpc_thread *rq_svc_thread;
+
         /** history sequence # */
         __u64 rq_history_seq;
         /** the index of service's srv_at_array into which request is linked */
         time_t rq_at_index;
-        /** Result of request processing */
-        int rq_status;
         /** Lock to protect request flags and some other important bits, like
          * rq_list
          */
         cfs_spinlock_t rq_lock;
         /** client-side flags are serialized by rq_lock */
-        unsigned long rq_intr:1, rq_replied:1, rq_err:1,
+       unsigned int rq_intr:1, rq_replied:1, rq_err:1,
                 rq_timedout:1, rq_resend:1, rq_restart:1,
                 /**
                  * when ->rq_replay is set, request is kept by the client even
@@ -714,20 +718,21 @@ struct ptlrpc_request {
                 rq_committed:1,
                 /* whether the "rq_set" is a valid one */
                 rq_invalid_rqset:1,
-                rq_generation_set:1;
+               rq_generation_set:1,
+               /* do not resend request on -EINPROGRESS */
+               rq_no_retry_einprogress:1;
+
+       unsigned int rq_nr_resend;
 
         enum rq_phase rq_phase; /* one of RQ_PHASE_* */
         enum rq_phase rq_next_phase; /* one of RQ_PHASE_* to be used next */
         cfs_atomic_t rq_refcount;/* client-side refcount for SENT race,
                                     server-side refcounf for multiple replies */
 
-        /** initial thread servicing this request */
-        struct ptlrpc_thread *rq_svc_thread;
-
-        /** Portal to which this request would be sent */
-        int rq_request_portal;  /* XXX FIXME bug 249 */
-        /** Portal where to wait for reply and where reply would be sent */
-        int rq_reply_portal;    /* XXX FIXME bug 249 */
+       /** Portal to which this request would be sent */
+       short rq_request_portal;  /* XXX FIXME bug 249 */
+       /** Portal where to wait for reply and where reply would be sent */
+       short rq_reply_portal;    /* XXX FIXME bug 249 */
 
         /**
          * client-side:
@@ -737,11 +742,10 @@ struct ptlrpc_request {
         int rq_nob_received;
         /** Request length */
         int rq_reqlen;
-         /** Request message - what client sent */
-        struct lustre_msg *rq_reqmsg;
-
         /** Reply length */
         int rq_replen;
+       /** Request message - what client sent */
+       struct lustre_msg *rq_reqmsg;
         /** Reply message - server response */
         struct lustre_msg *rq_repmsg;
         /** Transaction number */
@@ -765,7 +769,8 @@ struct ptlrpc_request {
         struct sptlrpc_flavor    rq_flvr;        /**< for client & server */
         enum lustre_sec_part     rq_sp_from;
 
-        unsigned long            /* client/server security flags */
+       /* client/server security flags */
+       unsigned int
                                  rq_ctx_init:1,      /* context initiation */
                                  rq_ctx_fini:1,      /* context destroy */
                                  rq_bulk_read:1,     /* request bulk read */
@@ -789,21 +794,21 @@ struct ptlrpc_request {
         /* (server side), pointed directly into req buffer */
         struct ptlrpc_user_desc *rq_user_desc;
 
-        /** early replies go to offset 0, regular replies go after that */
-        unsigned int             rq_reply_off;
-
         /* various buffer pointers */
         struct lustre_msg       *rq_reqbuf;      /* req wrapper */
+       char                    *rq_repbuf;      /* rep buffer */
+       struct lustre_msg       *rq_repdata;     /* rep wrapper msg */
+       struct lustre_msg       *rq_clrbuf;      /* only in priv mode */
         int                      rq_reqbuf_len;  /* req wrapper buf len */
         int                      rq_reqdata_len; /* req wrapper msg len */
-        char                    *rq_repbuf;      /* rep buffer */
         int                      rq_repbuf_len;  /* rep buffer len */
-        struct lustre_msg       *rq_repdata;     /* rep wrapper msg */
         int                      rq_repdata_len; /* rep wrapper msg len */
-        struct lustre_msg       *rq_clrbuf;      /* only in priv mode */
         int                      rq_clrbuf_len;  /* only in priv mode */
         int                      rq_clrdata_len; /* only in priv mode */
 
+       /** early replies go to offset 0, regular replies go after that */
+       unsigned int             rq_reply_off;
+
         /** @} */
 
         /** Fields that help to see if request and reply were swabbed or not */
@@ -883,10 +888,10 @@ struct ptlrpc_request {
         int    rq_timeout;
 
         /** Multi-rpc bits */
-        /** Link item for request set lists */
-        cfs_list_t  rq_set_chain;
         /** Per-request waitq introduced by bug 21938 for recovery waiting */
         cfs_waitq_t rq_set_waitq;
+       /** Link item for request set lists */
+       cfs_list_t  rq_set_chain;
         /** Link back to the request set */
         struct ptlrpc_request_set *rq_set;
         /** Async completion handler, called when reply is received */
@@ -1767,9 +1772,31 @@ void ptlrpc_req_finished_with_imp_lock(struct ptlrpc_request *request);
 struct ptlrpc_request *ptlrpc_request_addref(struct ptlrpc_request *req);
 struct ptlrpc_bulk_desc *ptlrpc_prep_bulk_imp(struct ptlrpc_request *req,
                                               int npages, int type, int portal);
-void ptlrpc_free_bulk(struct ptlrpc_bulk_desc *bulk);
-void ptlrpc_prep_bulk_page(struct ptlrpc_bulk_desc *desc,
-                           cfs_page_t *page, int pageoffset, int len);
+void __ptlrpc_free_bulk(struct ptlrpc_bulk_desc *bulk, int pin);
+static inline void ptlrpc_free_bulk(struct ptlrpc_bulk_desc *bulk)
+{
+       __ptlrpc_free_bulk(bulk, 1);
+}
+static inline void ptlrpc_free_bulk_nopin(struct ptlrpc_bulk_desc *bulk)
+{
+       __ptlrpc_free_bulk(bulk, 0);
+}
+void __ptlrpc_prep_bulk_page(struct ptlrpc_bulk_desc *desc,
+                            cfs_page_t *page, int pageoffset, int len, int);
+static inline void ptlrpc_prep_bulk_page(struct ptlrpc_bulk_desc *desc,
+                                        cfs_page_t *page, int pageoffset,
+                                        int len)
+{
+       __ptlrpc_prep_bulk_page(desc, page, pageoffset, len, 1);
+}
+
+static inline void ptlrpc_prep_bulk_page_nopin(struct ptlrpc_bulk_desc *desc,
+                                              cfs_page_t *page, int pageoffset,
+                                              int len)
+{
+       __ptlrpc_prep_bulk_page(desc, page, pageoffset, len, 0);
+}
+
 void ptlrpc_retain_replayable_request(struct ptlrpc_request *req,
                                       struct obd_import *imp);
 __u64 ptlrpc_next_xid(void);
@@ -1965,7 +1992,7 @@ __u32 lustre_msg_get_timeout(struct lustre_msg *msg);
 __u32 lustre_msg_get_service_time(struct lustre_msg *msg);
 char *lustre_msg_get_jobid(struct lustre_msg *msg);
 __u32 lustre_msg_get_cksum(struct lustre_msg *msg);
-#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 9, 0, 0)
+#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2, 7, 50, 0)
 __u32 lustre_msg_calc_cksum(struct lustre_msg *msg, int compat18);
 #else
 # warning "remove checksum compatibility support for b1_8"
@@ -2273,14 +2300,13 @@ static inline void ptlrpc_lprocfs_brw(struct ptlrpc_request *req, int bytes) {}
 /** @} */
 
 /* ptlrpc/llog_server.c */
-int llog_origin_handle_create(struct ptlrpc_request *req);
+int llog_origin_handle_open(struct ptlrpc_request *req);
 int llog_origin_handle_destroy(struct ptlrpc_request *req);
 int llog_origin_handle_prev_block(struct ptlrpc_request *req);
 int llog_origin_handle_next_block(struct ptlrpc_request *req);
 int llog_origin_handle_read_header(struct ptlrpc_request *req);
 int llog_origin_handle_close(struct ptlrpc_request *req);
 int llog_origin_handle_cancel(struct ptlrpc_request *req);
-int llog_catinfo(struct ptlrpc_request *req);
 
 /* ptlrpc/llog_client.c */
 extern struct llog_operations llog_client_ops;