Deleted Added
full compact
nfs_clvnops.c (222540) nfs_clvnops.c (222719)
1/*-
2 * Copyright (c) 1989, 1993
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_vnops.c 8.16 (Berkeley) 5/27/95
33 */
34
35#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1989, 1993
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_vnops.c 8.16 (Berkeley) 5/27/95
33 */
34
35#include <sys/cdefs.h>
36__FBSDID("$FreeBSD: head/sys/fs/nfsclient/nfs_clvnops.c 222540 2011-05-31 17:43:25Z rmacklem $");
36__FBSDID("$FreeBSD: head/sys/fs/nfsclient/nfs_clvnops.c 222719 2011-06-05 18:17:37Z rmacklem $");
37
38/*
39 * vnode op calls for Sun NFS version 2, 3 and 4
40 */
41
42#include "opt_inet.h"
43
44#include <sys/param.h>

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

2893 }
2894
2895 /*
2896 * If this is unlocking a write locked region, flush and
2897 * commit them before unlocking. This is required by
2898 * RFC3530 Sec. 9.3.2.
2899 */
2900 if (ap->a_op == F_UNLCK &&
37
38/*
39 * vnode op calls for Sun NFS version 2, 3 and 4
40 */
41
42#include "opt_inet.h"
43
44#include <sys/param.h>

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

2893 }
2894
2895 /*
2896 * If this is unlocking a write locked region, flush and
2897 * commit them before unlocking. This is required by
2898 * RFC3530 Sec. 9.3.2.
2899 */
2900 if (ap->a_op == F_UNLCK &&
2901 nfscl_checkwritelocked(vp, ap->a_fl, cred, td))
2901 nfscl_checkwritelocked(vp, ap->a_fl, cred, td, ap->a_id,
2902 ap->a_flags))
2902 (void) ncl_flush(vp, MNT_WAIT, cred, td, 1, 0);
2903
2904 /*
2905 * Loop around doing the lock op, while a blocking lock
2906 * must wait for the lock op to succeed.
2907 */
2908 do {
2909 ret = nfsrpc_advlock(vp, np->n_size, ap->a_op,
2903 (void) ncl_flush(vp, MNT_WAIT, cred, td, 1, 0);
2904
2905 /*
2906 * Loop around doing the lock op, while a blocking lock
2907 * must wait for the lock op to succeed.
2908 */
2909 do {
2910 ret = nfsrpc_advlock(vp, np->n_size, ap->a_op,
2910 ap->a_fl, 0, cred, td);
2911 ap->a_fl, 0, cred, td, ap->a_id, ap->a_flags);
2911 if (ret == NFSERR_DENIED && (ap->a_flags & F_WAIT) &&
2912 ap->a_op == F_SETLK) {
2913 VOP_UNLOCK(vp, 0);
2914 error = nfs_catnap(PZERO | PCATCH, ret,
2915 "ncladvl");
2916 if (error)
2917 return (EINTR);
2918 vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);

--- 485 unchanged lines hidden ---
2912 if (ret == NFSERR_DENIED && (ap->a_flags & F_WAIT) &&
2913 ap->a_op == F_SETLK) {
2914 VOP_UNLOCK(vp, 0);
2915 error = nfs_catnap(PZERO | PCATCH, ret,
2916 "ncladvl");
2917 if (error)
2918 return (EINTR);
2919 vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);

--- 485 unchanged lines hidden ---