Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
wendelin.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
Kirill Smelkov
wendelin.core
Commits
bc041be8
Commit
bc041be8
authored
Feb 22, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
d874ccae
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
0 deletions
+21
-0
bigfile/virtmem.c
bigfile/virtmem.c
+15
-0
include/wendelin/bigfile/virtmem.h
include/wendelin/bigfile/virtmem.h
+4
-0
wcfs/wcfs.go
wcfs/wcfs.go
+2
-0
No files found.
bigfile/virtmem.c
View file @
bc041be8
...
...
@@ -226,6 +226,7 @@ int fileh_mmap(VMA *vma, BigFileH *fileh, pgoff_t pgoffset, pgoff_t pglen)
goto
fail
;
/* allocate address space somewhere */
// XXX overlay: -> mmap(base, READ)
addr
=
mem_valloc
(
NULL
,
len
);
if
(
!
addr
)
goto
fail
;
...
...
@@ -382,6 +383,8 @@ int fileh_dirty_writeout(BigFileH *fileh, enum WriteoutFlags flags)
}
/* page.state -> PAGE_LOADED and correct mappings RW -> R */
// XXX adjust(wcfs): just remmap base file? (but it does not yet have stored changes)
// XXX -> vma_remove_readonly_overlay()?
if
(
flags
&
WRITEOUT_MARKSTORED
)
{
page
->
state
=
PAGE_LOADED
;
list_del_init
(
&
page
->
in_dirty
);
...
...
@@ -588,6 +591,8 @@ VMFaultResult vma_on_pagefault(VMA *vma, uintptr_t addr, int write)
/* continuing on_pagefault() - see (1) there ... */
// XXX overlay: assert write
/* (2) vma, addr -> fileh, pagen ;idx of fileh page covering addr */
fileh
=
vma
->
fileh
;
pagen
=
vma_addr_fpgoffset
(
vma
,
addr
);
...
...
@@ -595,6 +600,8 @@ VMFaultResult vma_on_pagefault(VMA *vma, uintptr_t addr, int write)
/* (3) fileh, pagen -> page (via pagemap) */
page
=
pagemap_get
(
&
fileh
->
pagemap
,
pagen
);
// XXX overlay: assert !page
/* (4) no page found - allocate new from ram */
while
(
!
page
)
{
page
=
ramh_alloc_page
(
fileh
->
ramh
,
pagen
);
...
...
@@ -663,6 +670,9 @@ VMFaultResult vma_on_pagefault(VMA *vma, uintptr_t addr, int write)
pageram
=
page_mmap
(
page
,
NULL
,
PROT_READ
|
PROT_WRITE
);
TODO
(
!
pageram
);
// XXX err
// XXX overlay: copy data from base image, page.state=DIRTY
// XXX overlay: goto inject_page
/* loadblk() -> pageram memory */
blk
=
page
->
f_pgoffset
;
// NOTE because blksize = pagesize
...
...
@@ -732,6 +742,7 @@ VMFaultResult vma_on_pagefault(VMA *vma, uintptr_t addr, int write)
return
VM_RETRY
;
}
inject_page:
/* (6) page data ready. Mmap it atomically into vma address space, or mprotect
* appropriately if it was already mmaped. */
int
prot
=
PROT_READ
;
...
...
@@ -741,6 +752,9 @@ VMFaultResult vma_on_pagefault(VMA *vma, uintptr_t addr, int write)
newstate
=
PAGE_DIRTY
;
}
// XXX overlay: assert !vma->page_ismappedv[blk]
// XXX overlay: mmap page to all vma of this fileh.
if
(
!
bitmap_test_bit
(
vma
->
page_ismappedv
,
page
->
f_pgoffset
-
vma
->
f_pgoffset
))
{
// XXX err
page_mmap
(
page
,
vma_page_addr
(
vma
,
page
),
prot
);
...
...
@@ -939,6 +953,7 @@ static void vma_page_ensure_unmapped(VMA *vma, Page *page)
return
;
/* mmap empty PROT_NONE address space instead of page memory */
// XXX overlay: remmap to base image
mem_xvalloc
(
vma_page_addr
(
vma
,
page
),
page_size
(
page
));
bitmap_clear_bit
(
vma
->
page_ismappedv
,
page
->
f_pgoffset
-
vma
->
f_pgoffset
);
...
...
include/wendelin/bigfile/virtmem.h
View file @
bc041be8
...
...
@@ -154,6 +154,10 @@ struct VMA {
*/
int
fileh_open
(
BigFileH
*
fileh
,
BigFile
*
file
,
RAM
*
ram
);
// XXX + fileh_open_overlay(fileh, file, base, ram) ?
// here base is glued data from head/bigfile/file + revX/bigfile/file overwrites.
// file will be used only to storeblk (loadblk=BUG).
/* close fileh
*
...
...
wcfs/wcfs.go
View file @
bc041be8
...
...
@@ -1621,6 +1621,8 @@ func main() {
go
root
.
zwatcher
(
ctx
)
// TODO handle autoexit
// (exit when kernel forgets all our inodes - wcfs.py keeps .wcfs/zurl
// opened, so when all inodes has been forgotten - we know all wcfs.py clients exited)
_
=
autoexit
// serve client requests
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment