Changeset View
Changeset View
Standalone View
Standalone View
head/usr.sbin/makefs/ffs/buf.h
/* $NetBSD: buf.h,v 1.2 2001/11/02 03:12:49 lukem Exp $ */ | /* $NetBSD: buf.h,v 1.3 2001/11/02 03:12:49 lukem Exp $ */ | ||||
/* | /* | ||||
* Copyright (c) 2001 Wasabi Systems, Inc. | * Copyright (c) 2001 Wasabi Systems, Inc. | ||||
* All rights reserved. | * All rights reserved. | ||||
* | * | ||||
* Written by Luke Mewburn for Wasabi Systems, Inc. | * Written by Luke Mewburn for Wasabi Systems, Inc. | ||||
* | * | ||||
* Redistribution and use in source and binary forms, with or without | * Redistribution and use in source and binary forms, with or without | ||||
Show All 28 Lines | |||||
*/ | */ | ||||
#ifndef _FFS_BUF_H | #ifndef _FFS_BUF_H | ||||
#define _FFS_BUF_H | #define _FFS_BUF_H | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#include <sys/queue.h> | #include <sys/queue.h> | ||||
struct ucred; | |||||
struct vnode { | |||||
int fd; | |||||
void *fs; | |||||
void *v_data; | |||||
int offset; | |||||
}; | |||||
struct buf { | struct buf { | ||||
void * b_data; | void * b_data; | ||||
long b_bufsize; | long b_bufsize; | ||||
long b_bcount; | long b_bcount; | ||||
daddr_t b_blkno; | daddr_t b_blkno; | ||||
daddr_t b_lblkno; | daddr_t b_lblkno; | ||||
int b_fd; | int b_fd; | ||||
struct fs * b_fs; | struct fs * b_fs; | ||||
TAILQ_ENTRY(buf) b_tailq; | TAILQ_ENTRY(buf) b_tailq; | ||||
}; | }; | ||||
void bcleanup(void); | void bcleanup(void); | ||||
int bread(int, struct fs *, daddr_t, int, struct buf **); | int bread(struct vnode *, daddr_t, int, struct ucred *, | ||||
void brelse(struct buf *); | struct buf **); | ||||
void brelse(struct buf *, int); | |||||
int bwrite(struct buf *); | int bwrite(struct buf *); | ||||
struct buf * getblk(int, struct fs *, daddr_t, int); | struct buf * getblk(struct vnode *, daddr_t, int, int, int, int); | ||||
#define bdwrite(bp) bwrite(bp) | #define bdwrite(bp) bwrite(bp) | ||||
#define clrbuf(bp) memset((bp)->b_data, 0, (u_int)(bp)->b_bcount) | #define clrbuf(bp) memset((bp)->b_data, 0, (u_int)(bp)->b_bcount) | ||||
#endif /* _FFS_BUF_H */ | #endif /* _FFS_BUF_H */ |