Skip to content

Commit e6d6836

Browse files
author
Al Viro
committed
sanitize coda_dentry_delete()
d_really_is_negative(dentry) is a check for d_inode(dentry) being NULL; rechecking that is pointless (and no, it can't race - the caller is holding ->d_lock, so ->d_inode is stable) Signed-off-by: Al Viro <[email protected]>
1 parent 6fa6e4e commit e6d6836

1 file changed

Lines changed: 3 additions & 9 deletions

File tree

fs/coda/dir.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -479,18 +479,12 @@ static int coda_dentry_revalidate(struct inode *dir, const struct qstr *name,
479479
*/
480480
static int coda_dentry_delete(const struct dentry * dentry)
481481
{
482-
struct inode *inode;
483-
struct coda_inode_info *cii;
484-
485-
if (d_really_is_negative(dentry))
486-
return 0;
482+
struct inode *inode = d_inode(dentry);
487483

488-
inode = d_inode(dentry);
489484
if (!inode)
490-
return 1;
485+
return 0;
491486

492-
cii = ITOC(inode);
493-
if (cii->c_flags & C_PURGE)
487+
if (ITOC(inode)->c_flags & C_PURGE)
494488
return 1;
495489

496490
return 0;

0 commit comments

Comments
 (0)