Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CSEP551
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Krishna Vinnakota
CSEP551
Commits
12abb1a5
Commit
12abb1a5
authored
13 years ago
by
Robert Morris
Browse files
Options
Downloads
Patches
Plain Diff
don't let dirty blocks be evicted from cache!
parent
38eee5bc
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
bio.c
+2
-2
2 additions, 2 deletions
bio.c
file.c
+6
-2
6 additions, 2 deletions
file.c
log.c
+1
-0
1 addition, 0 deletions
log.c
sysfile.c
+6
-0
6 additions, 0 deletions
sysfile.c
with
15 additions
and
4 deletions
bio.c
+
2
−
2
View file @
12abb1a5
...
...
@@ -79,9 +79,9 @@ bget(uint dev, uint sector)
}
}
// Not cached; recycle some
existing
buffer.
// Not cached; recycle some
non-busy and clean
buffer.
for
(
b
=
bcache
.
head
.
prev
;
b
!=
&
bcache
.
head
;
b
=
b
->
prev
){
if
((
b
->
flags
&
B_BUSY
)
==
0
){
if
((
b
->
flags
&
B_BUSY
)
==
0
&&
(
b
->
flags
&
B_DIRTY
)
==
0
){
b
->
dev
=
dev
;
b
->
sector
=
sector
;
b
->
flags
=
B_BUSY
;
...
...
This diff is collapsed.
Click to expand it.
file.c
+
6
−
2
View file @
12abb1a5
//
// File descriptors
//
#include
"types.h"
#include
"defs.h"
#include
"param.h"
...
...
@@ -87,7 +91,7 @@ filestat(struct file *f, struct stat *st)
return
-
1
;
}
// Read from file f.
Addr is kernel address.
// Read from file f.
int
fileread
(
struct
file
*
f
,
char
*
addr
,
int
n
)
{
...
...
@@ -108,7 +112,7 @@ fileread(struct file *f, char *addr, int n)
}
//PAGEBREAK!
// Write to file f.
Addr is kernel address.
// Write to file f.
int
filewrite
(
struct
file
*
f
,
char
*
addr
,
int
n
)
{
...
...
This diff is collapsed.
Click to expand it.
log.c
+
1
−
0
View file @
12abb1a5
...
...
@@ -177,6 +177,7 @@ log_write(struct buf *b)
brelse
(
lbuf
);
if
(
i
==
log
.
lh
.
n
)
log
.
lh
.
n
++
;
b
->
flags
|=
B_DIRTY
;
// XXX prevent eviction
}
//PAGEBREAK!
...
...
This diff is collapsed.
Click to expand it.
sysfile.c
+
6
−
0
View file @
12abb1a5
//
// File-system system calls.
// Mostly argument checking, since we don't trust
// user code, and calls into file.c and fs.c.
//
#include
"types.h"
#include
"defs.h"
#include
"param.h"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment