diff options
Diffstat (limited to 'fs/nfs/unlink.c')
-rw-r--r-- | fs/nfs/unlink.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/fs/nfs/unlink.c b/fs/nfs/unlink.c index de54129336c6..fa538b2ba251 100644 --- a/fs/nfs/unlink.c +++ b/fs/nfs/unlink.c | |||
@@ -143,7 +143,7 @@ static int nfs_do_call_unlink(struct dentry *parent, struct inode *dir, struct n | |||
143 | nfs_free_dname(data); | 143 | nfs_free_dname(data); |
144 | ret = nfs_copy_dname(alias, data); | 144 | ret = nfs_copy_dname(alias, data); |
145 | spin_lock(&alias->d_lock); | 145 | spin_lock(&alias->d_lock); |
146 | if (ret == 0 && alias->d_inode != NULL && | 146 | if (ret == 0 && d_really_is_positive(alias) && |
147 | !(alias->d_flags & DCACHE_NFSFS_RENAMED)) { | 147 | !(alias->d_flags & DCACHE_NFSFS_RENAMED)) { |
148 | devname_garbage = alias->d_fsdata; | 148 | devname_garbage = alias->d_fsdata; |
149 | alias->d_fsdata = data; | 149 | alias->d_fsdata = data; |
@@ -190,7 +190,7 @@ static int nfs_call_unlink(struct dentry *dentry, struct nfs_unlinkdata *data) | |||
190 | parent = dget_parent(dentry); | 190 | parent = dget_parent(dentry); |
191 | if (parent == NULL) | 191 | if (parent == NULL) |
192 | goto out_free; | 192 | goto out_free; |
193 | dir = parent->d_inode; | 193 | dir = d_inode(parent); |
194 | /* Non-exclusive lock protects against concurrent lookup() calls */ | 194 | /* Non-exclusive lock protects against concurrent lookup() calls */ |
195 | spin_lock(&dir->i_lock); | 195 | spin_lock(&dir->i_lock); |
196 | if (atomic_inc_not_zero(&NFS_I(dir)->silly_count) == 0) { | 196 | if (atomic_inc_not_zero(&NFS_I(dir)->silly_count) == 0) { |
@@ -210,21 +210,21 @@ out_free: | |||
210 | 210 | ||
211 | void nfs_wait_on_sillyrename(struct dentry *dentry) | 211 | void nfs_wait_on_sillyrename(struct dentry *dentry) |
212 | { | 212 | { |
213 | struct nfs_inode *nfsi = NFS_I(dentry->d_inode); | 213 | struct nfs_inode *nfsi = NFS_I(d_inode(dentry)); |
214 | 214 | ||
215 | wait_event(nfsi->waitqueue, atomic_read(&nfsi->silly_count) <= 1); | 215 | wait_event(nfsi->waitqueue, atomic_read(&nfsi->silly_count) <= 1); |
216 | } | 216 | } |
217 | 217 | ||
218 | void nfs_block_sillyrename(struct dentry *dentry) | 218 | void nfs_block_sillyrename(struct dentry *dentry) |
219 | { | 219 | { |
220 | struct nfs_inode *nfsi = NFS_I(dentry->d_inode); | 220 | struct nfs_inode *nfsi = NFS_I(d_inode(dentry)); |
221 | 221 | ||
222 | wait_event(nfsi->waitqueue, atomic_cmpxchg(&nfsi->silly_count, 1, 0) == 1); | 222 | wait_event(nfsi->waitqueue, atomic_cmpxchg(&nfsi->silly_count, 1, 0) == 1); |
223 | } | 223 | } |
224 | 224 | ||
225 | void nfs_unblock_sillyrename(struct dentry *dentry) | 225 | void nfs_unblock_sillyrename(struct dentry *dentry) |
226 | { | 226 | { |
227 | struct inode *dir = dentry->d_inode; | 227 | struct inode *dir = d_inode(dentry); |
228 | struct nfs_inode *nfsi = NFS_I(dir); | 228 | struct nfs_inode *nfsi = NFS_I(dir); |
229 | struct nfs_unlinkdata *data; | 229 | struct nfs_unlinkdata *data; |
230 | 230 | ||
@@ -367,8 +367,8 @@ static void nfs_async_rename_release(void *calldata) | |||
367 | struct nfs_renamedata *data = calldata; | 367 | struct nfs_renamedata *data = calldata; |
368 | struct super_block *sb = data->old_dir->i_sb; | 368 | struct super_block *sb = data->old_dir->i_sb; |
369 | 369 | ||
370 | if (data->old_dentry->d_inode) | 370 | if (d_really_is_positive(data->old_dentry)) |
371 | nfs_mark_for_revalidate(data->old_dentry->d_inode); | 371 | nfs_mark_for_revalidate(d_inode(data->old_dentry)); |
372 | 372 | ||
373 | dput(data->old_dentry); | 373 | dput(data->old_dentry); |
374 | dput(data->new_dentry); | 374 | dput(data->new_dentry); |
@@ -529,10 +529,10 @@ nfs_sillyrename(struct inode *dir, struct dentry *dentry) | |||
529 | if (dentry->d_flags & DCACHE_NFSFS_RENAMED) | 529 | if (dentry->d_flags & DCACHE_NFSFS_RENAMED) |
530 | goto out; | 530 | goto out; |
531 | 531 | ||
532 | fileid = NFS_FILEID(dentry->d_inode); | 532 | fileid = NFS_FILEID(d_inode(dentry)); |
533 | 533 | ||
534 | /* Return delegation in anticipation of the rename */ | 534 | /* Return delegation in anticipation of the rename */ |
535 | NFS_PROTO(dentry->d_inode)->return_delegation(dentry->d_inode); | 535 | NFS_PROTO(d_inode(dentry))->return_delegation(d_inode(dentry)); |
536 | 536 | ||
537 | sdentry = NULL; | 537 | sdentry = NULL; |
538 | do { | 538 | do { |
@@ -554,7 +554,7 @@ nfs_sillyrename(struct inode *dir, struct dentry *dentry) | |||
554 | */ | 554 | */ |
555 | if (IS_ERR(sdentry)) | 555 | if (IS_ERR(sdentry)) |
556 | goto out; | 556 | goto out; |
557 | } while (sdentry->d_inode != NULL); /* need negative lookup */ | 557 | } while (d_inode(sdentry) != NULL); /* need negative lookup */ |
558 | 558 | ||
559 | /* queue unlink first. Can't do this from rpc_release as it | 559 | /* queue unlink first. Can't do this from rpc_release as it |
560 | * has to allocate memory | 560 | * has to allocate memory |