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
e5e027cd
Commit
e5e027cd
authored
Oct 21, 2019
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
2d2bc897
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
27 additions
and
4 deletions
+27
-4
3rdparty/ccan
3rdparty/ccan
+1
-1
bigfile/virtmem.c
bigfile/virtmem.c
+18
-0
include/wendelin/bigfile/virtmem.h
include/wendelin/bigfile/virtmem.h
+2
-0
wcfs/internal/wcfs_virtmem.cpp
wcfs/internal/wcfs_virtmem.cpp
+6
-3
No files found.
ccan
@
7aac849a
Subproject commit
ce4660aa49404530a608a37754fae16fbb3fde02
Subproject commit
7aac849abf06ef469c2aad9a0dd6e3bb82ef1f96
bigfile/virtmem.c
View file @
e5e027cd
...
@@ -30,6 +30,7 @@
...
@@ -30,6 +30,7 @@
#include <wendelin/bug.h>
#include <wendelin/bug.h>
#include <ccan/minmax/minmax.h>
#include <ccan/minmax/minmax.h>
#include <ccan/bitmap/bitmap.h>
#include <sys/mman.h>
#include <sys/mman.h>
#include <errno.h>
#include <errno.h>
...
@@ -1153,6 +1154,23 @@ static void vma_page_ensure_notmappedrw(VMA *vma, Page *page)
...
@@ -1153,6 +1154,23 @@ static void vma_page_ensure_notmappedrw(VMA *vma, Page *page)
xmprotect
(
vma_page_addr
(
vma
,
page
),
page_size
(
page
),
PROT_READ
);
xmprotect
(
vma_page_addr
(
vma
,
page
),
page_size
(
page
),
PROT_READ
);
}
}
/* return whether fileh page is dirty or not.
*
* must be called under virtmem lock.
*/
bool
__fileh_page_isdirty
(
BigFileH
*
fileh
,
pgoff_t
pgoffset
)
{
Page
*
page
;
// XXX sigsegv_block ?
page
=
pagemap_get
(
&
fileh
->
pagemap
,
pgoffset
);
if
(
!
page
)
return
false
;
return
(
page
->
state
==
PAGE_DIRTY
);
}
// XXX stub
// XXX stub
void
OOM
(
void
)
void
OOM
(
void
)
...
...
include/wendelin/bigfile/virtmem.h
View file @
e5e027cd
...
@@ -34,6 +34,7 @@
...
@@ -34,6 +34,7 @@
*/
*/
#include <stdint.h>
#include <stdint.h>
#include <stdbool.h>
#include <wendelin/list.h>
#include <wendelin/list.h>
#include <wendelin/bigfile/types.h>
#include <wendelin/bigfile/types.h>
#include <wendelin/bigfile/pagemap.h>
#include <wendelin/bigfile/pagemap.h>
...
@@ -360,6 +361,7 @@ typedef struct VirtGilHooks VirtGilHooks;
...
@@ -360,6 +361,7 @@ typedef struct VirtGilHooks VirtGilHooks;
void
virt_lock_hookgil
(
const
VirtGilHooks
*
gilhooks
);
void
virt_lock_hookgil
(
const
VirtGilHooks
*
gilhooks
);
bool
__fileh_page_isdirty
(
BigFileH
*
fileh
,
pgoff_t
pgoff
);
// XXX is this needed? think more
// XXX is this needed? think more
/* what happens on out-of-memory */
/* what happens on out-of-memory */
...
...
wcfs/internal/wcfs_virtmem.cpp
View file @
e5e027cd
...
@@ -98,6 +98,8 @@ struct _File {
...
@@ -98,6 +98,8 @@ struct _File {
struct
_Mapping
{
struct
_Mapping
{
_File
*
file
;
_File
*
file
;
int
blk_start
;
// offset of this mapping in file
int
blk_start
;
// offset of this mapping in file
BigFileH
*
fileh
;
// mmapped under this file handle
uint8_t
*
mem_start
;
// mmapped memory [mem_start, mem_stop)
uint8_t
*
mem_start
;
// mmapped memory [mem_start, mem_stop)
uint8_t
*
mem_stop
;
uint8_t
*
mem_stop
;
...
@@ -190,7 +192,8 @@ void Conn::_pin1(SrvReq *req) {
...
@@ -190,7 +192,8 @@ void Conn::_pin1(SrvReq *req) {
//trace("\tremmapblk %d @%s" % (req->blk, (h(req.at) if req.at else "head")))
//trace("\tremmapblk %d @%s" % (req->blk, (h(req.at) if req.at else "head")))
// check if virtmem did not dirtied page corresponding to this block already
// check if virtmem did not dirtied page corresponding to this block already
virt_lock
();
virt_lock
();
if
(
!
fileh_blk_isdirty
(
mmap
->
fileh
,
req
->
blk
))
TODO
(
mmap
->
file
->
blksize
!=
mmap
->
filh
->
ramh
->
pagesize
);
if
(
!
__fileh_page_isdirty
(
mmap
->
fileh
,
req
->
blk
))
mmap
->
_remmapblk
(
req
.
blk
,
req
.
at
);
mmap
->
_remmapblk
(
req
.
blk
,
req
.
at
);
virt_unlock
();
virt_unlock
();
//trace("\t-> remmaped"); XXX
//trace("\t-> remmaped"); XXX
...
...
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