linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* One more question about the linux md driver
@ 2003-04-10 14:46 Peter T. Breuer
  2003-04-10 16:04 ` Paul Clements
  0 siblings, 1 reply; 3+ messages in thread
From: Peter T. Breuer @ 2003-04-10 14:46 UTC (permalink / raw)
  To: linux-raid; +Cc: Paul Clements, Neil Brown

Can someone tell me about the difference between (when they are called)

    bind_rdev_to_array
    unbind_rdev_from_array

and

   import_rdev
   export_rdev

?? I want to detect when a device is first inducted into an (any) array
and when it is expelled (from the last array in which it figures). I am
currently using the first two functions, and counting. I suspect I
should be using the second two?

Peter

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: One more question about the linux md driver
  2003-04-10 14:46 One more question about the linux md driver Peter T. Breuer
@ 2003-04-10 16:04 ` Paul Clements
  2003-04-10 16:28   ` Paul Clements
  0 siblings, 1 reply; 3+ messages in thread
From: Paul Clements @ 2003-04-10 16:04 UTC (permalink / raw)
  To: ptb; +Cc: linux-raid

Hi Peter,


"Peter T. Breuer" wrote:

> Can someone tell me about the difference between (when they are called)
> 
>     bind_rdev_to_array
>     unbind_rdev_from_array
> 
> and
> 
>    import_rdev
     ^^^^^^^^^^^

md_import_device (I take it?)


>    export_rdev
> 
> ?? I want to detect when a device is first inducted into an (any) array
> and when it is expelled (from the last array in which it figures). I am
> currently using the first two functions, and counting. I suspect I
> should be using the second two?

Well, I guess it depends what you're trying to do... :)

The import/export occurs earlier (and later, respectively) than the
bind/unbind, so I'm guessing that you want to use the import/export.

It also depends on what level of granularity you need. The rdevs, being
array components, could be partitions or whole devices. I'm guessing you
want to reference count whole devices, since a given partition cannot
belong to more than one md device (although several partitions on the
same device could belong to an md device, or several md devices)? To
figure out the mapping between partitions and devices, I think you want
to use dev_unit() (which basically masks out the minor number from a
kdev_t, leaving the major number).


--
Paul

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: One more question about the linux md driver
  2003-04-10 16:04 ` Paul Clements
@ 2003-04-10 16:28   ` Paul Clements
  0 siblings, 0 replies; 3+ messages in thread
From: Paul Clements @ 2003-04-10 16:28 UTC (permalink / raw)
  To: ptb, linux-raid

Paul Clements wrote:

> to use dev_unit() (which basically masks out the minor number from a
> kdev_t, leaving the major number).

...that's not exactly what I meant to say... :)

The minor_shift determines which portion of the device number represents
the "partition" and which portion represents the "disk". The division is
not necessarily along the major/minor line.

--
Paul

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2003-04-10 16:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-10 14:46 One more question about the linux md driver Peter T. Breuer
2003-04-10 16:04 ` Paul Clements
2003-04-10 16:28   ` Paul Clements

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).