diff options
Diffstat (limited to 'fs/coda/cnode.c')
| -rw-r--r-- | fs/coda/cnode.c | 47 | 
1 files changed, 20 insertions, 27 deletions
diff --git a/fs/coda/cnode.c b/fs/coda/cnode.c index 602240569c8..7740b1c871c 100644 --- a/fs/coda/cnode.c +++ b/fs/coda/cnode.c @@ -7,9 +7,8 @@  #include <linux/time.h>  #include <linux/coda.h> -#include <linux/coda_linux.h> -#include <linux/coda_fs_i.h>  #include <linux/coda_psdev.h> +#include "coda_linux.h"  static inline int coda_fideq(struct CodaFid *fid1, struct CodaFid *fid2)  { @@ -89,24 +88,21 @@ struct inode * coda_iget(struct super_block * sb, struct CodaFid * fid,     - link the two up if this is needed     - fill in the attributes  */ -int coda_cnode_make(struct inode **inode, struct CodaFid *fid, struct super_block *sb) +struct inode *coda_cnode_make(struct CodaFid *fid, struct super_block *sb)  {          struct coda_vattr attr; +	struct inode *inode;          int error;  	/* We get inode numbers from Venus -- see venus source */  	error = venus_getattr(sb, fid, &attr); -	if ( error ) { -	    *inode = NULL; -	    return error; -	}  - -	*inode = coda_iget(sb, fid, &attr); -	if ( IS_ERR(*inode) ) { -		printk("coda_cnode_make: coda_iget failed\n"); -                return PTR_ERR(*inode); -        } -	return 0; +	if (error) +		return ERR_PTR(error); + +	inode = coda_iget(sb, fid, &attr); +	if (IS_ERR(inode)) +		pr_warn("%s: coda_iget failed\n", __func__); +	return inode;  } @@ -141,7 +137,7 @@ struct inode *coda_fid_to_inode(struct CodaFid *fid, struct super_block *sb)  	unsigned long hash = coda_f2i(fid);  	if ( !sb ) { -		printk("coda_fid_to_inode: no sb!\n"); +		pr_warn("%s: no sb!\n", __func__);  		return NULL;  	} @@ -157,19 +153,16 @@ struct inode *coda_fid_to_inode(struct CodaFid *fid, struct super_block *sb)  }  /* the CONTROL inode is made without asking attributes from Venus */ -int coda_cnode_makectl(struct inode **inode, struct super_block *sb) +struct inode *coda_cnode_makectl(struct super_block *sb)  { -	int error = -ENOMEM; - -	*inode = new_inode(sb); -	if (*inode) { -		(*inode)->i_ino = CTL_INO; -		(*inode)->i_op = &coda_ioctl_inode_operations; -		(*inode)->i_fop = &coda_ioctl_operations; -		(*inode)->i_mode = 0444; -		error = 0; +	struct inode *inode = new_inode(sb); +	if (inode) { +		inode->i_ino = CTL_INO; +		inode->i_op = &coda_ioctl_inode_operations; +		inode->i_fop = &coda_ioctl_operations; +		inode->i_mode = 0444; +		return inode;  	} - -	return error; +	return ERR_PTR(-ENOMEM);  }  | 
