All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: Dave Chinner <david@fromorbit.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 4/6] xfs: add xlog sysfs kobject and attribute handlers
Date: Thu, 26 Jun 2014 09:41:21 -0400	[thread overview]
Message-ID: <20140626134120.GE37470@bfoster.bfoster> (raw)
In-Reply-To: <20140626122854.GA37470@bfoster.bfoster>

On Thu, Jun 26, 2014 at 08:28:55AM -0400, Brian Foster wrote:
> On Thu, Jun 26, 2014 at 02:47:19PM +1000, Dave Chinner wrote:
> > On Fri, Jun 06, 2014 at 09:13:32AM -0400, Brian Foster wrote:
> > > Embed a kobject into the xfs log data structure (xlog). This creates a
> > > 'log' subdirectory for every XFS mount instance in sysfs. The lifecycle
> > > of the log kobject is tied to the lifecycle of the log.
> > > 
> > > Also define a set of generic attribute handlers associated with the log
> > > kobject in preparation for the addition of attributes.
> > 
> > The code works fine, but....
> > > 
> > > Signed-off-by: Brian Foster <bfoster@redhat.com>
> > > ---
> > >  fs/xfs/xfs_log.c      |  9 +++++++++
> > >  fs/xfs/xfs_log_priv.h |  3 +++
> > >  fs/xfs/xfs_sysfs.c    | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++
> > >  fs/xfs/xfs_sysfs.h    |  1 +
> > >  4 files changed, 66 insertions(+)
> > > 
...
> > > diff --git a/fs/xfs/xfs_sysfs.c b/fs/xfs/xfs_sysfs.c
> > > index 41365fe..f837527 100644
> > > --- a/fs/xfs/xfs_sysfs.c
> > > +++ b/fs/xfs/xfs_sysfs.c
...
> > > +
> > > +STATIC void
> > > +xfs_log_release(struct kobject *kobj)
> > > +{
> > > +	struct xlog *log = container_of(kobj, struct xlog, l_kobject);
> > > +
> > > +	complete(&log->l_kobject_complete);
> > > +}
> > 
> > If the release funtion is common with other types, then the xfs_kobj
> > structure is perfect for this use - it will prevent a heap of
> > duplicated release functions...
> > 
> 
> It's going to look virtually the same for every kobject. Unfortunately,
> it needs to go from kobj->xfs_object->xfs_kobj, so each type requires a
> unique definition. We might be able to just turn it into a macro or
> something that takes the appropriate info and reduces the clutter. I'll
> play around with it. Thanks.
> 

Oops, never mind. I didn't grok what we'd get handed back here,
apparently. We get the kobject, contained by the new xfs_kobj and
already carrying the completion. There's no need to reference the
outermost structure so this can be made generic.

Brian

> Brian
> 
> > Cheers,
> > 
> > Dave.
> > -- 
> > Dave Chinner
> > david@fromorbit.com
> 
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2014-06-26 13:41 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-06 13:13 [PATCH 0/6] xfs sysfs support Brian Foster
2014-06-06 13:13 ` [PATCH 1/6] xfs: fix a couple error sequence jumps in xfs_mountfs() Brian Foster
2014-06-26  4:10   ` Dave Chinner
2014-06-06 13:13 ` [PATCH 2/6] xfs: add a sysfs kset Brian Foster
2014-06-26  4:13   ` Dave Chinner
2014-06-06 13:13 ` [PATCH 3/6] xfs: add xfs_mount sysfs kobject Brian Foster
2014-06-26  4:29   ` Dave Chinner
2014-06-06 13:13 ` [PATCH 4/6] xfs: add xlog sysfs kobject and attribute handlers Brian Foster
2014-06-26  4:47   ` Dave Chinner
2014-06-26 12:28     ` Brian Foster
2014-06-26 13:41       ` Brian Foster [this message]
2014-06-06 13:13 ` [PATCH 5/6] xfs: add log attributes for log lsn and grant head data Brian Foster
2014-06-26  4:52   ` Dave Chinner
2014-06-26 12:29     ` Brian Foster
2014-06-06 13:13 ` [PATCH 6/6] xfs: document log sysfs attributes in testing ABI Brian Foster
2014-06-26  5:03   ` Dave Chinner
2014-06-26 12:30     ` Brian Foster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140626134120.GE37470@bfoster.bfoster \
    --to=bfoster@redhat.com \
    --cc=david@fromorbit.com \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.