XINU
Functions
lfibget.c File Reference
#include <xinu.h>
Include dependency graph for lfibget.c:

Go to the source code of this file.

Functions

void lfibget (did32 diskdev, ibid32 inum, struct lfiblk *ibuff)
 

Function Documentation

◆ lfibget()

void lfibget ( did32  diskdev,
ibid32  inum,
struct lfiblk ibuff 
)

Definition at line 10 of file lfibget.c.

References ib2disp, ib2sect, LF_BLKSIZ, and read().

Referenced by lfiballoc(), lfsckfmt(), lfsetup(), and lftruncate().

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 }
#define ib2sect(ib)
Definition: lfilesys.h:86
syscall read(did32, char *, uint32)
Definition: read.c:9
#define LF_BLKSIZ
Definition: lfilesys.h:48
int int32
符号あり32ビット整数(int)
Definition: kernel.h:11
#define ib2disp(ib)
Definition: lfilesys.h:91
Here is the call graph for this function:
Here is the caller graph for this function: