Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
| 2 | * linux/fs/nfs/unlink.c |
| 3 | * |
| 4 | * nfs sillydelete handling |
| 5 | * |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #include <linux/slab.h> |
| 9 | #include <linux/string.h> |
| 10 | #include <linux/dcache.h> |
| 11 | #include <linux/sunrpc/sched.h> |
| 12 | #include <linux/sunrpc/clnt.h> |
| 13 | #include <linux/nfs_fs.h> |
Linus Torvalds | b35e704 | 2007-10-19 19:59:18 -0700 | [diff] [blame] | 14 | #include <linux/sched.h> |
| 15 | #include <linux/wait.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 16 | |
Steve Dickson | ef818a2 | 2007-11-08 04:05:04 -0500 | [diff] [blame] | 17 | #include "internal.h" |
Andy Adamson | 472cfbd | 2009-04-01 09:22:24 -0400 | [diff] [blame] | 18 | #include "nfs4_fs.h" |
Steve Dickson | ef818a2 | 2007-11-08 04:05:04 -0500 | [diff] [blame] | 19 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 20 | struct nfs_unlinkdata { |
Trond Myklebust | 565277f | 2007-10-15 18:17:53 -0400 | [diff] [blame] | 21 | struct hlist_node list; |
Trond Myklebust | e4eff1a | 2007-07-14 15:39:58 -0400 | [diff] [blame] | 22 | struct nfs_removeargs args; |
| 23 | struct nfs_removeres res; |
| 24 | struct inode *dir; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | struct rpc_cred *cred; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 26 | }; |
| 27 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | /** |
Trond Myklebust | e4eff1a | 2007-07-14 15:39:58 -0400 | [diff] [blame] | 29 | * nfs_free_unlinkdata - release data from a sillydelete operation. |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 30 | * @data: pointer to unlink structure. |
| 31 | */ |
| 32 | static void |
Trond Myklebust | e4eff1a | 2007-07-14 15:39:58 -0400 | [diff] [blame] | 33 | nfs_free_unlinkdata(struct nfs_unlinkdata *data) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 34 | { |
Trond Myklebust | e4eff1a | 2007-07-14 15:39:58 -0400 | [diff] [blame] | 35 | iput(data->dir); |
| 36 | put_rpccred(data->cred); |
| 37 | kfree(data->args.name.name); |
| 38 | kfree(data); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 | } |
| 40 | |
| 41 | #define NAME_ALLOC_LEN(len) ((len+16) & ~15) |
| 42 | /** |
| 43 | * nfs_copy_dname - copy dentry name to data structure |
| 44 | * @dentry: pointer to dentry |
| 45 | * @data: nfs_unlinkdata |
| 46 | */ |
Trond Myklebust | e4eff1a | 2007-07-14 15:39:58 -0400 | [diff] [blame] | 47 | static int nfs_copy_dname(struct dentry *dentry, struct nfs_unlinkdata *data) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 48 | { |
| 49 | char *str; |
| 50 | int len = dentry->d_name.len; |
| 51 | |
Trond Myklebust | e4eff1a | 2007-07-14 15:39:58 -0400 | [diff] [blame] | 52 | str = kmemdup(dentry->d_name.name, NAME_ALLOC_LEN(len), GFP_KERNEL); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 53 | if (!str) |
Trond Myklebust | e4eff1a | 2007-07-14 15:39:58 -0400 | [diff] [blame] | 54 | return -ENOMEM; |
| 55 | data->args.name.len = len; |
| 56 | data->args.name.name = str; |
| 57 | return 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 58 | } |
| 59 | |
Trond Myklebust | 565277f | 2007-10-15 18:17:53 -0400 | [diff] [blame] | 60 | static void nfs_free_dname(struct nfs_unlinkdata *data) |
| 61 | { |
| 62 | kfree(data->args.name.name); |
| 63 | data->args.name.name = NULL; |
| 64 | data->args.name.len = 0; |
| 65 | } |
| 66 | |
| 67 | static void nfs_dec_sillycount(struct inode *dir) |
| 68 | { |
| 69 | struct nfs_inode *nfsi = NFS_I(dir); |
| 70 | if (atomic_dec_return(&nfsi->silly_count) == 1) |
| 71 | wake_up(&nfsi->waitqueue); |
| 72 | } |
| 73 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 74 | /** |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 75 | * nfs_async_unlink_done - Sillydelete post-processing |
| 76 | * @task: rpc_task of the sillydelete |
| 77 | * |
| 78 | * Do the directory attribute update. |
| 79 | */ |
Trond Myklebust | 963d8fe | 2006-01-03 09:55:04 +0100 | [diff] [blame] | 80 | static void nfs_async_unlink_done(struct rpc_task *task, void *calldata) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 81 | { |
Trond Myklebust | e4eff1a | 2007-07-14 15:39:58 -0400 | [diff] [blame] | 82 | struct nfs_unlinkdata *data = calldata; |
| 83 | struct inode *dir = data->dir; |
Andy Adamson | e608e79 | 2009-12-04 15:55:29 -0500 | [diff] [blame^] | 84 | struct nfs_removeres *res = task->tk_msg.rpc_resp; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 85 | |
Trond Myklebust | e4eff1a | 2007-07-14 15:39:58 -0400 | [diff] [blame] | 86 | if (!NFS_PROTO(dir)->unlink_done(task, dir)) |
Andy Adamson | e608e79 | 2009-12-04 15:55:29 -0500 | [diff] [blame^] | 87 | nfs4_restart_rpc(task, NFS_SERVER(dir)->nfs_client, |
| 88 | &res->seq_res); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 89 | } |
| 90 | |
| 91 | /** |
| 92 | * nfs_async_unlink_release - Release the sillydelete data. |
| 93 | * @task: rpc_task of the sillydelete |
| 94 | * |
| 95 | * We need to call nfs_put_unlinkdata as a 'tk_release' task since the |
| 96 | * rpc_task would be freed too. |
| 97 | */ |
Trond Myklebust | 963d8fe | 2006-01-03 09:55:04 +0100 | [diff] [blame] | 98 | static void nfs_async_unlink_release(void *calldata) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 99 | { |
Trond Myklebust | 963d8fe | 2006-01-03 09:55:04 +0100 | [diff] [blame] | 100 | struct nfs_unlinkdata *data = calldata; |
Trond Myklebust | 744d18d | 2008-07-27 18:03:19 -0400 | [diff] [blame] | 101 | struct super_block *sb = data->dir->i_sb; |
Trond Myklebust | 565277f | 2007-10-15 18:17:53 -0400 | [diff] [blame] | 102 | |
| 103 | nfs_dec_sillycount(data->dir); |
Trond Myklebust | e4eff1a | 2007-07-14 15:39:58 -0400 | [diff] [blame] | 104 | nfs_free_unlinkdata(data); |
Trond Myklebust | 1daef0a | 2008-07-27 18:19:01 -0400 | [diff] [blame] | 105 | nfs_sb_deactive(sb); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 106 | } |
| 107 | |
Andy Adamson | 472cfbd | 2009-04-01 09:22:24 -0400 | [diff] [blame] | 108 | #if defined(CONFIG_NFS_V4_1) |
| 109 | void nfs_unlink_prepare(struct rpc_task *task, void *calldata) |
| 110 | { |
| 111 | struct nfs_unlinkdata *data = calldata; |
| 112 | struct nfs_server *server = NFS_SERVER(data->dir); |
| 113 | |
| 114 | if (nfs4_setup_sequence(server->nfs_client, &data->args.seq_args, |
| 115 | &data->res.seq_res, 1, task)) |
| 116 | return; |
| 117 | rpc_call_start(task); |
| 118 | } |
| 119 | #endif /* CONFIG_NFS_V4_1 */ |
| 120 | |
Trond Myklebust | 963d8fe | 2006-01-03 09:55:04 +0100 | [diff] [blame] | 121 | static const struct rpc_call_ops nfs_unlink_ops = { |
| 122 | .rpc_call_done = nfs_async_unlink_done, |
| 123 | .rpc_release = nfs_async_unlink_release, |
Andy Adamson | 472cfbd | 2009-04-01 09:22:24 -0400 | [diff] [blame] | 124 | #if defined(CONFIG_NFS_V4_1) |
| 125 | .rpc_call_prepare = nfs_unlink_prepare, |
| 126 | #endif /* CONFIG_NFS_V4_1 */ |
Trond Myklebust | 963d8fe | 2006-01-03 09:55:04 +0100 | [diff] [blame] | 127 | }; |
| 128 | |
Trond Myklebust | 565277f | 2007-10-15 18:17:53 -0400 | [diff] [blame] | 129 | static int nfs_do_call_unlink(struct dentry *parent, struct inode *dir, struct nfs_unlinkdata *data) |
Trond Myklebust | e4eff1a | 2007-07-14 15:39:58 -0400 | [diff] [blame] | 130 | { |
Trond Myklebust | 5138fde | 2007-07-14 15:40:01 -0400 | [diff] [blame] | 131 | struct rpc_message msg = { |
| 132 | .rpc_argp = &data->args, |
| 133 | .rpc_resp = &data->res, |
| 134 | .rpc_cred = data->cred, |
| 135 | }; |
Trond Myklebust | c970aa8 | 2007-07-14 15:39:59 -0400 | [diff] [blame] | 136 | struct rpc_task_setup task_setup_data = { |
Trond Myklebust | 5138fde | 2007-07-14 15:40:01 -0400 | [diff] [blame] | 137 | .rpc_message = &msg, |
Trond Myklebust | c970aa8 | 2007-07-14 15:39:59 -0400 | [diff] [blame] | 138 | .callback_ops = &nfs_unlink_ops, |
| 139 | .callback_data = data, |
Trond Myklebust | 1daef0a | 2008-07-27 18:19:01 -0400 | [diff] [blame] | 140 | .workqueue = nfsiod_workqueue, |
Trond Myklebust | c970aa8 | 2007-07-14 15:39:59 -0400 | [diff] [blame] | 141 | .flags = RPC_TASK_ASYNC, |
| 142 | }; |
Trond Myklebust | e4eff1a | 2007-07-14 15:39:58 -0400 | [diff] [blame] | 143 | struct rpc_task *task; |
Trond Myklebust | 565277f | 2007-10-15 18:17:53 -0400 | [diff] [blame] | 144 | struct dentry *alias; |
Trond Myklebust | e4eff1a | 2007-07-14 15:39:58 -0400 | [diff] [blame] | 145 | |
Trond Myklebust | 565277f | 2007-10-15 18:17:53 -0400 | [diff] [blame] | 146 | alias = d_lookup(parent, &data->args.name); |
| 147 | if (alias != NULL) { |
| 148 | int ret = 0; |
Trond Myklebust | 609005c | 2008-01-28 19:42:59 -0500 | [diff] [blame] | 149 | |
Trond Myklebust | 565277f | 2007-10-15 18:17:53 -0400 | [diff] [blame] | 150 | /* |
| 151 | * Hey, we raced with lookup... See if we need to transfer |
| 152 | * the sillyrename information to the aliased dentry. |
| 153 | */ |
| 154 | nfs_free_dname(data); |
| 155 | spin_lock(&alias->d_lock); |
Trond Myklebust | 609005c | 2008-01-28 19:42:59 -0500 | [diff] [blame] | 156 | if (alias->d_inode != NULL && |
| 157 | !(alias->d_flags & DCACHE_NFSFS_RENAMED)) { |
Trond Myklebust | 565277f | 2007-10-15 18:17:53 -0400 | [diff] [blame] | 158 | alias->d_fsdata = data; |
Trond Myklebust | fccca7f | 2008-01-26 17:37:47 -0500 | [diff] [blame] | 159 | alias->d_flags |= DCACHE_NFSFS_RENAMED; |
Trond Myklebust | 565277f | 2007-10-15 18:17:53 -0400 | [diff] [blame] | 160 | ret = 1; |
| 161 | } |
| 162 | spin_unlock(&alias->d_lock); |
| 163 | nfs_dec_sillycount(dir); |
| 164 | dput(alias); |
| 165 | return ret; |
| 166 | } |
| 167 | data->dir = igrab(dir); |
| 168 | if (!data->dir) { |
| 169 | nfs_dec_sillycount(dir); |
| 170 | return 0; |
| 171 | } |
Trond Myklebust | 1daef0a | 2008-07-27 18:19:01 -0400 | [diff] [blame] | 172 | nfs_sb_active(dir->i_sb); |
Trond Myklebust | e4eff1a | 2007-07-14 15:39:58 -0400 | [diff] [blame] | 173 | data->args.fh = NFS_FH(dir); |
| 174 | nfs_fattr_init(&data->res.dir_attr); |
| 175 | |
Trond Myklebust | 5138fde | 2007-07-14 15:40:01 -0400 | [diff] [blame] | 176 | NFS_PROTO(dir)->unlink_setup(&msg, dir); |
Trond Myklebust | c970aa8 | 2007-07-14 15:39:59 -0400 | [diff] [blame] | 177 | |
Trond Myklebust | 5138fde | 2007-07-14 15:40:01 -0400 | [diff] [blame] | 178 | task_setup_data.rpc_client = NFS_CLIENT(dir); |
Trond Myklebust | c970aa8 | 2007-07-14 15:39:59 -0400 | [diff] [blame] | 179 | task = rpc_run_task(&task_setup_data); |
Trond Myklebust | e4eff1a | 2007-07-14 15:39:58 -0400 | [diff] [blame] | 180 | if (!IS_ERR(task)) |
| 181 | rpc_put_task(task); |
| 182 | return 1; |
Trond Myklebust | 565277f | 2007-10-15 18:17:53 -0400 | [diff] [blame] | 183 | } |
| 184 | |
| 185 | static int nfs_call_unlink(struct dentry *dentry, struct nfs_unlinkdata *data) |
| 186 | { |
| 187 | struct dentry *parent; |
| 188 | struct inode *dir; |
| 189 | int ret = 0; |
| 190 | |
| 191 | |
| 192 | parent = dget_parent(dentry); |
| 193 | if (parent == NULL) |
| 194 | goto out_free; |
| 195 | dir = parent->d_inode; |
Trond Myklebust | 55b70a0 | 2007-10-21 12:02:22 -0400 | [diff] [blame] | 196 | if (nfs_copy_dname(dentry, data) != 0) |
Trond Myklebust | 565277f | 2007-10-15 18:17:53 -0400 | [diff] [blame] | 197 | goto out_dput; |
| 198 | /* Non-exclusive lock protects against concurrent lookup() calls */ |
| 199 | spin_lock(&dir->i_lock); |
| 200 | if (atomic_inc_not_zero(&NFS_I(dir)->silly_count) == 0) { |
| 201 | /* Deferred delete */ |
| 202 | hlist_add_head(&data->list, &NFS_I(dir)->silly_list); |
| 203 | spin_unlock(&dir->i_lock); |
| 204 | ret = 1; |
| 205 | goto out_dput; |
| 206 | } |
| 207 | spin_unlock(&dir->i_lock); |
| 208 | ret = nfs_do_call_unlink(parent, dir, data); |
| 209 | out_dput: |
| 210 | dput(parent); |
Trond Myklebust | e4eff1a | 2007-07-14 15:39:58 -0400 | [diff] [blame] | 211 | out_free: |
Trond Myklebust | 565277f | 2007-10-15 18:17:53 -0400 | [diff] [blame] | 212 | return ret; |
| 213 | } |
| 214 | |
| 215 | void nfs_block_sillyrename(struct dentry *dentry) |
| 216 | { |
| 217 | struct nfs_inode *nfsi = NFS_I(dentry->d_inode); |
| 218 | |
| 219 | wait_event(nfsi->waitqueue, atomic_cmpxchg(&nfsi->silly_count, 1, 0) == 1); |
| 220 | } |
| 221 | |
| 222 | void nfs_unblock_sillyrename(struct dentry *dentry) |
| 223 | { |
| 224 | struct inode *dir = dentry->d_inode; |
| 225 | struct nfs_inode *nfsi = NFS_I(dir); |
| 226 | struct nfs_unlinkdata *data; |
| 227 | |
| 228 | atomic_inc(&nfsi->silly_count); |
| 229 | spin_lock(&dir->i_lock); |
| 230 | while (!hlist_empty(&nfsi->silly_list)) { |
| 231 | if (!atomic_inc_not_zero(&nfsi->silly_count)) |
| 232 | break; |
| 233 | data = hlist_entry(nfsi->silly_list.first, struct nfs_unlinkdata, list); |
| 234 | hlist_del(&data->list); |
| 235 | spin_unlock(&dir->i_lock); |
| 236 | if (nfs_do_call_unlink(dentry, dir, data) == 0) |
| 237 | nfs_free_unlinkdata(data); |
| 238 | spin_lock(&dir->i_lock); |
| 239 | } |
| 240 | spin_unlock(&dir->i_lock); |
Trond Myklebust | e4eff1a | 2007-07-14 15:39:58 -0400 | [diff] [blame] | 241 | } |
| 242 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 243 | /** |
| 244 | * nfs_async_unlink - asynchronous unlinking of a file |
Trond Myklebust | e4eff1a | 2007-07-14 15:39:58 -0400 | [diff] [blame] | 245 | * @dir: parent directory of dentry |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 246 | * @dentry: dentry to unlink |
| 247 | */ |
| 248 | int |
Trond Myklebust | e4eff1a | 2007-07-14 15:39:58 -0400 | [diff] [blame] | 249 | nfs_async_unlink(struct inode *dir, struct dentry *dentry) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 250 | { |
Trond Myklebust | e4eff1a | 2007-07-14 15:39:58 -0400 | [diff] [blame] | 251 | struct nfs_unlinkdata *data; |
| 252 | int status = -ENOMEM; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 253 | |
Eric Sesterhenn | bd64754 | 2006-03-20 13:44:10 -0500 | [diff] [blame] | 254 | data = kzalloc(sizeof(*data), GFP_KERNEL); |
Trond Myklebust | e4eff1a | 2007-07-14 15:39:58 -0400 | [diff] [blame] | 255 | if (data == NULL) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 256 | goto out; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 257 | |
Trond Myklebust | 98a8e32 | 2008-03-12 12:25:28 -0400 | [diff] [blame] | 258 | data->cred = rpc_lookup_cred(); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 259 | if (IS_ERR(data->cred)) { |
| 260 | status = PTR_ERR(data->cred); |
| 261 | goto out_free; |
| 262 | } |
Andy Adamson | 5f7dbd5 | 2009-04-01 09:22:05 -0400 | [diff] [blame] | 263 | data->res.seq_res.sr_slotid = NFS4_MAX_SLOT_TABLE; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 264 | |
Trond Myklebust | e4eff1a | 2007-07-14 15:39:58 -0400 | [diff] [blame] | 265 | status = -EBUSY; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 266 | spin_lock(&dentry->d_lock); |
Trond Myklebust | e4eff1a | 2007-07-14 15:39:58 -0400 | [diff] [blame] | 267 | if (dentry->d_flags & DCACHE_NFSFS_RENAMED) |
| 268 | goto out_unlock; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 269 | dentry->d_flags |= DCACHE_NFSFS_RENAMED; |
Trond Myklebust | e4eff1a | 2007-07-14 15:39:58 -0400 | [diff] [blame] | 270 | dentry->d_fsdata = data; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 271 | spin_unlock(&dentry->d_lock); |
Trond Myklebust | e4eff1a | 2007-07-14 15:39:58 -0400 | [diff] [blame] | 272 | return 0; |
| 273 | out_unlock: |
| 274 | spin_unlock(&dentry->d_lock); |
| 275 | put_rpccred(data->cred); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 276 | out_free: |
| 277 | kfree(data); |
Trond Myklebust | e4eff1a | 2007-07-14 15:39:58 -0400 | [diff] [blame] | 278 | out: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 279 | return status; |
| 280 | } |
| 281 | |
| 282 | /** |
| 283 | * nfs_complete_unlink - Initialize completion of the sillydelete |
| 284 | * @dentry: dentry to delete |
Trond Myklebust | e4eff1a | 2007-07-14 15:39:58 -0400 | [diff] [blame] | 285 | * @inode: inode |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 286 | * |
| 287 | * Since we're most likely to be called by dentry_iput(), we |
| 288 | * only use the dentry to find the sillydelete. We then copy the name |
| 289 | * into the qstr. |
| 290 | */ |
| 291 | void |
Trond Myklebust | e4eff1a | 2007-07-14 15:39:58 -0400 | [diff] [blame] | 292 | nfs_complete_unlink(struct dentry *dentry, struct inode *inode) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 293 | { |
Trond Myklebust | e4eff1a | 2007-07-14 15:39:58 -0400 | [diff] [blame] | 294 | struct nfs_unlinkdata *data = NULL; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 295 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 296 | spin_lock(&dentry->d_lock); |
Trond Myklebust | e4eff1a | 2007-07-14 15:39:58 -0400 | [diff] [blame] | 297 | if (dentry->d_flags & DCACHE_NFSFS_RENAMED) { |
| 298 | dentry->d_flags &= ~DCACHE_NFSFS_RENAMED; |
| 299 | data = dentry->d_fsdata; |
| 300 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 301 | spin_unlock(&dentry->d_lock); |
Trond Myklebust | e4eff1a | 2007-07-14 15:39:58 -0400 | [diff] [blame] | 302 | |
| 303 | if (data != NULL && (NFS_STALE(inode) || !nfs_call_unlink(dentry, data))) |
| 304 | nfs_free_unlinkdata(data); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 305 | } |