tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
struct file at VFS level (round 1.5)
Hello
I try to summarize the thing so far.
NetBSD filesystems implement advisory locks, where the only place the
filesystem actually check locks as VOP_ADVLOCK. Any other operation
performed on a file region locked by someone else succeeds: the locks
are only advisory, and it is the application duty to enforce it.
The GLusterFS people are working to implement mandatory locks, where
the filesystem actually enforces locks on any operation: if you write
to a region locked by someone else, you get a failure.
Mandatory locks must be implemented at the filesystem level, because
in the distributed filesystem case, the local kernel knows nothing
about locks sets form other machines. It requires the filesystem to
distinguish operations on different struct file for a given vnode,
because a lock may be acquired for a struct file and not for another
one. Currently NetBSD does not pass this information to filesystems.
I proposed a patch that embeds the required information in struct cred:
https://ftp.espci.fr/shadow/manu/filecred1.patch
Ome expresse dissatisfaction with the approach, ostly because struct
cred would not be the right place. Doing it another was means modifying
the VFS interface to add a reference to struct file where needed (that
is: anything that touch file content). Would that approach be better?
If the struct cred way is preferred, feedback on the actual implementation
on the above patch will be apprciated.
For the sake of completeness: once VFS support is there, PUFFS and
PERFUSE must be improved so that the new informaiton is sent to FUSE
filesystems. I have not yet worked on that part.
--
Emmanuel Dreyfus
manu%netbsd.org@localhost
Home |
Main Index |
Thread Index |
Old Index