1
0
Files
irix-657m-src/eoe/cmd/efs/lib/efs_iput.c
2022-09-29 17:59:04 +03:00

21 lines
478 B
C

#ident "$Revision: 1.4 $"
/*
* Put an efs inode to the disk.
*/
#include "efs.h"
void
efs_iput(struct efs_dinode *di, efs_ino_t ino)
{
static struct efs_dinode inos[EFS_INOPBB];
lseek(fs_fd, BBTOB(EFS_ITOBB(fs, ino)), SEEK_SET);
if (read(fs_fd, (char *) &inos[0], sizeof(inos)) != sizeof(inos))
error();
inos[ino % EFS_INOPBB] = *di;
lseek(fs_fd, BBTOB(EFS_ITOBB(fs, ino)), SEEK_SET);
if (write(fs_fd, (char *) &inos[0], sizeof(inos)) != sizeof(inos))
error();
}