nfsd: remove unused field rq_reffh
[safe/jmp/linux-2.6] / include / linux / sunrpc / svc.h
index dc69068..5a3085b 100644 (file)
  */
 typedef int            (*svc_thread_fn)(void *);
 
+/* statistics for svc_pool structures */
+struct svc_pool_stats {
+       unsigned long   packets;
+       unsigned long   sockets_queued;
+       unsigned long   threads_woken;
+       unsigned long   threads_timedout;
+};
+
 /*
  *
  * RPC service thread pool.
@@ -41,6 +49,7 @@ struct svc_pool {
        struct list_head        sp_sockets;     /* pending sockets */
        unsigned int            sp_nrthreads;   /* # of threads in pool */
        struct list_head        sp_all_threads; /* all server threads */
+       struct svc_pool_stats   sp_stats;       /* statistics on pool operation */
 } ____cacheline_aligned_in_smp;
 
 /*
@@ -58,10 +67,13 @@ struct svc_serv {
        struct svc_stat *       sv_stats;       /* RPC statistics */
        spinlock_t              sv_lock;
        unsigned int            sv_nrthreads;   /* # of server threads */
+       unsigned int            sv_maxconn;     /* max connections allowed or
+                                                * '0' causing max to be based
+                                                * on number of threads. */
+
        unsigned int            sv_max_payload; /* datagram payload size */
        unsigned int            sv_max_mesg;    /* max_payload + 1 page for overheads */
        unsigned int            sv_xdrsize;     /* XDR buffer size */
-
        struct list_head        sv_permsocks;   /* all permanent sockets */
        struct list_head        sv_tempsocks;   /* all temporary sockets */
        int                     sv_tmpcnt;      /* count of temporary sockets */
@@ -80,6 +92,15 @@ struct svc_serv {
        struct module *         sv_module;      /* optional module to count when
                                                 * adding threads */
        svc_thread_fn           sv_function;    /* main function for threads */
+#if defined(CONFIG_NFS_V4_1)
+       struct list_head        sv_cb_list;     /* queue for callback requests
+                                                * that arrive over the same
+                                                * connection */
+       spinlock_t              sv_cb_lock;     /* protects the svc_cb_list */
+       wait_queue_head_t       sv_cb_waitq;    /* sleep here if there are no
+                                                * entries in the svc_cb_list */
+       struct svc_xprt         *bc_xprt;
+#endif /* CONFIG_NFS_V4_1 */
 };
 
 /*
@@ -215,6 +236,7 @@ struct svc_rqst {
        struct svc_cred         rq_cred;        /* auth info */
        void *                  rq_xprt_ctxt;   /* transport specific context ptr */
        struct svc_deferred_req*rq_deferred;    /* deferred request we are replaying */
+       int                     rq_usedeferral; /* use deferral */
 
        size_t                  rq_xprt_hlen;   /* xprt header len */
        struct xdr_buf          rq_arg;
@@ -251,10 +273,6 @@ struct svc_rqst {
        struct auth_domain *    rq_client;      /* RPC peer info */
        struct auth_domain *    rq_gssclient;   /* "gss/"-style peer info */
        struct svc_cacherep *   rq_cacherep;    /* cache info */
-       struct knfsd_fh *       rq_reffh;       /* Referrence filehandle, used to
-                                                * determine what device number
-                                                * to report (real or virtual)
-                                                */
        int                     rq_splice_ok;   /* turned off in gss privacy
                                                 * to prevent encrypting page
                                                 * cache pages */
@@ -265,17 +283,17 @@ struct svc_rqst {
 /*
  * Rigorous type checking on sockaddr type conversions
  */
-static inline struct sockaddr_in *svc_addr_in(struct svc_rqst *rqst)
+static inline struct sockaddr_in *svc_addr_in(const struct svc_rqst *rqst)
 {
        return (struct sockaddr_in *) &rqst->rq_addr;
 }
 
-static inline struct sockaddr_in6 *svc_addr_in6(struct svc_rqst *rqst)
+static inline struct sockaddr_in6 *svc_addr_in6(const struct svc_rqst *rqst)
 {
        return (struct sockaddr_in6 *) &rqst->rq_addr;
 }
 
-static inline struct sockaddr *svc_addr(struct svc_rqst *rqst)
+static inline struct sockaddr *svc_addr(const struct svc_rqst *rqst)
 {
        return (struct sockaddr *) &rqst->rq_addr;
 }
@@ -381,18 +399,23 @@ struct svc_procedure {
 /*
  * Function prototypes.
  */
-struct svc_serv *  svc_create(struct svc_program *, unsigned int,
-                             void (*shutdown)(struct svc_serv*));
+struct svc_serv *svc_create(struct svc_program *, unsigned int,
+                           void (*shutdown)(struct svc_serv *));
 struct svc_rqst *svc_prepare_thread(struct svc_serv *serv,
                                        struct svc_pool *pool);
 void              svc_exit_thread(struct svc_rqst *);
 struct svc_serv *  svc_create_pooled(struct svc_program *, unsigned int,
-                       void (*shutdown)(struct svc_serv*), svc_thread_fn,
-                       struct module *);
+                       void (*shutdown)(struct svc_serv *),
+                       svc_thread_fn, struct module *);
 int               svc_set_num_threads(struct svc_serv *, struct svc_pool *, int);
+int               svc_pool_stats_open(struct svc_serv *serv, struct file *file);
 void              svc_destroy(struct svc_serv *);
 int               svc_process(struct svc_rqst *);
-int               svc_register(struct svc_serv *, int, unsigned short);
+int               bc_svc_process(struct svc_serv *, struct rpc_rqst *,
+                       struct svc_rqst *);
+int               svc_register(const struct svc_serv *, const int,
+                               const unsigned short, const unsigned short);
+
 void              svc_wake_up(struct svc_serv *);
 void              svc_reserve(struct svc_rqst *rqstp, int space);
 struct svc_pool *  svc_pool_for_cpu(struct svc_serv *serv, int cpu);