Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CSEP551
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
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
bcfb84b6
Commit
bcfb84b6
authored
18 years ago
by
rtm
Browse files
Options
Downloads
Patches
Plain Diff
big directory test
parent
1be76685
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
Notes
+10
-1
10 additions, 1 deletion
Notes
fs.c
+4
-1
4 additions, 1 deletion
fs.c
fstests.c
+45
-0
45 additions, 0 deletions
fstests.c
with
59 additions
and
2 deletions
Notes
+
10
−
1
View file @
bcfb84b6
...
...
@@ -115,6 +115,11 @@ why does shell often ignore first line of input?
test: one process unlinks a file while another links to it
test: one process opens a file while another deletes it
test: mkdir. deadlock d/.. vs ../d
test: sub-sub directories. mkdir("d1/d2")
test: dup() shared fd->off
test: indirect blocks. files and directories.
test: sbrk
test: does echo foo > x truncate x?
make proc[0] runnable
cpu early tss and gdt
...
...
@@ -138,4 +143,8 @@ are the locks in the right place in keyboardintr?
sh: support pipes? leave it for the class?
sh: dynamic memory allocation?
sh: should sh support ; () & --- need malloc
sh: stop stdin on ctrl-d (for cat > y)
\ No newline at end of file
sh: stop stdin on ctrl-d (for cat > y)
really should have bdwrite() for file content
and make some inode updates async
so soft updates make sense
This diff is collapsed.
Click to expand it.
fs.c
+
4
−
1
View file @
bcfb84b6
...
...
@@ -262,8 +262,8 @@ iunlink(struct inode *ip)
if
(
ip
->
addrs
[
i
]
!=
0
)
{
if
(
i
==
INDIRECT
)
{
inbp
=
bread
(
ip
->
dev
,
ip
->
addrs
[
INDIRECT
]);
uint
*
a
=
(
uint
*
)
inbp
->
data
;
for
(
j
=
0
;
j
<
NINDIRECT
;
j
++
)
{
uint
*
a
=
(
uint
*
)
inbp
->
data
;
if
(
a
[
j
]
!=
0
)
{
bfree
(
ip
->
dev
,
a
[
j
]);
a
[
j
]
=
0
;
...
...
@@ -589,6 +589,9 @@ unlink(char *cp)
ip
=
iget
(
dev
,
inum
);
if
(
ip
->
nlink
<
1
)
panic
(
"unlink nlink < 1"
);
ip
->
nlink
--
;
iupdate
(
ip
);
...
...
This diff is collapsed.
Click to expand it.
fstests.c
+
45
−
0
View file @
bcfb84b6
...
...
@@ -365,11 +365,56 @@ concreate()
puts
(
"concreate ok
\n
"
);
}
// directory that uses indirect blocks
void
bigdir
()
{
int
i
,
fd
;
char
name
[
10
];
unlink
(
"bd"
);
fd
=
open
(
"bd"
,
O_CREATE
);
if
(
fd
<
0
){
puts
(
"bigdir create failed
\n
"
);
exit
();
}
close
(
fd
);
for
(
i
=
0
;
i
<
500
;
i
++
){
name
[
0
]
=
'x'
;
name
[
1
]
=
'0'
+
(
i
/
64
);
name
[
2
]
=
'0'
+
(
i
%
64
);
name
[
3
]
=
'\0'
;
if
(
link
(
"bd"
,
name
)
!=
0
){
puts
(
"bigdir link failed
\n
"
);
exit
();
}
puts
(
"c"
);
}
unlink
(
"bd"
);
for
(
i
=
0
;
i
<
500
;
i
++
){
name
[
0
]
=
'x'
;
name
[
1
]
=
'0'
+
(
i
/
64
);
name
[
2
]
=
'0'
+
(
i
%
64
);
name
[
3
]
=
'\0'
;
if
(
unlink
(
name
)
!=
0
){
puts
(
"bigdir unlink failed"
);
exit
();
}
puts
(
"d"
);
}
puts
(
"bigdir ok
\n
"
);
}
int
main
(
int
argc
,
char
*
argv
[])
{
puts
(
"fstests starting
\n
"
);
bigdir
();
concreate
();
linktest
();
unlinkread
();
...
...
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