Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 22 Apr 2010 16:02:16 +0200 (CEST)
From:      "=?ISO-8859-15?Q?Luk=E1=A8_Czerner?=" <czerner.lukas@gmail.com>
To:        freebsd-hackers@freebsd.org
Subject:   How to change vnode operations ?
Message-ID:  <alpine.DEB.1.10.1004221559270.7101@a04-0215a.kn.vutbr.cz>

next in thread | raw e-mail | index | archive | help
Hi all,

this may sound a little odd, since I have noticed that there is much
work done to not allow such a thing ($SUBJ). But may be you can help
me and point me to the right direction.

I am writing a kernel module with somewhat similar functionality
like nullfs has, BUT it has to have some features which nullfs
itself does not provide :

 1. I need the new layer to completely hide underlaying layer so no
    one can bypass it.
 2. Nullfs allows me to to overlay just one directory, but i want to
    include another directories and/or exclude subdirectories/files.
 3. Nullfs just redirects vnode operations to lower layer, I need to
    catch that operation, do something (for example alter the arguments
    somehow etc..), pass the operation (with possibly altered arguments)
    to the lower layer, get the result and then return the result.

The best way to do that (I think) is to change vnode operations of
particular vnodes to point to functions defined in that module. At
this point, I can catch any operations with the vnode and this is
the base of what i want.

So my question is. I there any "clean" way to chande vnode
operations ? If not, is there any "not so clean" way ? Anyway I will
appreciate any good idea how to do what I have described.


Thanks!
-Lukas. 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.DEB.1.10.1004221559270.7101>