[linux-cifs-client] [PATCH 1/4] cifs: clean up variables in cifs_unlink

Christoph Hellwig hch at infradead.org
Tue Sep 16 16:19:03 GMT 2008


On Tue, Sep 16, 2008 at 07:27:13AM -0400, Jeff Layton wrote:
> Change the "inode" param in cifs_unlink to "pinode" to make it clear
> that it's the parent directory inode. Add a new "inode" pointer to
> refer to the dentry->d_inode.

> -int cifs_unlink(struct inode *inode, struct dentry *direntry)
> +int cifs_unlink(struct inode *pinode, struct dentry *direntry)

Can you please use the names that the VFS and most filesystems use for
these?  That would be

int cifs_unlink(struct inode *dir, struct dentry *dentry)

>  	struct cifsInodeInfo *cifsInode;
> +	struct super_block *sb;
> +	struct inode *inode = direntry->d_inode;
>  	FILE_BASIC_INFO *pinfo_buf;
>  
> -	cFYI(1, ("cifs_unlink, inode = 0x%p", inode));
> +	cFYI(1, ("cifs_unlink, pinode = 0x%p, dentry=0x%p", pinode, direntry));
>  
>  	xid = GetXid();
>  
> -	if (inode)
> -		cifs_sb = CIFS_SB(inode->i_sb);
> +	if (pinode)
> +		sb = pinode->i_sb;
>  	else
> -		cifs_sb = CIFS_SB(direntry->d_sb);
> +		sb = direntry->d_sb;

The parent directory passed to ->unlink is never NULL.

> +
> +	cifs_sb = CIFS_SB(sb);
>  	pTcon = cifs_sb->tcon;

Care to initialize them where your declare the variable?  Also pTcon
should really be just tcon for normal linux coding style:



More information about the linux-cifs-client mailing list