Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * linux/fs/nfs/callback_proc.c |
| 3 | * |
| 4 | * Copyright (C) 2004 Trond Myklebust |
| 5 | * |
| 6 | * NFSv4 callback procedures |
| 7 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | #include <linux/nfs4.h> |
| 9 | #include <linux/nfs_fs.h> |
Tejun Heo | 5a0e3ad | 2010-03-24 17:04:11 +0900 | [diff] [blame] | 10 | #include <linux/slab.h> |
Trond Myklebust | 2446ab6 | 2012-03-01 17:00:56 -0500 | [diff] [blame] | 11 | #include <linux/rcupdate.h> |
Trond Myklebust | 4ce7971 | 2005-06-22 17:16:21 +0000 | [diff] [blame] | 12 | #include "nfs4_fs.h" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | #include "callback.h" |
| 14 | #include "delegation.h" |
David Howells | 24c8dbb | 2006-08-22 20:06:10 -0400 | [diff] [blame] | 15 | #include "internal.h" |
Fred Isaman | 43f1b3d | 2011-01-06 11:36:30 +0000 | [diff] [blame] | 16 | #include "pnfs.h" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | |
Chuck Lever | 1d98fe6 | 2007-12-10 14:57:23 -0500 | [diff] [blame] | 18 | #ifdef NFS_DEBUG |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | #define NFSDBG_FACILITY NFSDBG_CALLBACK |
Chuck Lever | 1d98fe6 | 2007-12-10 14:57:23 -0500 | [diff] [blame] | 20 | #endif |
Andy Adamson | c36fca5 | 2011-01-06 02:04:32 +0000 | [diff] [blame] | 21 | |
| 22 | __be32 nfs4_callback_getattr(struct cb_getattrargs *args, |
| 23 | struct cb_getattrres *res, |
| 24 | struct cb_process_state *cps) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | struct nfs_delegation *delegation; |
| 27 | struct nfs_inode *nfsi; |
| 28 | struct inode *inode; |
Chuck Lever | 1d98fe6 | 2007-12-10 14:57:23 -0500 | [diff] [blame] | 29 | |
Andy Adamson | c36fca5 | 2011-01-06 02:04:32 +0000 | [diff] [blame] | 30 | res->status = htonl(NFS4ERR_OP_NOT_IN_SESSION); |
| 31 | if (!cps->clp) /* Always set for v4.0. Set in cb_sequence for v4.1 */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | goto out; |
Chuck Lever | 1d98fe6 | 2007-12-10 14:57:23 -0500 | [diff] [blame] | 33 | |
Andy Adamson | c36fca5 | 2011-01-06 02:04:32 +0000 | [diff] [blame] | 34 | res->bitmap[0] = res->bitmap[1] = 0; |
| 35 | res->status = htonl(NFS4ERR_BADHANDLE); |
Chuck Lever | 1d98fe6 | 2007-12-10 14:57:23 -0500 | [diff] [blame] | 36 | |
Trond Myklebust | 2446ab6 | 2012-03-01 17:00:56 -0500 | [diff] [blame] | 37 | dprintk_rcu("NFS: GETATTR callback request from %s\n", |
Andy Adamson | c36fca5 | 2011-01-06 02:04:32 +0000 | [diff] [blame] | 38 | rpc_peeraddr2str(cps->clp->cl_rpcclient, RPC_DISPLAY_ADDR)); |
| 39 | |
| 40 | inode = nfs_delegation_find_inode(cps->clp, &args->fh); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | if (inode == NULL) |
Andy Adamson | c36fca5 | 2011-01-06 02:04:32 +0000 | [diff] [blame] | 42 | goto out; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 43 | nfsi = NFS_I(inode); |
Trond Myklebust | 761fe93 | 2010-08-04 09:29:52 -0400 | [diff] [blame] | 44 | rcu_read_lock(); |
| 45 | delegation = rcu_dereference(nfsi->delegation); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 46 | if (delegation == NULL || (delegation->type & FMODE_WRITE) == 0) |
| 47 | goto out_iput; |
| 48 | res->size = i_size_read(inode); |
Trond Myklebust | beb2a5e | 2006-01-03 09:55:37 +0100 | [diff] [blame] | 49 | res->change_attr = delegation->change_attr; |
| 50 | if (nfsi->npages != 0) |
| 51 | res->change_attr++; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 52 | res->ctime = inode->i_ctime; |
| 53 | res->mtime = inode->i_mtime; |
| 54 | res->bitmap[0] = (FATTR4_WORD0_CHANGE|FATTR4_WORD0_SIZE) & |
| 55 | args->bitmap[0]; |
| 56 | res->bitmap[1] = (FATTR4_WORD1_TIME_METADATA|FATTR4_WORD1_TIME_MODIFY) & |
| 57 | args->bitmap[1]; |
| 58 | res->status = 0; |
| 59 | out_iput: |
Trond Myklebust | 761fe93 | 2010-08-04 09:29:52 -0400 | [diff] [blame] | 60 | rcu_read_unlock(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 61 | iput(inode); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 62 | out: |
Harvey Harrison | 3110ff8 | 2008-05-02 13:42:44 -0700 | [diff] [blame] | 63 | dprintk("%s: exit with status = %d\n", __func__, ntohl(res->status)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 64 | return res->status; |
| 65 | } |
| 66 | |
Andy Adamson | c36fca5 | 2011-01-06 02:04:32 +0000 | [diff] [blame] | 67 | __be32 nfs4_callback_recall(struct cb_recallargs *args, void *dummy, |
| 68 | struct cb_process_state *cps) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 69 | { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 70 | struct inode *inode; |
Al Viro | e6f684f | 2006-10-19 23:28:50 -0700 | [diff] [blame] | 71 | __be32 res; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 72 | |
Andy Adamson | c36fca5 | 2011-01-06 02:04:32 +0000 | [diff] [blame] | 73 | res = htonl(NFS4ERR_OP_NOT_IN_SESSION); |
| 74 | if (!cps->clp) /* Always set for v4.0. Set in cb_sequence for v4.1 */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 75 | goto out; |
Chuck Lever | 1d98fe6 | 2007-12-10 14:57:23 -0500 | [diff] [blame] | 76 | |
Trond Myklebust | 2446ab6 | 2012-03-01 17:00:56 -0500 | [diff] [blame] | 77 | dprintk_rcu("NFS: RECALL callback request from %s\n", |
Andy Adamson | c36fca5 | 2011-01-06 02:04:32 +0000 | [diff] [blame] | 78 | rpc_peeraddr2str(cps->clp->cl_rpcclient, RPC_DISPLAY_ADDR)); |
Chuck Lever | 1d98fe6 | 2007-12-10 14:57:23 -0500 | [diff] [blame] | 79 | |
Andy Adamson | c36fca5 | 2011-01-06 02:04:32 +0000 | [diff] [blame] | 80 | res = htonl(NFS4ERR_BADHANDLE); |
| 81 | inode = nfs_delegation_find_inode(cps->clp, &args->fh); |
| 82 | if (inode == NULL) |
| 83 | goto out; |
| 84 | /* Set up a helper thread to actually return the delegation */ |
| 85 | switch (nfs_async_inode_return_delegation(inode, &args->stateid)) { |
| 86 | case 0: |
| 87 | res = 0; |
| 88 | break; |
| 89 | case -ENOENT: |
Trond Myklebust | 8e663f0 | 2012-03-04 18:13:56 -0500 | [diff] [blame] | 90 | res = htonl(NFS4ERR_BAD_STATEID); |
Andy Adamson | c36fca5 | 2011-01-06 02:04:32 +0000 | [diff] [blame] | 91 | break; |
| 92 | default: |
| 93 | res = htonl(NFS4ERR_RESOURCE); |
| 94 | } |
| 95 | iput(inode); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 96 | out: |
Harvey Harrison | 3110ff8 | 2008-05-02 13:42:44 -0700 | [diff] [blame] | 97 | dprintk("%s: exit with status = %d\n", __func__, ntohl(res)); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 98 | return res; |
| 99 | } |
Benny Halevy | d49433e | 2009-04-01 09:23:25 -0400 | [diff] [blame] | 100 | |
| 101 | #if defined(CONFIG_NFS_V4_1) |
| 102 | |
Benny Halevy | d36b7cf | 2012-01-22 16:03:39 +0200 | [diff] [blame] | 103 | /* |
| 104 | * Lookup a layout by filehandle. |
| 105 | * |
| 106 | * Note: gets a refcount on the layout hdr and on its respective inode. |
| 107 | * Caller must put the layout hdr and the inode. |
| 108 | * |
| 109 | * TODO: keep track of all layouts (and delegations) in a hash table |
| 110 | * hashed by filehandle. |
| 111 | */ |
| 112 | static struct pnfs_layout_hdr * get_layout_by_fh_locked(struct nfs_client *clp, struct nfs_fh *fh) |
Fred Isaman | 43f1b3d | 2011-01-06 11:36:30 +0000 | [diff] [blame] | 113 | { |
Weston Andros Adamson | 6382a44 | 2011-06-01 16:44:44 -0400 | [diff] [blame] | 114 | struct nfs_server *server; |
Fred Isaman | 43f1b3d | 2011-01-06 11:36:30 +0000 | [diff] [blame] | 115 | struct inode *ino; |
Benny Halevy | d36b7cf | 2012-01-22 16:03:39 +0200 | [diff] [blame] | 116 | struct pnfs_layout_hdr *lo; |
Fred Isaman | 43f1b3d | 2011-01-06 11:36:30 +0000 | [diff] [blame] | 117 | |
Weston Andros Adamson | 6382a44 | 2011-06-01 16:44:44 -0400 | [diff] [blame] | 118 | list_for_each_entry_rcu(server, &clp->cl_superblocks, client_link) { |
| 119 | list_for_each_entry(lo, &server->layouts, plh_layouts) { |
Benny Halevy | d36b7cf | 2012-01-22 16:03:39 +0200 | [diff] [blame] | 120 | if (nfs_compare_fh(fh, &NFS_I(lo->plh_inode)->fh)) |
Weston Andros Adamson | 6382a44 | 2011-06-01 16:44:44 -0400 | [diff] [blame] | 121 | continue; |
| 122 | ino = igrab(lo->plh_inode); |
| 123 | if (!ino) |
| 124 | continue; |
Trond Myklebust | 9c62638 | 2012-09-20 17:31:43 -0400 | [diff] [blame] | 125 | spin_lock(&ino->i_lock); |
| 126 | /* Is this layout in the process of being freed? */ |
| 127 | if (NFS_I(ino)->layout != lo) { |
| 128 | spin_unlock(&ino->i_lock); |
| 129 | iput(ino); |
| 130 | continue; |
| 131 | } |
Trond Myklebust | 70c3bd2 | 2012-09-18 20:51:13 -0400 | [diff] [blame] | 132 | pnfs_get_layout_hdr(lo); |
Trond Myklebust | 9c62638 | 2012-09-20 17:31:43 -0400 | [diff] [blame] | 133 | spin_unlock(&ino->i_lock); |
Benny Halevy | d36b7cf | 2012-01-22 16:03:39 +0200 | [diff] [blame] | 134 | return lo; |
Weston Andros Adamson | 6382a44 | 2011-06-01 16:44:44 -0400 | [diff] [blame] | 135 | } |
Fred Isaman | 43f1b3d | 2011-01-06 11:36:30 +0000 | [diff] [blame] | 136 | } |
Benny Halevy | d36b7cf | 2012-01-22 16:03:39 +0200 | [diff] [blame] | 137 | |
| 138 | return NULL; |
| 139 | } |
| 140 | |
| 141 | static struct pnfs_layout_hdr * get_layout_by_fh(struct nfs_client *clp, struct nfs_fh *fh) |
| 142 | { |
| 143 | struct pnfs_layout_hdr *lo; |
| 144 | |
| 145 | spin_lock(&clp->cl_lock); |
| 146 | rcu_read_lock(); |
| 147 | lo = get_layout_by_fh_locked(clp, fh); |
Weston Andros Adamson | 6382a44 | 2011-06-01 16:44:44 -0400 | [diff] [blame] | 148 | rcu_read_unlock(); |
Fred Isaman | 43f1b3d | 2011-01-06 11:36:30 +0000 | [diff] [blame] | 149 | spin_unlock(&clp->cl_lock); |
Weston Andros Adamson | 6382a44 | 2011-06-01 16:44:44 -0400 | [diff] [blame] | 150 | |
Benny Halevy | d36b7cf | 2012-01-22 16:03:39 +0200 | [diff] [blame] | 151 | return lo; |
| 152 | } |
| 153 | |
| 154 | static u32 initiate_file_draining(struct nfs_client *clp, |
| 155 | struct cb_layoutrecallargs *args) |
| 156 | { |
| 157 | struct inode *ino; |
| 158 | struct pnfs_layout_hdr *lo; |
| 159 | u32 rv = NFS4ERR_NOMATCHING_LAYOUT; |
| 160 | LIST_HEAD(free_me_list); |
| 161 | |
| 162 | lo = get_layout_by_fh(clp, &args->cbl_fh); |
| 163 | if (!lo) |
Fred Isaman | 43f1b3d | 2011-01-06 11:36:30 +0000 | [diff] [blame] | 164 | return NFS4ERR_NOMATCHING_LAYOUT; |
| 165 | |
Benny Halevy | d36b7cf | 2012-01-22 16:03:39 +0200 | [diff] [blame] | 166 | ino = lo->plh_inode; |
Fred Isaman | 43f1b3d | 2011-01-06 11:36:30 +0000 | [diff] [blame] | 167 | spin_lock(&ino->i_lock); |
| 168 | if (test_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags) || |
Trond Myklebust | 49a8506 | 2012-09-18 20:43:31 -0400 | [diff] [blame] | 169 | pnfs_mark_matching_lsegs_invalid(lo, &free_me_list, |
Benny Halevy | 778b550 | 2011-05-22 19:48:02 +0300 | [diff] [blame] | 170 | &args->cbl_range)) |
Fred Isaman | 43f1b3d | 2011-01-06 11:36:30 +0000 | [diff] [blame] | 171 | rv = NFS4ERR_DELAY; |
| 172 | else |
| 173 | rv = NFS4ERR_NOMATCHING_LAYOUT; |
| 174 | pnfs_set_layout_stateid(lo, &args->cbl_stateid, true); |
| 175 | spin_unlock(&ino->i_lock); |
| 176 | pnfs_free_lseg_list(&free_me_list); |
Trond Myklebust | 70c3bd2 | 2012-09-18 20:51:13 -0400 | [diff] [blame] | 177 | pnfs_put_layout_hdr(lo); |
Fred Isaman | 43f1b3d | 2011-01-06 11:36:30 +0000 | [diff] [blame] | 178 | iput(ino); |
| 179 | return rv; |
| 180 | } |
| 181 | |
| 182 | static u32 initiate_bulk_draining(struct nfs_client *clp, |
| 183 | struct cb_layoutrecallargs *args) |
| 184 | { |
Weston Andros Adamson | 6382a44 | 2011-06-01 16:44:44 -0400 | [diff] [blame] | 185 | struct nfs_server *server; |
Fred Isaman | 43f1b3d | 2011-01-06 11:36:30 +0000 | [diff] [blame] | 186 | struct pnfs_layout_hdr *lo; |
| 187 | struct inode *ino; |
| 188 | u32 rv = NFS4ERR_NOMATCHING_LAYOUT; |
| 189 | struct pnfs_layout_hdr *tmp; |
| 190 | LIST_HEAD(recall_list); |
| 191 | LIST_HEAD(free_me_list); |
| 192 | struct pnfs_layout_range range = { |
| 193 | .iomode = IOMODE_ANY, |
| 194 | .offset = 0, |
| 195 | .length = NFS4_MAX_UINT64, |
| 196 | }; |
| 197 | |
| 198 | spin_lock(&clp->cl_lock); |
Weston Andros Adamson | 6382a44 | 2011-06-01 16:44:44 -0400 | [diff] [blame] | 199 | rcu_read_lock(); |
| 200 | list_for_each_entry_rcu(server, &clp->cl_superblocks, client_link) { |
Fred Isaman | 43f1b3d | 2011-01-06 11:36:30 +0000 | [diff] [blame] | 201 | if ((args->cbl_recall_type == RETURN_FSID) && |
Weston Andros Adamson | 6382a44 | 2011-06-01 16:44:44 -0400 | [diff] [blame] | 202 | memcmp(&server->fsid, &args->cbl_fsid, |
| 203 | sizeof(struct nfs_fsid))) |
Fred Isaman | 43f1b3d | 2011-01-06 11:36:30 +0000 | [diff] [blame] | 204 | continue; |
Weston Andros Adamson | 6382a44 | 2011-06-01 16:44:44 -0400 | [diff] [blame] | 205 | |
| 206 | list_for_each_entry(lo, &server->layouts, plh_layouts) { |
Trond Myklebust | 9c62638 | 2012-09-20 17:31:43 -0400 | [diff] [blame] | 207 | ino = igrab(lo->plh_inode); |
| 208 | if (ino) |
Weston Andros Adamson | 6382a44 | 2011-06-01 16:44:44 -0400 | [diff] [blame] | 209 | continue; |
Trond Myklebust | 9c62638 | 2012-09-20 17:31:43 -0400 | [diff] [blame] | 210 | spin_lock(&ino->i_lock); |
| 211 | /* Is this layout in the process of being freed? */ |
| 212 | if (NFS_I(ino)->layout != lo) { |
| 213 | spin_unlock(&ino->i_lock); |
| 214 | iput(ino); |
| 215 | continue; |
| 216 | } |
Trond Myklebust | 70c3bd2 | 2012-09-18 20:51:13 -0400 | [diff] [blame] | 217 | pnfs_get_layout_hdr(lo); |
Trond Myklebust | 9c62638 | 2012-09-20 17:31:43 -0400 | [diff] [blame] | 218 | spin_unlock(&ino->i_lock); |
Weston Andros Adamson | 6382a44 | 2011-06-01 16:44:44 -0400 | [diff] [blame] | 219 | list_add(&lo->plh_bulk_recall, &recall_list); |
| 220 | } |
Fred Isaman | 43f1b3d | 2011-01-06 11:36:30 +0000 | [diff] [blame] | 221 | } |
Weston Andros Adamson | 6382a44 | 2011-06-01 16:44:44 -0400 | [diff] [blame] | 222 | rcu_read_unlock(); |
Fred Isaman | 43f1b3d | 2011-01-06 11:36:30 +0000 | [diff] [blame] | 223 | spin_unlock(&clp->cl_lock); |
Weston Andros Adamson | 6382a44 | 2011-06-01 16:44:44 -0400 | [diff] [blame] | 224 | |
Fred Isaman | 43f1b3d | 2011-01-06 11:36:30 +0000 | [diff] [blame] | 225 | list_for_each_entry_safe(lo, tmp, |
| 226 | &recall_list, plh_bulk_recall) { |
| 227 | ino = lo->plh_inode; |
| 228 | spin_lock(&ino->i_lock); |
| 229 | set_bit(NFS_LAYOUT_BULK_RECALL, &lo->plh_flags); |
Trond Myklebust | 49a8506 | 2012-09-18 20:43:31 -0400 | [diff] [blame] | 230 | if (pnfs_mark_matching_lsegs_invalid(lo, &free_me_list, &range)) |
Fred Isaman | 43f1b3d | 2011-01-06 11:36:30 +0000 | [diff] [blame] | 231 | rv = NFS4ERR_DELAY; |
| 232 | list_del_init(&lo->plh_bulk_recall); |
| 233 | spin_unlock(&ino->i_lock); |
Fred Isaman | f49f9ba | 2011-02-03 18:28:52 +0000 | [diff] [blame] | 234 | pnfs_free_lseg_list(&free_me_list); |
Trond Myklebust | 70c3bd2 | 2012-09-18 20:51:13 -0400 | [diff] [blame] | 235 | pnfs_put_layout_hdr(lo); |
Fred Isaman | 43f1b3d | 2011-01-06 11:36:30 +0000 | [diff] [blame] | 236 | iput(ino); |
| 237 | } |
Fred Isaman | 43f1b3d | 2011-01-06 11:36:30 +0000 | [diff] [blame] | 238 | return rv; |
| 239 | } |
| 240 | |
| 241 | static u32 do_callback_layoutrecall(struct nfs_client *clp, |
| 242 | struct cb_layoutrecallargs *args) |
| 243 | { |
Trond Myklebust | 0cb3284 | 2012-03-01 11:17:50 -0500 | [diff] [blame] | 244 | u32 res; |
Fred Isaman | 43f1b3d | 2011-01-06 11:36:30 +0000 | [diff] [blame] | 245 | |
| 246 | dprintk("%s enter, type=%i\n", __func__, args->cbl_recall_type); |
Fred Isaman | 43f1b3d | 2011-01-06 11:36:30 +0000 | [diff] [blame] | 247 | if (args->cbl_recall_type == RETURN_FILE) |
| 248 | res = initiate_file_draining(clp, args); |
| 249 | else |
| 250 | res = initiate_bulk_draining(clp, args); |
Fred Isaman | 43f1b3d | 2011-01-06 11:36:30 +0000 | [diff] [blame] | 251 | dprintk("%s returning %i\n", __func__, res); |
| 252 | return res; |
| 253 | |
| 254 | } |
| 255 | |
Fred Isaman | f2a6256 | 2011-01-06 11:36:29 +0000 | [diff] [blame] | 256 | __be32 nfs4_callback_layoutrecall(struct cb_layoutrecallargs *args, |
| 257 | void *dummy, struct cb_process_state *cps) |
| 258 | { |
Fred Isaman | 43f1b3d | 2011-01-06 11:36:30 +0000 | [diff] [blame] | 259 | u32 res; |
| 260 | |
| 261 | dprintk("%s: -->\n", __func__); |
| 262 | |
| 263 | if (cps->clp) |
| 264 | res = do_callback_layoutrecall(cps->clp, args); |
| 265 | else |
| 266 | res = NFS4ERR_OP_NOT_IN_SESSION; |
| 267 | |
| 268 | dprintk("%s: exit with status = %d\n", __func__, res); |
| 269 | return cpu_to_be32(res); |
Fred Isaman | f2a6256 | 2011-01-06 11:36:29 +0000 | [diff] [blame] | 270 | } |
| 271 | |
Alexandros Batsakis | 3684037 | 2011-01-06 11:36:31 +0000 | [diff] [blame] | 272 | static void pnfs_recall_all_layouts(struct nfs_client *clp) |
| 273 | { |
| 274 | struct cb_layoutrecallargs args; |
| 275 | |
| 276 | /* Pretend we got a CB_LAYOUTRECALL(ALL) */ |
| 277 | memset(&args, 0, sizeof(args)); |
| 278 | args.cbl_recall_type = RETURN_ALL; |
| 279 | /* FIXME we ignore errors, what should we do? */ |
| 280 | do_callback_layoutrecall(clp, &args); |
| 281 | } |
| 282 | |
Marc Eshel | 1be5683 | 2011-05-22 19:47:09 +0300 | [diff] [blame] | 283 | __be32 nfs4_callback_devicenotify(struct cb_devicenotifyargs *args, |
| 284 | void *dummy, struct cb_process_state *cps) |
| 285 | { |
| 286 | int i; |
| 287 | __be32 res = 0; |
| 288 | struct nfs_client *clp = cps->clp; |
| 289 | struct nfs_server *server = NULL; |
| 290 | |
| 291 | dprintk("%s: -->\n", __func__); |
| 292 | |
| 293 | if (!clp) { |
| 294 | res = cpu_to_be32(NFS4ERR_OP_NOT_IN_SESSION); |
| 295 | goto out; |
| 296 | } |
| 297 | |
| 298 | for (i = 0; i < args->ndevs; i++) { |
| 299 | struct cb_devicenotifyitem *dev = &args->devs[i]; |
| 300 | |
| 301 | if (!server || |
| 302 | server->pnfs_curr_ld->id != dev->cbd_layout_type) { |
| 303 | rcu_read_lock(); |
| 304 | list_for_each_entry_rcu(server, &clp->cl_superblocks, client_link) |
| 305 | if (server->pnfs_curr_ld && |
| 306 | server->pnfs_curr_ld->id == dev->cbd_layout_type) { |
| 307 | rcu_read_unlock(); |
| 308 | goto found; |
| 309 | } |
| 310 | rcu_read_unlock(); |
| 311 | dprintk("%s: layout type %u not found\n", |
| 312 | __func__, dev->cbd_layout_type); |
| 313 | continue; |
| 314 | } |
| 315 | |
| 316 | found: |
| 317 | if (dev->cbd_notify_type == NOTIFY_DEVICEID4_CHANGE) |
| 318 | dprintk("%s: NOTIFY_DEVICEID4_CHANGE not supported, " |
| 319 | "deleting instead\n", __func__); |
Benny Halevy | 35c8bb5 | 2011-05-24 18:04:02 +0300 | [diff] [blame] | 320 | nfs4_delete_deviceid(server->pnfs_curr_ld, clp, &dev->cbd_dev_id); |
Marc Eshel | 1be5683 | 2011-05-22 19:47:09 +0300 | [diff] [blame] | 321 | } |
| 322 | |
| 323 | out: |
| 324 | kfree(args->devs); |
| 325 | dprintk("%s: exit with status = %u\n", |
| 326 | __func__, be32_to_cpu(res)); |
| 327 | return res; |
| 328 | } |
| 329 | |
Ricardo Labiaga | 963891a | 2009-04-01 09:23:34 -0400 | [diff] [blame] | 330 | /* |
Ricardo Labiaga | 68f3f90 | 2009-04-01 09:23:35 -0400 | [diff] [blame] | 331 | * Validate the sequenceID sent by the server. |
| 332 | * Return success if the sequenceID is one more than what we last saw on |
| 333 | * this slot, accounting for wraparound. Increments the slot's sequence. |
| 334 | * |
Andy Adamson | 4911096 | 2010-01-14 17:45:08 -0500 | [diff] [blame] | 335 | * We don't yet implement a duplicate request cache, instead we set the |
| 336 | * back channel ca_maxresponsesize_cached to zero. This is OK for now |
Ricardo Labiaga | 68f3f90 | 2009-04-01 09:23:35 -0400 | [diff] [blame] | 337 | * since we only currently implement idempotent callbacks anyway. |
| 338 | * |
| 339 | * We have a single slot backchannel at this time, so we don't bother |
| 340 | * checking the used_slots bit array on the table. The lower layer guarantees |
| 341 | * a single outstanding callback request at a time. |
| 342 | */ |
Andy Adamson | 9733f0d | 2010-01-22 12:03:08 -0500 | [diff] [blame] | 343 | static __be32 |
Andy Adamson | b2f28bd | 2010-01-14 17:45:07 -0500 | [diff] [blame] | 344 | validate_seqid(struct nfs4_slot_table *tbl, struct cb_sequenceargs * args) |
Ricardo Labiaga | 68f3f90 | 2009-04-01 09:23:35 -0400 | [diff] [blame] | 345 | { |
| 346 | struct nfs4_slot *slot; |
| 347 | |
| 348 | dprintk("%s enter. slotid %d seqid %d\n", |
Andy Adamson | b2f28bd | 2010-01-14 17:45:07 -0500 | [diff] [blame] | 349 | __func__, args->csa_slotid, args->csa_sequenceid); |
Ricardo Labiaga | 68f3f90 | 2009-04-01 09:23:35 -0400 | [diff] [blame] | 350 | |
Andy Adamson | 61f2e51 | 2011-11-09 13:58:20 -0500 | [diff] [blame] | 351 | if (args->csa_slotid >= NFS41_BC_MAX_CALLBACKS) |
Ricardo Labiaga | 68f3f90 | 2009-04-01 09:23:35 -0400 | [diff] [blame] | 352 | return htonl(NFS4ERR_BADSLOT); |
| 353 | |
Andy Adamson | b2f28bd | 2010-01-14 17:45:07 -0500 | [diff] [blame] | 354 | slot = tbl->slots + args->csa_slotid; |
Ricardo Labiaga | 68f3f90 | 2009-04-01 09:23:35 -0400 | [diff] [blame] | 355 | dprintk("%s slot table seqid: %d\n", __func__, slot->seq_nr); |
| 356 | |
| 357 | /* Normal */ |
Andy Adamson | b2f28bd | 2010-01-14 17:45:07 -0500 | [diff] [blame] | 358 | if (likely(args->csa_sequenceid == slot->seq_nr + 1)) { |
Ricardo Labiaga | 68f3f90 | 2009-04-01 09:23:35 -0400 | [diff] [blame] | 359 | slot->seq_nr++; |
Trond Myklebust | 55a6739 | 2011-08-02 14:46:29 -0400 | [diff] [blame] | 360 | goto out_ok; |
Ricardo Labiaga | 68f3f90 | 2009-04-01 09:23:35 -0400 | [diff] [blame] | 361 | } |
| 362 | |
| 363 | /* Replay */ |
Andy Adamson | b2f28bd | 2010-01-14 17:45:07 -0500 | [diff] [blame] | 364 | if (args->csa_sequenceid == slot->seq_nr) { |
Andy Adamson | 4911096 | 2010-01-14 17:45:08 -0500 | [diff] [blame] | 365 | dprintk("%s seqid %d is a replay\n", |
Andy Adamson | b2f28bd | 2010-01-14 17:45:07 -0500 | [diff] [blame] | 366 | __func__, args->csa_sequenceid); |
Andy Adamson | 4911096 | 2010-01-14 17:45:08 -0500 | [diff] [blame] | 367 | /* Signal process_op to set this error on next op */ |
| 368 | if (args->csa_cachethis == 0) |
| 369 | return htonl(NFS4ERR_RETRY_UNCACHED_REP); |
| 370 | |
| 371 | /* The ca_maxresponsesize_cached is 0 with no DRC */ |
| 372 | else if (args->csa_cachethis == 1) |
| 373 | return htonl(NFS4ERR_REP_TOO_BIG_TO_CACHE); |
Ricardo Labiaga | 68f3f90 | 2009-04-01 09:23:35 -0400 | [diff] [blame] | 374 | } |
| 375 | |
| 376 | /* Wraparound */ |
Andy Adamson | b2f28bd | 2010-01-14 17:45:07 -0500 | [diff] [blame] | 377 | if (args->csa_sequenceid == 1 && (slot->seq_nr + 1) == 0) { |
Ricardo Labiaga | 68f3f90 | 2009-04-01 09:23:35 -0400 | [diff] [blame] | 378 | slot->seq_nr = 1; |
Trond Myklebust | 55a6739 | 2011-08-02 14:46:29 -0400 | [diff] [blame] | 379 | goto out_ok; |
Ricardo Labiaga | 68f3f90 | 2009-04-01 09:23:35 -0400 | [diff] [blame] | 380 | } |
| 381 | |
| 382 | /* Misordered request */ |
| 383 | return htonl(NFS4ERR_SEQ_MISORDERED); |
Trond Myklebust | 55a6739 | 2011-08-02 14:46:29 -0400 | [diff] [blame] | 384 | out_ok: |
| 385 | tbl->highest_used_slotid = args->csa_slotid; |
| 386 | return htonl(NFS4_OK); |
Ricardo Labiaga | 68f3f90 | 2009-04-01 09:23:35 -0400 | [diff] [blame] | 387 | } |
| 388 | |
| 389 | /* |
Mike Sager | a7989c3 | 2010-01-19 12:54:40 -0500 | [diff] [blame] | 390 | * For each referring call triple, check the session's slot table for |
| 391 | * a match. If the slot is in use and the sequence numbers match, the |
| 392 | * client is still waiting for a response to the original request. |
| 393 | */ |
| 394 | static bool referring_call_exists(struct nfs_client *clp, |
| 395 | uint32_t nrclists, |
| 396 | struct referring_call_list *rclists) |
| 397 | { |
| 398 | bool status = 0; |
| 399 | int i, j; |
| 400 | struct nfs4_session *session; |
| 401 | struct nfs4_slot_table *tbl; |
| 402 | struct referring_call_list *rclist; |
| 403 | struct referring_call *ref; |
| 404 | |
| 405 | /* |
| 406 | * XXX When client trunking is implemented, this becomes |
| 407 | * a session lookup from within the loop |
| 408 | */ |
| 409 | session = clp->cl_session; |
| 410 | tbl = &session->fc_slot_table; |
| 411 | |
| 412 | for (i = 0; i < nrclists; i++) { |
| 413 | rclist = &rclists[i]; |
| 414 | if (memcmp(session->sess_id.data, |
| 415 | rclist->rcl_sessionid.data, |
| 416 | NFS4_MAX_SESSIONID_LEN) != 0) |
| 417 | continue; |
| 418 | |
| 419 | for (j = 0; j < rclist->rcl_nrefcalls; j++) { |
| 420 | ref = &rclist->rcl_refcalls[j]; |
| 421 | |
| 422 | dprintk("%s: sessionid %x:%x:%x:%x sequenceid %u " |
| 423 | "slotid %u\n", __func__, |
| 424 | ((u32 *)&rclist->rcl_sessionid.data)[0], |
| 425 | ((u32 *)&rclist->rcl_sessionid.data)[1], |
| 426 | ((u32 *)&rclist->rcl_sessionid.data)[2], |
| 427 | ((u32 *)&rclist->rcl_sessionid.data)[3], |
| 428 | ref->rc_sequenceid, ref->rc_slotid); |
| 429 | |
| 430 | spin_lock(&tbl->slot_tbl_lock); |
| 431 | status = (test_bit(ref->rc_slotid, tbl->used_slots) && |
| 432 | tbl->slots[ref->rc_slotid].seq_nr == |
| 433 | ref->rc_sequenceid); |
| 434 | spin_unlock(&tbl->slot_tbl_lock); |
| 435 | if (status) |
| 436 | goto out; |
| 437 | } |
| 438 | } |
| 439 | |
| 440 | out: |
| 441 | return status; |
| 442 | } |
| 443 | |
Andy Adamson | 9733f0d | 2010-01-22 12:03:08 -0500 | [diff] [blame] | 444 | __be32 nfs4_callback_sequence(struct cb_sequenceargs *args, |
Andy Adamson | c36fca5 | 2011-01-06 02:04:32 +0000 | [diff] [blame] | 445 | struct cb_sequenceres *res, |
| 446 | struct cb_process_state *cps) |
Benny Halevy | d49433e | 2009-04-01 09:23:25 -0400 | [diff] [blame] | 447 | { |
Trond Myklebust | 55a6739 | 2011-08-02 14:46:29 -0400 | [diff] [blame] | 448 | struct nfs4_slot_table *tbl; |
Ricardo Labiaga | 68f3f90 | 2009-04-01 09:23:35 -0400 | [diff] [blame] | 449 | struct nfs_client *clp; |
Andy Adamson | 9733f0d | 2010-01-22 12:03:08 -0500 | [diff] [blame] | 450 | int i; |
Andy Adamson | 778be23 | 2011-01-25 15:38:01 +0000 | [diff] [blame] | 451 | __be32 status = htonl(NFS4ERR_BADSESSION); |
Benny Halevy | d49433e | 2009-04-01 09:23:25 -0400 | [diff] [blame] | 452 | |
Stanislav Kinsbursky | c7add9a | 2012-01-26 15:11:49 +0400 | [diff] [blame] | 453 | clp = nfs4_find_client_sessionid(cps->net, args->csa_addr, &args->csa_sessionid); |
Ricardo Labiaga | 68f3f90 | 2009-04-01 09:23:35 -0400 | [diff] [blame] | 454 | if (clp == NULL) |
| 455 | goto out; |
| 456 | |
Trond Myklebust | 55a6739 | 2011-08-02 14:46:29 -0400 | [diff] [blame] | 457 | tbl = &clp->cl_session->bc_slot_table; |
| 458 | |
| 459 | spin_lock(&tbl->slot_tbl_lock); |
Andy Adamson | 42acd02 | 2011-01-06 02:04:34 +0000 | [diff] [blame] | 460 | /* state manager is resetting the session */ |
| 461 | if (test_bit(NFS4_SESSION_DRAINING, &clp->cl_session->session_state)) { |
Trond Myklebust | 55a6739 | 2011-08-02 14:46:29 -0400 | [diff] [blame] | 462 | spin_unlock(&tbl->slot_tbl_lock); |
| 463 | status = htonl(NFS4ERR_DELAY); |
Trond Myklebust | 910ac68 | 2011-08-02 14:46:52 -0400 | [diff] [blame] | 464 | /* Return NFS4ERR_BADSESSION if we're draining the session |
| 465 | * in order to reset it. |
| 466 | */ |
| 467 | if (test_bit(NFS4CLNT_SESSION_RESET, &clp->cl_state)) |
| 468 | status = htonl(NFS4ERR_BADSESSION); |
Andy Adamson | 42acd02 | 2011-01-06 02:04:34 +0000 | [diff] [blame] | 469 | goto out; |
| 470 | } |
| 471 | |
Andy Adamson | b2f28bd | 2010-01-14 17:45:07 -0500 | [diff] [blame] | 472 | status = validate_seqid(&clp->cl_session->bc_slot_table, args); |
Trond Myklebust | 55a6739 | 2011-08-02 14:46:29 -0400 | [diff] [blame] | 473 | spin_unlock(&tbl->slot_tbl_lock); |
Ricardo Labiaga | 68f3f90 | 2009-04-01 09:23:35 -0400 | [diff] [blame] | 474 | if (status) |
Andy Adamson | c36fca5 | 2011-01-06 02:04:32 +0000 | [diff] [blame] | 475 | goto out; |
Ricardo Labiaga | 68f3f90 | 2009-04-01 09:23:35 -0400 | [diff] [blame] | 476 | |
Trond Myklebust | 55a6739 | 2011-08-02 14:46:29 -0400 | [diff] [blame] | 477 | cps->slotid = args->csa_slotid; |
| 478 | |
Mike Sager | 72ce2b3 | 2010-01-19 12:54:41 -0500 | [diff] [blame] | 479 | /* |
| 480 | * Check for pending referring calls. If a match is found, a |
| 481 | * related callback was received before the response to the original |
| 482 | * call. |
| 483 | */ |
| 484 | if (referring_call_exists(clp, args->csa_nrclists, args->csa_rclists)) { |
| 485 | status = htonl(NFS4ERR_DELAY); |
Andy Adamson | c36fca5 | 2011-01-06 02:04:32 +0000 | [diff] [blame] | 486 | goto out; |
Mike Sager | 72ce2b3 | 2010-01-19 12:54:41 -0500 | [diff] [blame] | 487 | } |
| 488 | |
Benny Halevy | d49433e | 2009-04-01 09:23:25 -0400 | [diff] [blame] | 489 | memcpy(&res->csr_sessionid, &args->csa_sessionid, |
| 490 | sizeof(res->csr_sessionid)); |
| 491 | res->csr_sequenceid = args->csa_sequenceid; |
| 492 | res->csr_slotid = args->csa_slotid; |
| 493 | res->csr_highestslotid = NFS41_BC_MAX_CALLBACKS - 1; |
| 494 | res->csr_target_highestslotid = NFS41_BC_MAX_CALLBACKS - 1; |
| 495 | |
Ricardo Labiaga | 68f3f90 | 2009-04-01 09:23:35 -0400 | [diff] [blame] | 496 | out: |
Andy Adamson | 2c4cdf8 | 2011-01-25 15:38:02 +0000 | [diff] [blame] | 497 | cps->clp = clp; /* put in nfs4_callback_compound */ |
Mike Sager | 72ce2b3 | 2010-01-19 12:54:41 -0500 | [diff] [blame] | 498 | for (i = 0; i < args->csa_nrclists; i++) |
| 499 | kfree(args->csa_rclists[i].rcl_refcalls); |
| 500 | kfree(args->csa_rclists); |
| 501 | |
Andy Adamson | c36fca5 | 2011-01-06 02:04:32 +0000 | [diff] [blame] | 502 | if (status == htonl(NFS4ERR_RETRY_UNCACHED_REP)) { |
| 503 | cps->drc_status = status; |
| 504 | status = 0; |
| 505 | } else |
Andy Adamson | 4911096 | 2010-01-14 17:45:08 -0500 | [diff] [blame] | 506 | res->csr_status = status; |
Andy Adamson | c36fca5 | 2011-01-06 02:04:32 +0000 | [diff] [blame] | 507 | |
Andy Adamson | 4911096 | 2010-01-14 17:45:08 -0500 | [diff] [blame] | 508 | dprintk("%s: exit with status = %d res->csr_status %d\n", __func__, |
| 509 | ntohl(status), ntohl(res->csr_status)); |
| 510 | return status; |
Benny Halevy | d49433e | 2009-04-01 09:23:25 -0400 | [diff] [blame] | 511 | } |
| 512 | |
Alexandros Batsakis | 3684037 | 2011-01-06 11:36:31 +0000 | [diff] [blame] | 513 | static bool |
| 514 | validate_bitmap_values(unsigned long mask) |
| 515 | { |
| 516 | return (mask & ~RCA4_TYPE_MASK_ALL) == 0; |
| 517 | } |
| 518 | |
Andy Adamson | c36fca5 | 2011-01-06 02:04:32 +0000 | [diff] [blame] | 519 | __be32 nfs4_callback_recallany(struct cb_recallanyargs *args, void *dummy, |
| 520 | struct cb_process_state *cps) |
Alexandros Batsakis | 31f0960 | 2009-12-05 13:27:02 -0500 | [diff] [blame] | 521 | { |
Andy Adamson | 9733f0d | 2010-01-22 12:03:08 -0500 | [diff] [blame] | 522 | __be32 status; |
Alexandros Batsakis | 31f0960 | 2009-12-05 13:27:02 -0500 | [diff] [blame] | 523 | fmode_t flags = 0; |
| 524 | |
Alexandros Batsakis | 3684037 | 2011-01-06 11:36:31 +0000 | [diff] [blame] | 525 | status = cpu_to_be32(NFS4ERR_OP_NOT_IN_SESSION); |
Andy Adamson | c36fca5 | 2011-01-06 02:04:32 +0000 | [diff] [blame] | 526 | if (!cps->clp) /* set in cb_sequence */ |
Alexandros Batsakis | 31f0960 | 2009-12-05 13:27:02 -0500 | [diff] [blame] | 527 | goto out; |
| 528 | |
Trond Myklebust | 2446ab6 | 2012-03-01 17:00:56 -0500 | [diff] [blame] | 529 | dprintk_rcu("NFS: RECALL_ANY callback request from %s\n", |
Andy Adamson | c36fca5 | 2011-01-06 02:04:32 +0000 | [diff] [blame] | 530 | rpc_peeraddr2str(cps->clp->cl_rpcclient, RPC_DISPLAY_ADDR)); |
Alexandros Batsakis | 31f0960 | 2009-12-05 13:27:02 -0500 | [diff] [blame] | 531 | |
Alexandros Batsakis | 3684037 | 2011-01-06 11:36:31 +0000 | [diff] [blame] | 532 | status = cpu_to_be32(NFS4ERR_INVAL); |
| 533 | if (!validate_bitmap_values(args->craa_type_mask)) |
| 534 | goto out; |
| 535 | |
| 536 | status = cpu_to_be32(NFS4_OK); |
Alexandros Batsakis | 31f0960 | 2009-12-05 13:27:02 -0500 | [diff] [blame] | 537 | if (test_bit(RCA4_TYPE_MASK_RDATA_DLG, (const unsigned long *) |
| 538 | &args->craa_type_mask)) |
| 539 | flags = FMODE_READ; |
| 540 | if (test_bit(RCA4_TYPE_MASK_WDATA_DLG, (const unsigned long *) |
| 541 | &args->craa_type_mask)) |
| 542 | flags |= FMODE_WRITE; |
Alexandros Batsakis | 3684037 | 2011-01-06 11:36:31 +0000 | [diff] [blame] | 543 | if (test_bit(RCA4_TYPE_MASK_FILE_LAYOUT, (const unsigned long *) |
| 544 | &args->craa_type_mask)) |
| 545 | pnfs_recall_all_layouts(cps->clp); |
Alexandros Batsakis | 31f0960 | 2009-12-05 13:27:02 -0500 | [diff] [blame] | 546 | if (flags) |
Andy Adamson | c36fca5 | 2011-01-06 02:04:32 +0000 | [diff] [blame] | 547 | nfs_expire_all_delegation_types(cps->clp, flags); |
Alexandros Batsakis | 31f0960 | 2009-12-05 13:27:02 -0500 | [diff] [blame] | 548 | out: |
| 549 | dprintk("%s: exit with status = %d\n", __func__, ntohl(status)); |
| 550 | return status; |
| 551 | } |
Andy Adamson | b9efa1b | 2010-01-20 16:06:27 -0500 | [diff] [blame] | 552 | |
| 553 | /* Reduce the fore channel's max_slots to the target value */ |
Andy Adamson | c36fca5 | 2011-01-06 02:04:32 +0000 | [diff] [blame] | 554 | __be32 nfs4_callback_recallslot(struct cb_recallslotargs *args, void *dummy, |
| 555 | struct cb_process_state *cps) |
Andy Adamson | b9efa1b | 2010-01-20 16:06:27 -0500 | [diff] [blame] | 556 | { |
Andy Adamson | b9efa1b | 2010-01-20 16:06:27 -0500 | [diff] [blame] | 557 | struct nfs4_slot_table *fc_tbl; |
Andy Adamson | 9733f0d | 2010-01-22 12:03:08 -0500 | [diff] [blame] | 558 | __be32 status; |
Andy Adamson | b9efa1b | 2010-01-20 16:06:27 -0500 | [diff] [blame] | 559 | |
| 560 | status = htonl(NFS4ERR_OP_NOT_IN_SESSION); |
Andy Adamson | c36fca5 | 2011-01-06 02:04:32 +0000 | [diff] [blame] | 561 | if (!cps->clp) /* set in cb_sequence */ |
Andy Adamson | b9efa1b | 2010-01-20 16:06:27 -0500 | [diff] [blame] | 562 | goto out; |
| 563 | |
Trond Myklebust | d5fb4ce | 2012-11-20 20:24:02 -0500 | [diff] [blame^] | 564 | dprintk_rcu("NFS: CB_RECALL_SLOT request from %s target highest slotid %d\n", |
Andy Adamson | c36fca5 | 2011-01-06 02:04:32 +0000 | [diff] [blame] | 565 | rpc_peeraddr2str(cps->clp->cl_rpcclient, RPC_DISPLAY_ADDR), |
Trond Myklebust | d5fb4ce | 2012-11-20 20:24:02 -0500 | [diff] [blame^] | 566 | args->crsa_target_highest_slotid); |
Andy Adamson | b9efa1b | 2010-01-20 16:06:27 -0500 | [diff] [blame] | 567 | |
Andy Adamson | c36fca5 | 2011-01-06 02:04:32 +0000 | [diff] [blame] | 568 | fc_tbl = &cps->clp->cl_session->fc_slot_table; |
Andy Adamson | b9efa1b | 2010-01-20 16:06:27 -0500 | [diff] [blame] | 569 | |
| 570 | status = htonl(NFS4ERR_BAD_HIGH_SLOT); |
Trond Myklebust | d5fb4ce | 2012-11-20 20:24:02 -0500 | [diff] [blame^] | 571 | if (args->crsa_target_highest_slotid >= fc_tbl->max_slots || |
| 572 | args->crsa_target_highest_slotid < 1) |
Andy Adamson | c36fca5 | 2011-01-06 02:04:32 +0000 | [diff] [blame] | 573 | goto out; |
Andy Adamson | bae0ac0 | 2010-01-21 14:19:16 -0500 | [diff] [blame] | 574 | |
| 575 | status = htonl(NFS4_OK); |
Andy Adamson | b9efa1b | 2010-01-20 16:06:27 -0500 | [diff] [blame] | 576 | |
Trond Myklebust | d5fb4ce | 2012-11-20 20:24:02 -0500 | [diff] [blame^] | 577 | nfs41_set_target_slotid(fc_tbl, args->crsa_target_highest_slotid); |
Andy Adamson | c36fca5 | 2011-01-06 02:04:32 +0000 | [diff] [blame] | 578 | nfs41_handle_recall_slot(cps->clp); |
Andy Adamson | b9efa1b | 2010-01-20 16:06:27 -0500 | [diff] [blame] | 579 | out: |
| 580 | dprintk("%s: exit with status = %d\n", __func__, ntohl(status)); |
| 581 | return status; |
| 582 | } |
Benny Halevy | d49433e | 2009-04-01 09:23:25 -0400 | [diff] [blame] | 583 | #endif /* CONFIG_NFS_V4_1 */ |