diff options
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/callback_proc.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/fs/nfs/callback_proc.c b/fs/nfs/callback_proc.c index f731bbe7ac6a..6b342e82ebb3 100644 --- a/fs/nfs/callback_proc.c +++ b/fs/nfs/callback_proc.c | |||
@@ -104,6 +104,42 @@ out: | |||
104 | 104 | ||
105 | #if defined(CONFIG_NFS_V4_1) | 105 | #if defined(CONFIG_NFS_V4_1) |
106 | 106 | ||
107 | /* | ||
108 | * Returns a pointer to a held 'struct nfs_client' that matches the server's | ||
109 | * address, major version number, and session ID. It is the caller's | ||
110 | * responsibility to release the returned reference. | ||
111 | * | ||
112 | * Returns NULL if there are no connections with sessions, or if no session | ||
113 | * matches the one of interest. | ||
114 | */ | ||
115 | static struct nfs_client *find_client_with_session( | ||
116 | const struct sockaddr *addr, u32 nfsversion, | ||
117 | struct nfs4_sessionid *sessionid) | ||
118 | { | ||
119 | struct nfs_client *clp; | ||
120 | |||
121 | clp = nfs_find_client(addr, 4); | ||
122 | if (clp == NULL) | ||
123 | return NULL; | ||
124 | |||
125 | do { | ||
126 | struct nfs_client *prev = clp; | ||
127 | |||
128 | if (clp->cl_session != NULL) { | ||
129 | if (memcmp(clp->cl_session->sess_id.data, | ||
130 | sessionid->data, | ||
131 | NFS4_MAX_SESSIONID_LEN) == 0) { | ||
132 | /* Returns a held reference to clp */ | ||
133 | return clp; | ||
134 | } | ||
135 | } | ||
136 | clp = nfs_find_client_next(prev); | ||
137 | nfs_put_client(prev); | ||
138 | } while (clp != NULL); | ||
139 | |||
140 | return NULL; | ||
141 | } | ||
142 | |||
107 | /* FIXME: validate args->cbs_{sequence,slot}id */ | 143 | /* FIXME: validate args->cbs_{sequence,slot}id */ |
108 | /* FIXME: referring calls should be processed */ | 144 | /* FIXME: referring calls should be processed */ |
109 | unsigned nfs4_callback_sequence(struct cb_sequenceargs *args, | 145 | unsigned nfs4_callback_sequence(struct cb_sequenceargs *args, |