XINU
device
lfs
lfibget.c
Go to the documentation of this file.
1
/* lfibget.c - lfibget */
2
3
#include <
xinu.h
>
4
5
/*------------------------------------------------------------------------
6
* lfibget - Get an index block from disk given its number (assumes
7
* mutex is held)
8
*------------------------------------------------------------------------
9
*/
10
void
lfibget
(
11
did32
diskdev,
/* Device ID of disk to use */
12
ibid32
inum,
/* ID of index block to fetch */
13
struct
lfiblk
*ibuff
/* Buffer to hold index block */
14
)
15
{
16
char
*from, *to;
/* Pointers used in copying */
17
int32
i;
/* Loop index used during copy */
18
char
dbuff[
LF_BLKSIZ
];
/* Buffer to hold disk block */
19
20
/* Read disk block that contains the specified index block */
21
22
read
(diskdev, dbuff,
ib2sect
(inum));
23
24
/* Copy specified index block to caller's ibuff */
25
26
from = dbuff +
ib2disp
(inum);
27
to = (
char
*)ibuff;
28
for
(i=0 ; i<
sizeof
(
struct
lfiblk
) ; i++)
29
*to++ = *from++;
30
return
;
31
}
ib2sect
#define ib2sect(ib)
Definition:
lfilesys.h:86
ibid32
int32 ibid32
ブロックIDのインデックス(ファイルシステムで使用する)
Definition:
kernel.h:40
lfibget
void lfibget(did32 diskdev, ibid32 inum, struct lfiblk *ibuff)
Definition:
lfibget.c:10
xinu.h
全てのシステムヘッダファイルをインクルードする。
read
syscall read(did32, char *, uint32)
Definition:
read.c:9
lfiblk
Definition:
lfilesys.h:71
LF_BLKSIZ
#define LF_BLKSIZ
Definition:
lfilesys.h:48
int32
int int32
符号あり32ビット整数(int)
Definition:
kernel.h:11
did32
int32 did32
デバイスID
Definition:
kernel.h:28
ib2disp
#define ib2disp(ib)
Definition:
lfilesys.h:91
Generated by
1.8.13