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
e4bcd2a3
Commit
e4bcd2a3
authored
18 years ago
by
rtm
Browse files
Options
Downloads
Patches
Plain Diff
wdir now uses readi/writei
parent
17e3cf15
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
fs.c
+13
-32
13 additions, 32 deletions
fs.c
picirq.c
+0
-1
0 additions, 1 deletion
picirq.c
with
13 additions
and
33 deletions
fs.c
+
13
−
32
View file @
e4bcd2a3
...
...
@@ -450,43 +450,24 @@ void
wdir
(
struct
inode
*
dp
,
char
*
name
,
uint
ino
)
{
uint
off
;
struct
buf
*
bp
=
0
;
struct
dirent
*
ep
=
0
;
struct
dirent
de
;
int
i
;
int
lb
;
if
(
dp
->
size
%
BSIZE
)
dp
->
size
+=
(
BSIZE
-
dp
->
size
%
BSIZE
);
for
(
off
=
0
;
off
<
dp
->
size
;
off
+=
BSIZE
)
{
bp
=
bread
(
dp
->
dev
,
bmap
(
dp
,
off
/
BSIZE
));
for
(
ep
=
(
struct
dirent
*
)
bp
->
data
;
ep
<
(
struct
dirent
*
)
(
bp
->
data
+
BSIZE
);
ep
++
){
if
(
ep
->
inum
==
0
)
goto
found
;
}
brelse
(
bp
);
}
lb
=
dp
->
size
/
BSIZE
;
if
(
lb
>=
NDIRECT
)
{
panic
(
"wdir: too many entries"
);
for
(
off
=
0
;
off
<
dp
->
size
;
off
+=
sizeof
(
de
)){
if
(
readi
(
dp
,
(
char
*
)
&
de
,
off
,
sizeof
(
de
))
!=
sizeof
(
de
))
panic
(
"wdir read"
);
if
(
de
.
inum
==
0
)
break
;
}
dp
->
addrs
[
lb
]
=
balloc
(
dp
->
dev
);
bp
=
bread
(
dp
->
dev
,
dp
->
addrs
[
lb
]);
memset
(
bp
->
data
,
0
,
BSIZE
);
ep
=
(
struct
dirent
*
)
(
bp
->
data
);
dp
->
size
+=
BSIZE
;
found:
ep
->
inum
=
ino
;
de
.
inum
=
ino
;
for
(
i
=
0
;
i
<
DIRSIZ
&&
name
[
i
];
i
++
)
ep
->
name
[
i
]
=
name
[
i
];
de
.
name
[
i
]
=
name
[
i
];
for
(
;
i
<
DIRSIZ
;
i
++
)
ep
->
name
[
i
]
=
'\0'
;
bwrite
(
bp
,
bmap
(
dp
,
off
/
BSIZE
));
// write directory block
brelse
(
bp
);
iupdate
(
dp
);
de
.
name
[
i
]
=
'\0'
;
if
(
writei
(
dp
,
(
char
*
)
&
de
,
off
,
sizeof
(
de
))
!=
sizeof
(
de
))
panic
(
"wdir write"
);
}
struct
inode
*
...
...
This diff is collapsed.
Click to expand it.
picirq.c
+
0
−
1
View file @
e4bcd2a3
...
...
@@ -17,7 +17,6 @@ static ushort irq_mask_8259A = 0xFFFF & ~(1<<IRQ_SLAVE);
static
void
irq_setmask_8259A
(
ushort
mask
)
{
int
i
;
irq_mask_8259A
=
mask
;
outb
(
IO_PIC1
+
1
,
(
char
)
mask
);
...
...
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