Changeset View
Changeset View
Standalone View
Standalone View
head/stand/libsa/nfs.c
Show First 20 Lines • Show All 120 Lines • ▼ Show 20 Lines | |||||
/* | /* | ||||
* XXX interactions with tftp? See nfswrapper.c for a confusing | * XXX interactions with tftp? See nfswrapper.c for a confusing | ||||
* issue. | * issue. | ||||
*/ | */ | ||||
int nfs_open(const char *path, struct open_file *f); | int nfs_open(const char *path, struct open_file *f); | ||||
static int nfs_close(struct open_file *f); | static int nfs_close(struct open_file *f); | ||||
static int nfs_read(struct open_file *f, void *buf, size_t size, size_t *resid); | static int nfs_read(struct open_file *f, void *buf, size_t size, size_t *resid); | ||||
static int nfs_write(struct open_file *f, void *buf, size_t size, size_t *resid); | |||||
static off_t nfs_seek(struct open_file *f, off_t offset, int where); | static off_t nfs_seek(struct open_file *f, off_t offset, int where); | ||||
static int nfs_stat(struct open_file *f, struct stat *sb); | static int nfs_stat(struct open_file *f, struct stat *sb); | ||||
static int nfs_readdir(struct open_file *f, struct dirent *d); | static int nfs_readdir(struct open_file *f, struct dirent *d); | ||||
struct nfs_iodesc nfs_root_node; | struct nfs_iodesc nfs_root_node; | ||||
struct fs_ops nfs_fsops = { | struct fs_ops nfs_fsops = { | ||||
"nfs", | "nfs", | ||||
nfs_open, | nfs_open, | ||||
nfs_close, | nfs_close, | ||||
nfs_read, | nfs_read, | ||||
nfs_write, | null_write, | ||||
nfs_seek, | nfs_seek, | ||||
nfs_stat, | nfs_stat, | ||||
nfs_readdir | nfs_readdir | ||||
}; | }; | ||||
static int nfs_read_size = NFSREAD_MIN_SIZE; | static int nfs_read_size = NFSREAD_MIN_SIZE; | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 558 Lines • ▼ Show 20 Lines | #endif | ||||
addr += cc; | addr += cc; | ||||
size -= cc; | size -= cc; | ||||
} | } | ||||
ret: | ret: | ||||
if (resid) | if (resid) | ||||
*resid = size; | *resid = size; | ||||
return (0); | return (0); | ||||
} | |||||
/* | |||||
* Not implemented. | |||||
*/ | |||||
int | |||||
nfs_write(struct open_file *f, void *buf, size_t size, size_t *resid) | |||||
{ | |||||
return (EROFS); | |||||
} | } | ||||
off_t | off_t | ||||
nfs_seek(struct open_file *f, off_t offset, int where) | nfs_seek(struct open_file *f, off_t offset, int where) | ||||
{ | { | ||||
struct nfs_iodesc *d = (struct nfs_iodesc *)f->f_fsdata; | struct nfs_iodesc *d = (struct nfs_iodesc *)f->f_fsdata; | ||||
uint32_t size = ntohl(d->fa.fa_size.val[1]); | uint32_t size = ntohl(d->fa.fa_size.val[1]); | ||||
▲ Show 20 Lines • Show All 128 Lines • Show Last 20 Lines |