]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - include/linux/nfsd/state.h
nfsd41: Backchannel: Server backchannel RPC wait queue
[mv-sheeva.git] / include / linux / nfsd / state.h
index ff0b771efde6ebb2d43e7ef69d29c0819a97c924..9cc40a137c340edee76308235113ca5ded7f555a 100644 (file)
@@ -60,6 +60,12 @@ typedef struct {
 #define si_stateownerid   si_opaque.so_stateownerid
 #define si_fileid         si_opaque.so_fileid
 
+struct nfsd4_cb_sequence {
+       /* args/res */
+       u32                     cbs_minorversion;
+       struct nfs4_client      *cbs_clp;
+};
+
 struct nfs4_delegation {
        struct list_head        dl_perfile;
        struct list_head        dl_perclnt;
@@ -89,35 +95,27 @@ struct nfs4_cb_conn {
        /* RPC client info */
        atomic_t                cb_set;     /* successful CB_NULL call */
        struct rpc_clnt *       cb_client;
-       struct rpc_cred *       cb_cred;
 };
 
 /* Maximum number of slots per session. 160 is useful for long haul TCP */
 #define NFSD_MAX_SLOTS_PER_SESSION     160
-/* Maximum number of pages per slot cache entry */
-#define NFSD_PAGES_PER_SLOT    1
-#define NFSD_SLOT_CACHE_SIZE           PAGE_SIZE
 /* Maximum number of operations per session compound */
 #define NFSD_MAX_OPS_PER_COMPOUND      16
+/* Maximum  session per slot cache size */
+#define NFSD_SLOT_CACHE_SIZE           1024
 /* Maximum number of NFSD_SLOT_CACHE_SIZE slots per session */
 #define NFSD_CACHE_SIZE_SLOTS_PER_SESSION      32
 #define NFSD_MAX_MEM_PER_SESSION  \
                (NFSD_CACHE_SIZE_SLOTS_PER_SESSION * NFSD_SLOT_CACHE_SIZE)
 
-struct nfsd4_cache_entry {
-       __be32          ce_status;
-       struct kvec     ce_datav; /* encoded NFSv4.1 data in rq_res.head[0] */
-       struct page     *ce_respages[NFSD_PAGES_PER_SLOT + 1];
-       int             ce_cachethis;
-       short           ce_resused;
-       int             ce_opcnt;
-       int             ce_rpchdrlen;
-};
-
 struct nfsd4_slot {
-       bool                            sl_inuse;
-       u32                             sl_seqid;
-       struct nfsd4_cache_entry        sl_cache_entry;
+       bool    sl_inuse;
+       bool    sl_cachethis;
+       u16     sl_opcnt;
+       u32     sl_seqid;
+       __be32  sl_status;
+       u32     sl_datalen;
+       char    sl_data[];
 };
 
 struct nfsd4_channel_attrs {
@@ -159,7 +157,7 @@ struct nfsd4_session {
        struct nfs4_sessionid   se_sessionid;
        struct nfsd4_channel_attrs se_fchannel;
        struct nfsd4_channel_attrs se_bchannel;
-       struct nfsd4_slot       se_slots[];     /* forward channel slots */
+       struct nfsd4_slot       *se_slots[];    /* forward channel slots */
 };
 
 static inline void
@@ -219,6 +217,13 @@ struct nfs4_client {
        struct nfsd4_clid_slot  cl_cs_slot;     /* create_session slot */
        u32                     cl_exchange_flags;
        struct nfs4_sessionid   cl_sessionid;
+
+       /* for nfs41 callbacks */
+       /* We currently support a single back channel with a single slot */
+       unsigned long           cl_cb_slot_busy;
+       struct svc_xprt         *cl_cb_xprt;    /* 4.1 callback transport */
+       struct rpc_wait_queue   cl_cb_waitq;    /* backchannel callers may */
+                                               /* wait here for slots */
 };
 
 /* struct nfs4_client_reset
@@ -369,6 +374,7 @@ extern int nfs4_in_grace(void);
 extern __be32 nfs4_check_open_reclaim(clientid_t *clid);
 extern void put_nfs4_client(struct nfs4_client *clp);
 extern void nfs4_free_stateowner(struct kref *kref);
+extern int set_callback_cred(void);
 extern void nfsd4_probe_callback(struct nfs4_client *clp);
 extern void nfsd4_cb_recall(struct nfs4_delegation *dp);
 extern void nfs4_put_delegation(struct nfs4_delegation *dp);