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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Joshua
wendelin.core
Commits
4d18f19b
Commit
4d18f19b
authored
Jul 10, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
a3299f60
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
6 deletions
+11
-6
bigfile/tests/test_virtmem.c
bigfile/tests/test_virtmem.c
+2
-1
bigfile/virtmem.c
bigfile/virtmem.c
+9
-5
No files found.
bigfile/tests/test_virtmem.c
View file @
4d18f19b
...
...
@@ -1179,7 +1179,8 @@ void test_file_access_mmapbase(void)
RAM
*
ram
;
BigFileH
fh_struct
,
*
fh
=
&
fh_struct
;
VMA
vma_struct
,
*
vma
=
&
vma_struct
;
Page
*
page0
,
*
page2
,
*
page3
;
// Page *page0, *page2, *page3;
Page
*
page2
;
size_t
PS
,
PSb
;
int
fd
,
err
;
...
...
bigfile/virtmem.c
View file @
4d18f19b
/* Wendelin.bigfile | Virtual memory
* Copyright (C) 2014-201
5
Nexedi SA and Contributors.
* Copyright (C) 2014-201
9
Nexedi SA and Contributors.
* Kirill Smelkov <kirr@nexedi.com>
*
* This program is free software: you can Use, Study, Modify and Redistribute
...
...
@@ -222,9 +222,9 @@ int fileh_mmap(VMA *vma, BigFileH *fileh, pgoff_t pgoffset, pgoff_t pglen)
{
void
*
addr
;
size_t
len
=
pglen
*
fileh
->
ramh
->
ram
->
pagesize
;
int
err
=
0
;
BigFile
*
file
=
fileh
->
file
;
const
bigfile_ops
*
fops
=
file
->
file_ops
;
int
err
=
0
;
sigset_t
save_sigset
;
sigsegv_block
(
&
save_sigset
);
...
...
@@ -241,13 +241,14 @@ int fileh_mmap(VMA *vma, BigFileH *fileh, pgoff_t pgoffset, pgoff_t pglen)
vma
->
mmap_overlay
=
(
fops
->
mmap_setup_read
!=
NULL
);
if
(
vma
->
mmap_overlay
)
{
/* wcfs: mmap(base, READ) + mmap(fileh->dirty_pages) over it */
TODO
(
file
->
blksize
!=
fileh
->
ramh
->
ram
->
pagesize
);
addr
=
fops
->
mmap_setup_read
(
file
,
pgoffset
,
pglen
,
vma
);
if
(
!
addr
)
goto
fail
;
// XXX + mmap(fileh->dirty_pages)
}
else
{
/* allocate address space somewhere */
/*
!wcfs:
allocate address space somewhere */
addr
=
mem_valloc
(
NULL
,
len
);
if
(
!
addr
)
goto
fail
;
...
...
@@ -407,8 +408,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()?
// XXX
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
);
...
...
@@ -452,6 +453,7 @@ void fileh_dirty_discard(BigFileH *fileh)
BUG_ON
(
page
->
state
!=
PAGE_DIRTY
);
page_drop_memory
(
page
);
// XXX wcfs: remmap page(s) to base file
}
BUG_ON
(
!
list_empty
(
&
fileh
->
dirty_pages
));
...
...
@@ -475,6 +477,8 @@ void fileh_invalidate_page(BigFileH *fileh, pgoff_t pgoffset)
/* it's an error to invalidate fileh while writeout is in progress */
BUG_ON
(
fileh
->
writeout_inprogress
);
// XXX wcfs: invalidate_page must not be called (wcfs handles invalidations itself)
// XXX or allow invalidate anyway (e.g. DIRTY -> base) ?
page
=
pagemap_get
(
&
fileh
->
pagemap
,
pgoffset
);
if
(
page
)
{
...
...
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