[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1222228670.7761.9.camel@charm-linux>
Date: Tue, 23 Sep 2008 22:57:50 -0500
From: Tom Zanussi <zanussi@...cast.net>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: a.p.zijlstra@...llo.nl, prasad@...ux.vnet.ibm.com,
mbligh@...gle.com, linux-kernel@...r.kernel.org,
torvalds@...ux-foundation.org, tglx@...utronix.de,
compudj@...stal.dyndns.org, rostedt@...dmis.org, od@...ell.com,
fche@...hat.com, hch@....de, dwilder@...ibm.com
Subject: Re: [PATCH 3/3] relay - add channel flags
Thanks for the comments on these patches - I'll include the changes in
the next go-round.
On Tue, 2008-09-23 at 13:20 -0700, Andrew Morton wrote:
> On Tue, 23 Sep 2008 00:27:56 -0500
> Tom Zanussi <zanussi@...cast.net> wrote:
>
> > Add channel flags to relay, remove global callback param.
> >
> > relay should probably have had a flags param from the beginning; it
> > wasn't originally added because it wasn't originally needed - it
> > probably would have helped avoid some of the callback contortions
> > that were added due to a lack of flags. This adds them and does a
> > small amount of low-hanging cleanup, and is also in preparation for
> > some new flags in future patches.
> >
> > Signed-off-by: Tom Zanussi <tzanussi@...il.com>
> >
> > diff --git a/block/blktrace.c b/block/blktrace.c
> > index eb9651c..150c5f7 100644
> > --- a/block/blktrace.c
> > +++ b/block/blktrace.c
> > @@ -356,8 +356,7 @@ static int blk_remove_buf_file_callback(struct dentry *dentry)
> > static struct dentry *blk_create_buf_file_callback(const char *filename,
> > struct dentry *parent,
> > int mode,
> > - struct rchan_buf *buf,
> > - int *is_global)
> > + struct rchan_buf *buf)
> > {
> > return debugfs_create_file(filename, mode, parent, buf,
> > &relay_file_operations);
> > @@ -424,7 +423,7 @@ int do_blk_trace_setup(struct request_queue *q, char *name, dev_t dev,
> > goto err;
> >
> > bt->rchan = relay_open("trace", dir, buts->buf_size,
> > - buts->buf_nr, &blk_relay_callbacks, bt);
> > + buts->buf_nr, &blk_relay_callbacks, bt, 0UL);
> > if (!bt->rchan)
> > goto err;
> >
> > diff --git a/include/linux/relay.h b/include/linux/relay.h
> > index 52e4d61..18fd269 100644
> > --- a/include/linux/relay.h
> > +++ b/include/linux/relay.h
> > @@ -25,7 +25,13 @@
> > /*
> > * Tracks changes to rchan/rchan_buf structs
> > */
> > -#define RELAYFS_CHANNEL_VERSION 7
> > +#define RELAYFS_CHANNEL_VERSION 8
>
> What is the significance of this change? Does it affect the
> kernel<->userspace interface? Is it back-compatible with existing
> userspace?
>
No, nothing to do with the kernel-userspace interface. The channel
version is included in the channel struct and was meant as an aid in
deciphering channel data in crash dumps.
Tom
>
> > +/*
> > + * relay channel flags
> > + */
> > +#define RCHAN_MODE_OVERWRITE 0x00000001 /* 'flight' mode */
> > +#define RCHAN_GLOBAL_BUFFER 0x00000002 /* not using per-cpu */
> >
> >
> > ...
> >
> > @@ -480,7 +478,7 @@ static struct rchan_buf *relay_open_buf(struct rchan *chan, unsigned int cpu)
> > buf->cpu = cpu;
> > __relay_reset(buf, 1);
> >
> > - if(chan->is_global) {
> > + if(chan->flags & RCHAN_GLOBAL_BUFFER) {
>
> Please use checkpatch. It's a little thing, but it's so easy to fix..
>
> > chan->buf[0] = buf;
> > buf->cpu = 0;
> > }
> >
> > ...
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists