Subject: Advice Needed on a NetBSD based project
To: None <tech-kern@netbsd.org>
From: None <hsaliak@kasba.ath.cx>
List: tech-kern
Date: 08/08/2004 18:18:56
Hi list ,
I am a student and also a netbsd user currently doing a final year 
project in university. NetBSD is the target platform for this.
I have run against some problems for which I need help. Opinions will also be
welcome. Please bear with the lengthy mail.

  My project is a stab on solving the problem with filesystems
growing large and unweildy to manage manually. Hence I am trying to provide
an autosorting filesystem which will sort based on metadata. Sorting of
each file type will be provided by an indexing engine.  The policy will 
also be enforced this way.  I realise that there are several approaches one can
take in doing this, and that many of those have already been tried.

  An approach would be to have an indexing daemon in userspace along with  a 
kernel space fs  layer thats developed from the overlayfs. This layer will 
will intercept the vnode ops and do what's necessary to route
the operations,and call the lower layer's routines. However, I think 
(correctly?) that work on the metadata ( and policy decisions such as 
where a sorted  file goes ) should be done in userspace. Therefore 
I would need a system to communicate between my fs layer and the  userspace
indexing daemon that will do the heavy lifting and control the policy of
the fs, as in how the files are sorted.

  I am guessing that this way i should be able to achieve a minimal
performance hit. As opposed to completely doing it in userspace ( even though
movement of data  within an fs and linking are speedy ops).
Is this assumption valid? 
Or is a fully  userspace implementation justified for this?

My main problem problem here is that  I dont have much idea on how to go about 
designing a efficient way to communicate between such an indexing daemon and my 
fs layer.
Is there an efficient mechanism already present to achieve this?  Or anything I can base it on, without starting from scratch? 
My apologies if I missed out on something obvious.
Regards,
Kailash