Deleted Added
full compact
nfs.c (329145) nfs.c (332138)
1/* $NetBSD: nfs.c,v 1.2 1998/01/24 12:43:09 drochner Exp $ */
2
3/*-
4 * Copyright (c) 1993 John Brezak
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 15 unchanged lines hidden (view full) ---

24 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
27 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 * POSSIBILITY OF SUCH DAMAGE.
29 */
30
31#include <sys/cdefs.h>
1/* $NetBSD: nfs.c,v 1.2 1998/01/24 12:43:09 drochner Exp $ */
2
3/*-
4 * Copyright (c) 1993 John Brezak
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 15 unchanged lines hidden (view full) ---

24 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
27 * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28 * POSSIBILITY OF SUCH DAMAGE.
29 */
30
31#include <sys/cdefs.h>
32__FBSDID("$FreeBSD: stable/11/stand/libsa/nfs.c 329132 2018-02-11 19:51:29Z kevans $");
32__FBSDID("$FreeBSD: stable/11/stand/libsa/nfs.c 332138 2018-04-06 19:21:36Z kevans $");
33
34#include <sys/param.h>
35#include <sys/time.h>
36#include <sys/socket.h>
37#include <sys/stat.h>
38#include <string.h>
39#include <stddef.h>
40

--- 80 unchanged lines hidden (view full) ---

121
122/*
123 * XXX interactions with tftp? See nfswrapper.c for a confusing
124 * issue.
125 */
126int nfs_open(const char *path, struct open_file *f);
127static int nfs_close(struct open_file *f);
128static int nfs_read(struct open_file *f, void *buf, size_t size, size_t *resid);
33
34#include <sys/param.h>
35#include <sys/time.h>
36#include <sys/socket.h>
37#include <sys/stat.h>
38#include <string.h>
39#include <stddef.h>
40

--- 80 unchanged lines hidden (view full) ---

121
122/*
123 * XXX interactions with tftp? See nfswrapper.c for a confusing
124 * issue.
125 */
126int nfs_open(const char *path, struct open_file *f);
127static int nfs_close(struct open_file *f);
128static int nfs_read(struct open_file *f, void *buf, size_t size, size_t *resid);
129static int nfs_write(struct open_file *f, void *buf, size_t size, size_t *resid);
130static off_t nfs_seek(struct open_file *f, off_t offset, int where);
131static int nfs_stat(struct open_file *f, struct stat *sb);
132static int nfs_readdir(struct open_file *f, struct dirent *d);
133
134struct nfs_iodesc nfs_root_node;
135
136struct fs_ops nfs_fsops = {
137 "nfs",
138 nfs_open,
139 nfs_close,
140 nfs_read,
129static off_t nfs_seek(struct open_file *f, off_t offset, int where);
130static int nfs_stat(struct open_file *f, struct stat *sb);
131static int nfs_readdir(struct open_file *f, struct dirent *d);
132
133struct nfs_iodesc nfs_root_node;
134
135struct fs_ops nfs_fsops = {
136 "nfs",
137 nfs_open,
138 nfs_close,
139 nfs_read,
141 nfs_write,
140 null_write,
142 nfs_seek,
143 nfs_stat,
144 nfs_readdir
145};
146
147static int nfs_read_size = NFSREAD_MIN_SIZE;
148
149/*

--- 560 unchanged lines hidden (view full) ---

710 }
711ret:
712 if (resid)
713 *resid = size;
714
715 return (0);
716}
717
141 nfs_seek,
142 nfs_stat,
143 nfs_readdir
144};
145
146static int nfs_read_size = NFSREAD_MIN_SIZE;
147
148/*

--- 560 unchanged lines hidden (view full) ---

709 }
710ret:
711 if (resid)
712 *resid = size;
713
714 return (0);
715}
716
718/*
719 * Not implemented.
720 */
721int
722nfs_write(struct open_file *f, void *buf, size_t size, size_t *resid)
723{
724 return (EROFS);
725}
726
727off_t
728nfs_seek(struct open_file *f, off_t offset, int where)
729{
730 struct nfs_iodesc *d = (struct nfs_iodesc *)f->f_fsdata;
731 uint32_t size = ntohl(d->fa.fa_size.val[1]);
732
733 switch (where) {
734 case SEEK_SET:

--- 126 unchanged lines hidden ---
717off_t
718nfs_seek(struct open_file *f, off_t offset, int where)
719{
720 struct nfs_iodesc *d = (struct nfs_iodesc *)f->f_fsdata;
721 uint32_t size = ntohl(d->fa.fa_size.val[1]);
722
723 switch (where) {
724 case SEEK_SET:

--- 126 unchanged lines hidden ---