lkml.org 
[lkml]   [2003]   [Jul]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectNew idea for file-based mounts
Instead of using mount/umount syscalls, have a file that exists 
per-directory named, say, ..mount. Then, to mount /dev/sda at /home,
you issue the command
echo "/dev/sda rw" > /home/..mount
(Almost the same syntax as mtab.) The OS takes action (upon modification
of the ..mounts file) and attempts the mount. Reading back the file
would show:
/dev/sda rw

if the mount suceeded, otherwise it would be null if there is an error.
To unmount the file system, remove that line from the ..mounts file.

Now, if you want to do layered mounts, a la plan 9, you could search
from the top line through the last line. Say you had a directory,
/programs. You want to make a union of directories together, so you
make /programs/..mounts look like:
/home/root/bin rw
/bin ro
/sbin ro
/usr/bin ro

Since /home/root/bin rw is read-write, any newly written files in
/programs really go in /home/root/bin. But you see files from each of
the four directories (unless they have duplicate names, then higher in
the list takes precedence) due to the unioning.

Why do this? A few reasons: one could set unix permissions/acl's on the
..mounts file--you could easily let non-root users perform mount
operations on certain directories. Then you don't need mount and
unmount commands as well.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:46    [W:0.118 / U:0.040 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site