lkml.org 
[lkml]   [2005]   [Feb]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] relayfs redux, part 4
On Wed, 9 Feb 2005 20:49:36 -0600, Tom Zanussi <zanussi@us.ibm.com> wrote:
> +static int relayfs_create_entry(const char *name, struct dentry *parent,
> + int mode, struct rchan *chan,
> + struct dentry **dentry)
> +{
> + struct qstr qname;
> + struct dentry *d;
> + struct inode *inode;
> + int error = 0;
> +
> + BUG_ON(!(S_ISREG(mode) || S_ISDIR(mode)));
> +
> + error = simple_pin_fs("relayfs", &relayfs_mount, &relayfs_mount_count);
> + if (error) {
> + printk(KERN_ERR "Couldn't mount relayfs: errcode %d\n", error);
> + return error;
> + }
> +
> + qname.name = name;
> + qname.len = strlen(name);
> + qname.hash = full_name_hash(name, qname.len);
> +
> + if (!parent)
> + if (relayfs_mount && relayfs_mount->mnt_sb)
> + parent = relayfs_mount->mnt_sb->s_root;

Please move the nested if statement to the parent expression. The
!parent part is always evaluated first.

> +static struct inode *relayfs_alloc_inode(struct super_block *sb)
> +{
> + struct relayfs_inode_info *p;
> + p = (struct relayfs_inode_info *)kmem_cache_alloc(relayfs_inode_cachep,
> + SLAB_KERNEL);

Please drop the spurious cast from void *.

Pekka
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:10    [W:0.199 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site