public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: lvm-devel@sistina.com
Cc: linux-kernel@vger.kernel.org
Subject: Re: [lvm-devel] [PATCH] add kobject to struct mapped_device
Date: Fri, 20 Dec 2002 00:31:50 -0800	[thread overview]
Message-ID: <20021220083149.GA10484@kroah.com> (raw)
In-Reply-To: <20021219105530.GA2003@reti>

On Thu, Dec 19, 2002 at 10:55:30AM +0000, Joe Thornber wrote:
> Greg,
> 
> This looks like patch 1 of many, since it doesn't actually export any
> attributes through sysfs yet.

Correct.

> Can you please give me more of an idea
> of what the attributes are that you want to export ?  Are you trying
> to move the dmfs functionality into sysfs ?

Only the parts of dmfs that make sense to :)

Right now every struct gendisk shows up in sysfs under the block/
directory, including every struct mapped_device that is created through
the dm code.  Now every mapped_device that already exists in sysfs,
exports the major/minor number (in the dev file), and other gendisk
specific attributes.  Why not just add the mapped_device specific
attributes of this gendisk object into the same directory (or one lower
to try to partition things a bit.)  That would mean taking the files
that were going to be in dmfs, and placing them into this directory
(like status, suspend, and others).  Some of them might have to be split
up into multiple files to keep the "one value per file" rule, but that
shouldn't be very difficult.

Here's an ascii picture which probably makes more sense:
/sys/block/
|-- fd0
|   |-- dev
|   |-- range
|   |-- size
|   `-- stat
|-- dm-1
|   |-- dev
|   |-- dm
|   |   |-- device0 -> ../../devices/pci0/00:02.5/ide0/0.0
|   |   |-- device1 -> ../../devices/pci0/00:02.5/ide1/1.0
|   |   |-- status
|   |   |-- suspend
|   |   `-- table
|   |-- range
|   |-- size
|   `-- stat

Look reasonable?

And yes, the deviceX files are symlinks to the struct block_device that
are controlled by this mapped_device, which I think is a easy visual
clue as to what is going on.

I know, this doesn't address the issue of creating these mapped_device
structures in the first place with either an ioctl, or a "special file",
but let's try to export the values and relationships that we already
have.  One step at a time...

> I won't accept this patch on it's own, but am sure what you are trying
> to do is the right thing, so will probably have no objections when the
> rest of the patches arrive.

That's fair enough, I'll work on getting the rest of the patches out in
a fairly timely manner, considering the holiday season...

> On Wed, Dec 18, 2002 at 10:43:07AM -0800, Greg KH wrote:
> > Oh, and why isn't struct mapped_device declared in dm.h?  If it was,
> > dm_get and dm_put could be inlined, along with a few other potential
> > cleanups.
> 
> I'm try to keep implementation details out of header files.  dm_get()
> and dm_put() are not performance critical so I see no need to inline them.

Ok.  I can place all of the sysfs specific functions in dm.c, just like
drivers/block/genhd.c has, or if we place struct mapped_device into
dm.h, they can live in their own file.  Doesn't bother me either way.

thanks,

greg k-h

  reply	other threads:[~2002-12-20  8:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-18 18:43 [PATCH] add kobject to struct mapped_device Greg KH
2002-12-18 18:53 ` [lvm-devel] " Greg KH
2002-12-19 10:55 ` Joe Thornber
2002-12-20  8:31   ` Greg KH [this message]
2002-12-20  9:44     ` Joe Thornber
2002-12-20 17:49       ` Greg KH
2002-12-30 10:57         ` Joe Thornber

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=20021220083149.GA10484@kroah.com \
    --to=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lvm-devel@sistina.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox