lkml.org 
[lkml]   [2008]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 1/2] vfs: Introduce on-demand filesystem initialisation
On Sun, Jun 01, 2008 at 03:51:54PM +0100, Tom Spink wrote:


Occam's Razor...

You've just serialized ->kill_sb() for given fs type (and made sure that
if one gets stuck, _everything_ gets stuck). Moreover, you've serialized
sget() against the same thing (i.e. pretty much each ->get_sb()).

All of that (and a couple of new methods) is done for something that just
plain does not belong to VFS. It's trivially doable in filesystem *and*
it's about the objects with lifetimes that make sense only for filesystem
itself.

Hell, just do

int want_xfs_threads(void)
{
int res = 0;
mutex_lock(&foo_lock);
if (!count++) {
start threads
if failed {
count--;
res = -Esomething;
}
}
mutex_unlock(&foo_lock);
return res;
}

void leave_xfs_threads(void)
{
mutex_lock(&foo_lock);
if (!--count)
stop threads
mutex_unlock(&foo_lock);
}

Call want_xfs_threads() in xfs_fs_fill_super(); call leave_xfs_threads() in
the end of xfs_put_super() and on failure exit from xfs_fs_fill_super().
End of story... Any other fs that wants such things can do the same.


\
 
 \ /
  Last update: 2008-06-01 17:35    [W:0.063 / U:1.464 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site