Skip to content

Commit d49433e

Browse files
author
Benny Halevy
committed
nfs41: cb_sequence proc implementation
Currently, just free up any referring calls information. Signed-off-by: Benny Halevy <[email protected]> [nfs41: fix csr_{,target}highestslotid] Signed-off-by: Benny Halevy <[email protected]>
1 parent 2d9b9ec commit d49433e

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

fs/nfs/callback.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ struct cb_sequenceres {
103103
uint32_t csr_target_highestslotid;
104104
};
105105

106+
extern unsigned nfs4_callback_sequence(struct cb_sequenceargs *args,
107+
struct cb_sequenceres *res);
108+
106109
#endif /* CONFIG_NFS_V4_1 */
107110

108111
extern __be32 nfs4_callback_getattr(struct cb_getattrargs *args, struct cb_getattrres *res);
@@ -119,6 +122,7 @@ extern void nfs_callback_down(int minorversion);
119122
* of slots for the backchannel.
120123
*/
121124
#define NFS41_BC_MIN_CALLBACKS 1
125+
#define NFS41_BC_MAX_CALLBACKS 1
122126

123127
extern unsigned int nfs_callback_set_tcpport;
124128
extern unsigned short nfs_callback_tcpport;

fs/nfs/callback_proc.c

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,3 +101,31 @@ __be32 nfs4_callback_recall(struct cb_recallargs *args, void *dummy)
101101
dprintk("%s: exit with status = %d\n", __func__, ntohl(res));
102102
return res;
103103
}
104+
105+
#if defined(CONFIG_NFS_V4_1)
106+
107+
/* FIXME: validate args->cbs_{sequence,slot}id */
108+
/* FIXME: referring calls should be processed */
109+
unsigned nfs4_callback_sequence(struct cb_sequenceargs *args,
110+
struct cb_sequenceres *res)
111+
{
112+
int i;
113+
unsigned status = 0;
114+
115+
for (i = 0; i < args->csa_nrclists; i++)
116+
kfree(args->csa_rclists[i].rcl_refcalls);
117+
kfree(args->csa_rclists);
118+
119+
memcpy(&res->csr_sessionid, &args->csa_sessionid,
120+
sizeof(res->csr_sessionid));
121+
res->csr_sequenceid = args->csa_sequenceid;
122+
res->csr_slotid = args->csa_slotid;
123+
res->csr_highestslotid = NFS41_BC_MAX_CALLBACKS - 1;
124+
res->csr_target_highestslotid = NFS41_BC_MAX_CALLBACKS - 1;
125+
126+
dprintk("%s: exit with status = %d\n", __func__, ntohl(status));
127+
res->csr_status = status;
128+
return status;
129+
}
130+
131+
#endif /* CONFIG_NFS_V4_1 */

0 commit comments

Comments
 (0)