Re: [PATCH 1/5] sysfs: relay channel buffers as sysfs attributes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Feb 19, 2006 at 11:07:57PM +0200, Paul Mundt wrote:


> +
> +static struct dentry *
> +sysfs_create_buf_file(const char *filename, struct dentry *dentry, int mode,
> +		      struct rchan_buf *buf, int *is_global)
> +{
> +	struct relay_attribute *attr = (struct relay_attribute *)dentry;
> +	struct dentry *parent = attr->kobj->dentry;
> +	int ret;
> +
> +	attr->attr.mode = mode;
> +	attr->rchan_buf = buf;
> +
> +	ret = sysfs_add_file(parent, &attr->attr, SYSFS_KOBJ_RELAY_ATTR);
> +	if (unlikely(ret != 0))
> +		return NULL;
> +
> +	dentry = lookup_one_len(filename, parent, strlen(filename));

lookup_one_len() needs parent's i_mutex.


> +	if (IS_ERR(dentry))
> +		sysfs_hash_and_remove(parent, filename);

Also wondering if you have considered the case of -EEXIST?

> +
> +	return dentry;
> +}


Thanks
Maneesh


-- 
Maneesh Soni
Linux Technology Center, 
IBM India Software Labs,
Bangalore, India
email: [email protected]
Phone: 91-80-25044990
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux