* in the LICENSE file that accompanied this code).
*
* You should have received a copy of the GNU General Public License
- * version 2 along with this program; If not, see [sun.com URL with a
- * copy of GPLv2].
+ * version 2 along with this program; If not, see
+ * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
* CA 95054 USA or visit www.sun.com if you need additional information or
#define ptlrpc_req_async_args(req) ((void *)&req->rq_async_args)
struct ptlrpc_connection {
- struct list_head c_link;
struct hlist_node c_hash;
lnet_nid_t c_self;
lnet_process_id_t c_peer;
};
struct ptlrpc_client {
- __u32 cli_request_portal;
- __u32 cli_reply_portal;
- char *cli_name;
+ __u32 cli_request_portal;
+ __u32 cli_reply_portal;
+ char *cli_name;
};
/* state flags of requests */
void *cbid_arg; /* additional arg */
};
-#define RS_MAX_LOCKS 4
+#define RS_MAX_LOCKS 8
#define RS_DEBUG 1
struct ptlrpc_reply_state {
#endif
/* updates to following flag serialised by srv_request_lock */
unsigned long rs_difficult:1; /* ACK/commit stuff */
+ unsigned long rs_no_ack:1; /* no ACK, even for
+ difficult requests */
unsigned long rs_scheduled:1; /* being handled? */
unsigned long rs_scheduled_ever:1;/* any schedule attempts? */
unsigned long rs_handled:1; /* been handled yet? */
RQ_PHASE_COMPLETE = 0xebc0de04,
};
+/** Type of request interpreter call-back */
+typedef int (*ptlrpc_interpterer_t)(const struct lu_env *env,
+ struct ptlrpc_request *req,
+ void *arg, int rc);
+
struct ptlrpc_request_pool {
spinlock_t prp_lock;
struct list_head prp_req_list; /* list of ptlrpc_request structs */
struct lu_context;
struct lu_env;
+/**
+ * Represents remote procedure call.
+ */
struct ptlrpc_request {
int rq_type; /* one of PTL_RPC_MSG_* */
struct list_head rq_list;
/* Multi-rpc bits */
struct list_head rq_set_chain;
struct ptlrpc_request_set *rq_set;
- void *rq_interpret_reply; /* Async completion handler */
+ /** Async completion handler */
+ ptlrpc_interpterer_t rq_interpret_reply;
union ptlrpc_async_args rq_async_args; /* Async completion context */
struct ptlrpc_request_pool *rq_pool; /* Pool if request from
preallocated list */
}
static inline int lustre_req_swabbed(struct ptlrpc_request *req, int index)
-{
+{
LASSERT(index < sizeof(req->rq_req_swab_mask) * 8);
return req->rq_req_swab_mask & (1 << index);
}
struct ptlrpc_thread {
- struct list_head t_link; /* active threads for service, from svc->srv_threads */
+ struct list_head t_link; /* active threads in svc->srv_threads */
void *t_data; /* thread-private data (preallocated memory) */
__u32 t_flags;
int srv_watchdog_factor; /* soft watchdog timeout mutiplier */
unsigned srv_cpu_affinity:1; /* bind threads to CPUs */
unsigned srv_at_check:1; /* check early replies */
+ unsigned srv_is_stopping:1; /* under unregister_service */
cfs_time_t srv_at_checktime; /* debug */
__u32 srv_req_portal;
* Thread name used in cfs_daemonize()
*/
char pc_name[16];
+ /**
+ * Environment for request interpreters to run in.
+ */
+ struct lu_env pc_env;
#ifndef __KERNEL__
/**
- * Async rpcs flag to make sure that ptlrpcd_check() is called only
+ * Async rpcs flag to make sure that ptlrpcd_check() is called only
* once.
*/
int pc_recurred;
*/
LIOD_STOP = 1 << 1,
/**
- * Ptlrpc thread stop force flag. This will cause also
+ * Ptlrpc thread stop force flag. This will cause also
* aborting any inflight rpcs handled by thread.
*/
LIOD_STOP_FORCE = 1 << 2
extern void server_bulk_callback (lnet_event_t *ev);
/* ptlrpc/connection.c */
-void ptlrpc_dump_connections(void);
-void ptlrpc_readdress_connection(struct ptlrpc_connection *, struct obd_uuid *);
-struct ptlrpc_connection *ptlrpc_get_connection(lnet_process_id_t peer,
- lnet_nid_t self, struct obd_uuid *uuid);
-int ptlrpc_put_connection(struct ptlrpc_connection *c);
+struct ptlrpc_connection *ptlrpc_connection_get(lnet_process_id_t peer,
+ lnet_nid_t self,
+ struct obd_uuid *uuid);
+int ptlrpc_connection_put(struct ptlrpc_connection *c);
struct ptlrpc_connection *ptlrpc_connection_addref(struct ptlrpc_connection *);
-int ptlrpc_init_connection(void);
-void ptlrpc_cleanup_connection(void);
+int ptlrpc_connection_init(void);
+void ptlrpc_connection_fini(void);
extern lnet_pid_t ptl_get_pid(void);
/* ptlrpc/niobuf.c */
int ptlrpc_set_add_cb(struct ptlrpc_request_set *set,
set_interpreter_func fn, void *data);
int ptlrpc_set_next_timeout(struct ptlrpc_request_set *);
-int ptlrpc_check_set(struct ptlrpc_request_set *set);
+int ptlrpc_check_set(const struct lu_env *env, struct ptlrpc_request_set *set);
int ptlrpc_set_wait(struct ptlrpc_request_set *);
int ptlrpc_expired_set(void *data);
void ptlrpc_interrupted_set(void *data);
__u32 version, int opcode,
int count, __u32 *lengths, char **bufs,
struct ptlrpc_request_pool *pool);
-void ptlrpc_free_req(struct ptlrpc_request *request);
void ptlrpc_req_finished(struct ptlrpc_request *request);
void ptlrpc_req_finished_with_imp_lock(struct ptlrpc_request *request);
struct ptlrpc_request *ptlrpc_request_addref(struct ptlrpc_request *req);
/* ptlrpc/service.c */
void ptlrpc_save_lock (struct ptlrpc_request *req,
- struct lustre_handle *lock, int mode);
+ struct lustre_handle *lock, int mode, int no_ack);
void ptlrpc_commit_replies (struct obd_device *obd);
void ptlrpc_schedule_difficult_reply (struct ptlrpc_reply_state *rs);
struct ptlrpc_service *ptlrpc_init_svc_conf(struct ptlrpc_service_conf *c,
#ifdef LPROCFS
void ptlrpc_lprocfs_register_obd(struct obd_device *obd);
void ptlrpc_lprocfs_unregister_obd(struct obd_device *obd);
-void ptlrpc_lprocfs_brw(struct ptlrpc_request *req, int opc, int bytes);
+void ptlrpc_lprocfs_brw(struct ptlrpc_request *req, int bytes);
#else
static inline void ptlrpc_lprocfs_register_obd(struct obd_device *obd) {}
static inline void ptlrpc_lprocfs_unregister_obd(struct obd_device *obd) {}
-static inline void ptlrpc_lprocfs_brw(struct ptlrpc_request *req, int opc,
- int bytes) {}
+static inline void ptlrpc_lprocfs_brw(struct ptlrpc_request *req, int bytes) {}
#endif
/* ptlrpc/llog_server.c */