lkml.org 
[lkml]   [2005]   [Feb]   [10]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateThu, 10 Feb 2005 12:00:54 +0530
FromManeesh Soni <>
SubjectRe: [PATCH] relayfs redux, part 4
On Wed, Feb 09, 2005 at 08:49:36PM -0600, Tom Zanussi wrote:
[..]
> + */
> +struct dentry *relayfs_create_file(const char *name, struct dentry *parent,
> +				   int mode, struct rchan *chan)
> +{
> +	struct dentry *dentry;
> +	int error;
> +	
> +	if (!mode)
> +		mode = S_IRUSR;
> +	mode = (mode & S_IALLUGO) | S_IFREG;
> +
> +	error = relayfs_create_entry(name, parent, mode, chan, &dentry);

^^^^
I think you missed GregKH's suggesstion to have relayfs_create_entry()
return pointer to struct dentry, and reduce one parameter.
> +unsigned relay_switch_subbuf(struct rchan_buf *buf, unsigned length)
> +{
> +	int cur_subbuf, prev_subbuf, subbufs_produced;
> +	unsigned start = 0, padding = buf->chan->subbuf_size - buf->offset;
> +	
> +	if (unlikely(relay_buf_full(buf)))
> +		return 0;
> +
> +	subbufs_produced = atomic_read(&buf->subbufs_produced);
> +	cur_subbuf = prev_subbuf = subbufs_produced % buf->chan->n_subbufs;
> +	buf->padding[cur_subbuf] = padding;
> +
> +	atomic_inc(&buf->subbufs_produced);
> +
> +	if (waitqueue_active(&buf->read_wait)) {
> +		PREPARE_WORK(&buf->wake_readers, wakeup_readers, buf);
> +		schedule_delayed_work(&buf->wake_readers, 1);
> +	}
> +
> +	if (unlikely(relay_buf_full(buf))) {
> +		return 0;
> +		buf->chan->cb->buf_full(buf);

		^^^^^^^^
		Typo? statement after return !

Thanks
Maneesh

-- 
Maneesh Soni
Linux Technology Center, 
IBM India Software Labs,
Bangalore, India
email: maneesh@in.ibm.com
Phone: 91-80-25044990
-
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    [from the cache]
©2003-2008