mirror of
https://github.com/kepler155c/opus
synced 2024-12-29 01:50:27 +00:00
vfs bugfix
This commit is contained in:
parent
602d12afc5
commit
d72ae3de4a
@ -267,6 +267,16 @@ function fs.mount(path, fstype, ...)
|
|||||||
if not vfs then
|
if not vfs then
|
||||||
error('Invalid file system type')
|
error('Invalid file system type')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- hack - get the mount point for the path
|
||||||
|
-- ie. if packages is mapped to disk/packages
|
||||||
|
-- and a request to mount /packages/foo
|
||||||
|
-- then use disk/packages/foo as the mountPoint
|
||||||
|
local n = getNode(path)
|
||||||
|
if n.fstype == 'linkfs' then
|
||||||
|
path = path:gsub(n.mountPoint, n.source, 1)
|
||||||
|
end
|
||||||
|
|
||||||
local node = vfs.mount(path, ...)
|
local node = vfs.mount(path, ...)
|
||||||
if node then
|
if node then
|
||||||
local parts = splitpath(path)
|
local parts = splitpath(path)
|
||||||
@ -279,9 +289,12 @@ function fs.mount(path, fstype, ...)
|
|||||||
end
|
end
|
||||||
if not tp.nodes[d] then
|
if not tp.nodes[d] then
|
||||||
tp.nodes[d] = Util.shallowCopy(tp)
|
tp.nodes[d] = Util.shallowCopy(tp)
|
||||||
|
|
||||||
|
-- another related hack
|
||||||
if tp.fstype == 'linkfs' then
|
if tp.fstype == 'linkfs' then
|
||||||
tp.nodes[d].source = fs.combine(tp.nodes[d].source, d)
|
tp.nodes[d].source = fs.combine(tp.nodes[d].source, d)
|
||||||
end
|
end
|
||||||
|
|
||||||
tp.nodes[d].nodes = { }
|
tp.nodes[d].nodes = { }
|
||||||
tp.nodes[d].mountPoint = fs.combine(tp.mountPoint, d)
|
tp.nodes[d].mountPoint = fs.combine(tp.mountPoint, d)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user