]> git.neil.brown.name Git - history.git/commit
[PATCH] md 13 of 22 - First step to tidying mddev recounting and locking.
authorNeil Brown <neilb@cse.unsw.edu.au>
Tue, 18 Jun 2002 11:16:59 +0000 (04:16 -0700)
committerLinus Torvalds <torvalds@home.transmeta.com>
Tue, 18 Jun 2002 11:16:59 +0000 (04:16 -0700)
commita9d0889a88c934782ad0a034afdd52b2a7ff73db
treecd72fbbaa30890e78363863a3a621a0145f1b2b3
parent932db78f92b35676e1ff4ab90a1c046cbb940294
[PATCH] md 13 of 22 - First step to tidying mddev recounting and locking.

First step to tidying mddev recounting and locking.

This patches introduces
  mddev_get   which incs the refcount on an mddev
  mddev_put   which decs it and, if it becomes unused, frees it
  mddev_find  which finds or allocated an mddev for a given minor
              This is mostly the old alloc_mddev

free_mddev no longer actually frees it.  It just disconnects all drives
so that mddev_put will do the free.

Now the test for "does an mddev exist" is not "mddev != NULL"
but involves checking if the mddev has disks or a superblock
attached.

This makes the semantics of do_md_stop a bit cleaner.  Previously
if do_md_stop succeed for a real stop (not a read-only stop) then
you didn't have to unlock the mddev, otherwise you did.  Now
you always unlock the mddev after do_md_stop.
drivers/md/md.c