Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 229220
b: refs/heads/master
c: c36fca5
h: refs/heads/master
v: v3
  • Loading branch information
Andy Adamson authored and Trond Myklebust committed Jan 6, 2011
1 parent 841768f commit d09999e
Show file tree
Hide file tree
Showing 8 changed files with 259 additions and 189 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2c2618c6f29c41a0a966f14f05c8bf45fcabb750
refs/heads/master: c36fca52f5e4594ffd0ff175b328966b0d393184
21 changes: 18 additions & 3 deletions trunk/fs/nfs/callback.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,7 @@
#include <linux/freezer.h>
#include <linux/kthread.h>
#include <linux/sunrpc/svcauth_gss.h>
#if defined(CONFIG_NFS_V4_1)
#include <linux/sunrpc/bc_xprt.h>
#endif

#include <net/inet_sock.h>

Expand Down Expand Up @@ -384,14 +382,31 @@ static int check_gss_callback_principal(struct nfs_client *clp,
return SVC_OK;
}

/* pg_authenticate method helper */
static struct nfs_client *nfs_cb_find_client(struct svc_rqst *rqstp)
{
struct nfs4_sessionid *sessionid = bc_xprt_sid(rqstp);
int is_cb_compound = rqstp->rq_proc == CB_COMPOUND ? 1 : 0;

dprintk("--> %s rq_proc %d\n", __func__, rqstp->rq_proc);
if (svc_is_backchannel(rqstp))
/* Sessionid (usually) set after CB_NULL ping */
return nfs4_find_client_sessionid(svc_addr(rqstp), sessionid,
is_cb_compound);
else
/* No callback identifier in pg_authenticate */
return nfs4_find_client_no_ident(svc_addr(rqstp));
}

/* pg_authenticate method for nfsv4 callback threads. */
static int nfs_callback_authenticate(struct svc_rqst *rqstp)
{
struct nfs_client *clp;
RPC_IFDEBUG(char buf[RPC_MAX_ADDRBUFLEN]);
int ret = SVC_OK;

/* Don't talk to strangers */
clp = nfs_find_client(svc_addr(rqstp), 4);
clp = nfs_cb_find_client(rqstp);
if (clp == NULL)
return SVC_DROP;

Expand Down
28 changes: 21 additions & 7 deletions trunk/fs/nfs/callback.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,17 @@ enum nfs4_callback_opnum {
OP_CB_ILLEGAL = 10044,
};

struct cb_process_state {
__be32 drc_status;
struct nfs_client *clp;
struct nfs4_sessionid *svc_sid; /* v4.1 callback service sessionid */
};

struct cb_compound_hdr_arg {
unsigned int taglen;
const char *tag;
unsigned int minorversion;
unsigned int cb_ident; /* v4.0 callback identifier */
unsigned nops;
};

Expand Down Expand Up @@ -103,8 +110,9 @@ struct cb_sequenceres {
uint32_t csr_target_highestslotid;
};

extern unsigned nfs4_callback_sequence(struct cb_sequenceargs *args,
struct cb_sequenceres *res);
extern __be32 nfs4_callback_sequence(struct cb_sequenceargs *args,
struct cb_sequenceres *res,
struct cb_process_state *cps);

extern int nfs41_validate_delegation_stateid(struct nfs_delegation *delegation,
const nfs4_stateid *stateid);
Expand All @@ -118,19 +126,25 @@ struct cb_recallanyargs {
uint32_t craa_type_mask;
};

extern unsigned nfs4_callback_recallany(struct cb_recallanyargs *args, void *dummy);
extern __be32 nfs4_callback_recallany(struct cb_recallanyargs *args,
void *dummy,
struct cb_process_state *cps);

struct cb_recallslotargs {
struct sockaddr *crsa_addr;
uint32_t crsa_target_max_slots;
};
extern unsigned nfs4_callback_recallslot(struct cb_recallslotargs *args,
void *dummy);
extern __be32 nfs4_callback_recallslot(struct cb_recallslotargs *args,
void *dummy,
struct cb_process_state *cps);

#endif /* CONFIG_NFS_V4_1 */

extern __be32 nfs4_callback_getattr(struct cb_getattrargs *args, struct cb_getattrres *res);
extern __be32 nfs4_callback_recall(struct cb_recallargs *args, void *dummy);
extern __be32 nfs4_callback_getattr(struct cb_getattrargs *args,
struct cb_getattrres *res,
struct cb_process_state *cps);
extern __be32 nfs4_callback_recall(struct cb_recallargs *args, void *dummy,
struct cb_process_state *cps);

#ifdef CONFIG_NFS_V4
extern int nfs_callback_up(u32 minorversion, struct rpc_xprt *xprt);
Expand Down
Loading

0 comments on commit d09999e

Please sign in to comment.