tech-kern archive

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

Re: Add a mountlist iterator (round 2)



Time to start a second round.  This time the iterator only, vfs_busy()
and friends deferred to a new thread once the iterator is done.

Changes from the previous proposal:

- Removed the "flags" argument from mountlist_iterator_next(), will
  add mountlist_iterator_trynext() and vfs_trybusy() when needed.

- Added "void mountlist_iterator_done(mount_iterator_t *)" to
  completely hide vfs_busy()/vfs_unbusy() from the API and make it
  possible to assert that every call to mountlist_iterator_next()
  gets accompanied by a call to mountlist_iterator_done().

- Use the existing lock "mountlist_lock".

A typical usage is:

	mount_iterator_t *iter;

	mountlist_iterator_init(&iter);
	while ((mp = mountlist_iterator_next(iter)) != NULL) {
		... 
		mountlist_iterator_done(iter);
	}
	mountlist_iterator_destroy(iter);  

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

Comments or objections anyone?

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



Home | Main Index | Thread Index | Old Index