nfs_commonsubs.c (200069) | nfs_commonsubs.c (205941) |
---|---|
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 --- 18 unchanged lines hidden (view full) --- 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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 */ 33 34#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 --- 18 unchanged lines hidden (view full) --- 27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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 */ 33 34#include <sys/cdefs.h> |
35__FBSDID("$FreeBSD: head/sys/fs/nfs/nfs_commonsubs.c 200069 2009-12-03 18:03:42Z trasz $"); | 35__FBSDID("$FreeBSD: head/sys/fs/nfs/nfs_commonsubs.c 205941 2010-03-30 23:11:50Z rmacklem $"); |
36 37/* 38 * These functions support the macros and help fiddle mbuf chains for 39 * the nfs op functions. They do things like create the rpc header and 40 * copy data between mbuf chains and uio lists. 41 */ 42#ifndef APPLEKEXT 43#include <fs/nfs/nfsport.h> --- 1775 unchanged lines hidden (view full) --- 1819 (void) nfsmsleep(&lp->nfslock_lock, mutex, 1820 PZERO - 1, "nfsv4lck", NULL); 1821 } 1822 1823 lp->nfslock_usecnt++; 1824} 1825 1826/* | 36 37/* 38 * These functions support the macros and help fiddle mbuf chains for 39 * the nfs op functions. They do things like create the rpc header and 40 * copy data between mbuf chains and uio lists. 41 */ 42#ifndef APPLEKEXT 43#include <fs/nfs/nfsport.h> --- 1775 unchanged lines hidden (view full) --- 1819 (void) nfsmsleep(&lp->nfslock_lock, mutex, 1820 PZERO - 1, "nfsv4lck", NULL); 1821 } 1822 1823 lp->nfslock_usecnt++; 1824} 1825 1826/* |
1827 * Test for a lock. Return 1 if locked, 0 otherwise. 1828 */ 1829APPLESTATIC int 1830nfsv4_testlock(struct nfsv4lock *lp) 1831{ 1832 1833 if ((lp->nfslock_lock & NFSV4LOCK_LOCK) == 0 && 1834 lp->nfslock_usecnt == 0) 1835 return (0); 1836 return (1); 1837} 1838 1839/* |
|
1827 * Wake up anyone sleeping, waiting for this lock. 1828 */ 1829static void 1830nfsv4_wanted(struct nfsv4lock *lp) 1831{ 1832 1833 if (lp->nfslock_lock & NFSV4LOCK_WANTED) { 1834 lp->nfslock_lock &= ~NFSV4LOCK_WANTED; --- 1543 unchanged lines hidden --- | 1840 * Wake up anyone sleeping, waiting for this lock. 1841 */ 1842static void 1843nfsv4_wanted(struct nfsv4lock *lp) 1844{ 1845 1846 if (lp->nfslock_lock & NFSV4LOCK_WANTED) { 1847 lp->nfslock_lock &= ~NFSV4LOCK_WANTED; --- 1543 unchanged lines hidden --- |