Deleted Added
full compact
nfs_subs.c (176224) nfs_subs.c (176559)
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 * @(#)nfs_subs.c 8.8 (Berkeley) 5/22/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 * @(#)nfs_subs.c 8.8 (Berkeley) 5/22/95
33 */
34
35#include <sys/cdefs.h>
36__FBSDID("$FreeBSD: head/sys/nfsclient/nfs_subs.c 176224 2008-02-13 00:04:58Z jhb $");
36__FBSDID("$FreeBSD: head/sys/nfsclient/nfs_subs.c 176559 2008-02-25 18:45:57Z attilio $");
37
38/*
39 * These functions support the macros and help fiddle mbuf chains for
40 * the nfs op functions. They do things like create the rpc header and
41 * copy data between mbuf chains and uio lists.
42 */
43
44#include <sys/param.h>

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

488 mtx_unlock(&np->n_mtx);
489}
490
491int
492nfs_upgrade_vnlock(struct vnode *vp)
493{
494 int old_lock;
495
37
38/*
39 * These functions support the macros and help fiddle mbuf chains for
40 * the nfs op functions. They do things like create the rpc header and
41 * copy data between mbuf chains and uio lists.
42 */
43
44#include <sys/param.h>

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

488 mtx_unlock(&np->n_mtx);
489}
490
491int
492nfs_upgrade_vnlock(struct vnode *vp)
493{
494 int old_lock;
495
496 if ((old_lock = VOP_ISLOCKED(vp, curthread)) != LK_EXCLUSIVE) {
496 if ((old_lock = VOP_ISLOCKED(vp)) != LK_EXCLUSIVE) {
497 if (old_lock == LK_SHARED) {
498 /* Upgrade to exclusive lock, this might block */
499 vn_lock(vp, LK_UPGRADE | LK_RETRY);
500 } else {
501 vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
502 }
503 }
504 return old_lock;

--- 692 unchanged lines hidden ---
497 if (old_lock == LK_SHARED) {
498 /* Upgrade to exclusive lock, this might block */
499 vn_lock(vp, LK_UPGRADE | LK_RETRY);
500 } else {
501 vn_lock(vp, LK_EXCLUSIVE | LK_RETRY);
502 }
503 }
504 return old_lock;

--- 692 unchanged lines hidden ---