tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Add a mountlist iterator



Currently vfs_busy() / vfs_unbusy() get used to

- Enter/leave a critical section against unmounting

- Add a reference to the mount

- return the next mount from the mountlist on error

Plan is to untangle the mountlist processing from vfs_busy() / vfs_unbusy()
and add an iterator for the mountlist:

- void mountlist_iterator_init(mount_iterator_t **)
  to initialize an iterator in mounted order.

- void mountlist_iterator_init_reverse(mount_iterator_t **)
  to initialize an iterator in reverse mounted order.

- void mountlist_iterator_destroy(mount_iterator_t *)
  to destroy an iterator aquired with one of the above.

- struct mount *mountlist_iterator_next(mount_iterator_t *, int)
  to retrieve the next mount from an iterator or NULL if done.
  The mount is returned vfs_busy'd, caller has to vfs_unbusy.
  Accepts a flag MNT_NOWAIT to skip mounts whose unmount is in progress.

- struct mount *_mountlist_next(struct mount *)
  a lockless variant to be used from DDB only.

Diffs are here: https://www.netbsd.org/~hannken/ml_iterator/

Comments or objections anyone?

--
J. Hannken-Illjes - hannken%eis.cs.tu-bs.de@localhost - TU Braunschweig (Germany)



Home | Main Index | Thread Index | Old Index