Deleted Added
full compact
nfs_clvfsops.c (220732) nfs_clvfsops.c (220739)
1/*-
2 * Copyright (c) 1989, 1993, 1995
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Rick Macklem at The University of Guelph.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * from nfs_vfsops.c 8.12 (Berkeley) 5/20/95
33 */
34
35#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1989, 1993, 1995
3 * The Regents of the University of California. All rights reserved.
4 *
5 * This code is derived from software contributed to Berkeley by
6 * Rick Macklem at The University of Guelph.
7 *
8 * Redistribution and use in source and binary forms, with or without

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

28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE.
31 *
32 * from nfs_vfsops.c 8.12 (Berkeley) 5/20/95
33 */
34
35#include <sys/cdefs.h>
36__FBSDID("$FreeBSD: head/sys/fs/nfsclient/nfs_clvfsops.c 220732 2011-04-16 23:20:21Z rmacklem $");
36__FBSDID("$FreeBSD: head/sys/fs/nfsclient/nfs_clvfsops.c 220739 2011-04-17 14:10:12Z rmacklem $");
37
38
39#include "opt_bootp.h"
40#include "opt_nfsroot.h"
41
42#include <sys/param.h>
43#include <sys/systm.h>
44#include <sys/kernel.h>
45#include <sys/bio.h>
46#include <sys/buf.h>
47#include <sys/clock.h>
48#include <sys/jail.h>
37
38
39#include "opt_bootp.h"
40#include "opt_nfsroot.h"
41
42#include <sys/param.h>
43#include <sys/systm.h>
44#include <sys/kernel.h>
45#include <sys/bio.h>
46#include <sys/buf.h>
47#include <sys/clock.h>
48#include <sys/jail.h>
49#include <sys/limits.h>
49#include <sys/lock.h>
50#include <sys/malloc.h>
51#include <sys/mbuf.h>
52#include <sys/module.h>
53#include <sys/mount.h>
54#include <sys/proc.h>
55#include <sys/socket.h>
56#include <sys/socketvar.h>

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

553 /*
554 * Silently clear NFSMNT_NOCONN if it's a TCP mount, it makes
555 * no sense in that context. Also, set up appropriate retransmit
556 * and soft timeout behavior.
557 */
558 if (argp->sotype == SOCK_STREAM) {
559 nmp->nm_flag &= ~NFSMNT_NOCONN;
560 nmp->nm_timeo = NFS_MAXTIMEO;
50#include <sys/lock.h>
51#include <sys/malloc.h>
52#include <sys/mbuf.h>
53#include <sys/module.h>
54#include <sys/mount.h>
55#include <sys/proc.h>
56#include <sys/socket.h>
57#include <sys/socketvar.h>

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

554 /*
555 * Silently clear NFSMNT_NOCONN if it's a TCP mount, it makes
556 * no sense in that context. Also, set up appropriate retransmit
557 * and soft timeout behavior.
558 */
559 if (argp->sotype == SOCK_STREAM) {
560 nmp->nm_flag &= ~NFSMNT_NOCONN;
561 nmp->nm_timeo = NFS_MAXTIMEO;
562 if ((argp->flags & NFSMNT_NFSV4) != 0)
563 nmp->nm_retry = INT_MAX;
564 else
565 nmp->nm_retry = NFS_RETRANS_TCP;
561 }
562
566 }
567
563 /* Also clear RDIRPLUS if not NFSv3, it crashes some servers */
564 if ((argp->flags & NFSMNT_NFSV3) == 0)
568 /* Also clear RDIRPLUS if NFSv2, it crashes some servers */
569 if ((argp->flags & (NFSMNT_NFSV3 | NFSMNT_NFSV4)) == 0) {
570 argp->flags &= ~NFSMNT_RDIRPLUS;
565 nmp->nm_flag &= ~NFSMNT_RDIRPLUS;
571 nmp->nm_flag &= ~NFSMNT_RDIRPLUS;
572 }
566
573
574 /* Clear NFSMNT_RESVPORT for NFSv4, since it is not required. */
575 if ((argp->flags & NFSMNT_NFSV4) != 0) {
576 argp->flags &= ~NFSMNT_RESVPORT;
577 nmp->nm_flag &= ~NFSMNT_RESVPORT;
578 }
579
580 /* Re-bind if rsrvd port requested and wasn't on one */
581 adjsock = !(nmp->nm_flag & NFSMNT_RESVPORT)
582 && (argp->flags & NFSMNT_RESVPORT);
567 /* Also re-bind if we're switching to/from a connected UDP socket */
583 /* Also re-bind if we're switching to/from a connected UDP socket */
568 adjsock = ((nmp->nm_flag & NFSMNT_NOCONN) !=
584 adjsock |= ((nmp->nm_flag & NFSMNT_NOCONN) !=
569 (argp->flags & NFSMNT_NOCONN));
570
571 /* Update flags atomically. Don't change the lock bits. */
572 nmp->nm_flag = argp->flags | nmp->nm_flag;
573 splx(s);
574
575 if ((argp->flags & NFSMNT_TIMEO) && argp->timeo > 0) {
576 nmp->nm_timeo = (argp->timeo * NFS_HZ + 5) / 10;

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

705 struct nfs_args args = {
706 .version = NFS_ARGSVERSION,
707 .addr = NULL,
708 .addrlen = sizeof (struct sockaddr_in),
709 .sotype = SOCK_STREAM,
710 .proto = 0,
711 .fh = NULL,
712 .fhsize = 0,
585 (argp->flags & NFSMNT_NOCONN));
586
587 /* Update flags atomically. Don't change the lock bits. */
588 nmp->nm_flag = argp->flags | nmp->nm_flag;
589 splx(s);
590
591 if ((argp->flags & NFSMNT_TIMEO) && argp->timeo > 0) {
592 nmp->nm_timeo = (argp->timeo * NFS_HZ + 5) / 10;

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

721 struct nfs_args args = {
722 .version = NFS_ARGSVERSION,
723 .addr = NULL,
724 .addrlen = sizeof (struct sockaddr_in),
725 .sotype = SOCK_STREAM,
726 .proto = 0,
727 .fh = NULL,
728 .fhsize = 0,
713 .flags = 0,
729 .flags = NFSMNT_RESVPORT,
714 .wsize = NFS_WSIZE,
715 .rsize = NFS_RSIZE,
716 .readdirsize = NFS_READDIRSIZE,
717 .timeo = 10,
718 .retrans = NFS_RETRANS,
719 .readahead = NFS_DEFRAHEAD,
720 .wcommitsize = 0, /* was: NQ_DEFLEASE */
721 .hostname = NULL,

--- 776 unchanged lines hidden ---
730 .wsize = NFS_WSIZE,
731 .rsize = NFS_RSIZE,
732 .readdirsize = NFS_READDIRSIZE,
733 .timeo = 10,
734 .retrans = NFS_RETRANS,
735 .readahead = NFS_DEFRAHEAD,
736 .wcommitsize = 0, /* was: NQ_DEFLEASE */
737 .hostname = NULL,

--- 776 unchanged lines hidden ---