kern_lockf.c (106584) | kern_lockf.c (109623) |
---|---|
1/* 2 * Copyright (c) 1982, 1986, 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 * Scooter Morris at Genentech Inc. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 20 unchanged lines hidden (view full) --- 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * 36 * @(#)ufs_lockf.c 8.3 (Berkeley) 1/6/94 | 1/* 2 * Copyright (c) 1982, 1986, 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 * Scooter Morris at Genentech Inc. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 20 unchanged lines hidden (view full) --- 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34 * SUCH DAMAGE. 35 * 36 * @(#)ufs_lockf.c 8.3 (Berkeley) 1/6/94 |
37 * $FreeBSD: head/sys/kern/kern_lockf.c 106584 2002-11-07 21:56:05Z mux $ | 37 * $FreeBSD: head/sys/kern/kern_lockf.c 109623 2003-01-21 08:56:16Z alfred $ |
38 */ 39 40#include "opt_debug_lockf.h" 41 42#include <sys/param.h> 43#include <sys/systm.h> 44#include <sys/kernel.h> 45#include <sys/lock.h> --- 109 unchanged lines hidden (view full) --- 155 if (ap->a_op != F_SETLK) { 156 fl->l_type = F_UNLCK; 157 return (0); 158 } 159 } 160 /* 161 * Create the lockf structure 162 */ | 38 */ 39 40#include "opt_debug_lockf.h" 41 42#include <sys/param.h> 43#include <sys/systm.h> 44#include <sys/kernel.h> 45#include <sys/lock.h> --- 109 unchanged lines hidden (view full) --- 155 if (ap->a_op != F_SETLK) { 156 fl->l_type = F_UNLCK; 157 return (0); 158 } 159 } 160 /* 161 * Create the lockf structure 162 */ |
163 MALLOC(lock, struct lockf *, sizeof *lock, M_LOCKF, M_WAITOK); | 163 MALLOC(lock, struct lockf *, sizeof *lock, M_LOCKF, 0); |
164 lock->lf_start = start; 165 lock->lf_end = end; 166 lock->lf_id = ap->a_id; 167 /* 168 * XXX The problem is that VTOI is ufs specific, so it will 169 * break LOCKF_DEBUG for all other FS's other than UFS because 170 * it casts the vnode->data ptr to struct inode *. 171 */ --- 549 unchanged lines hidden (view full) --- 721 lock2->lf_next = lock1->lf_next; 722 lock1->lf_next = lock2; 723 return; 724 } 725 /* 726 * Make a new lock consisting of the last part of 727 * the encompassing lock 728 */ | 164 lock->lf_start = start; 165 lock->lf_end = end; 166 lock->lf_id = ap->a_id; 167 /* 168 * XXX The problem is that VTOI is ufs specific, so it will 169 * break LOCKF_DEBUG for all other FS's other than UFS because 170 * it casts the vnode->data ptr to struct inode *. 171 */ --- 549 unchanged lines hidden (view full) --- 721 lock2->lf_next = lock1->lf_next; 722 lock1->lf_next = lock2; 723 return; 724 } 725 /* 726 * Make a new lock consisting of the last part of 727 * the encompassing lock 728 */ |
729 MALLOC(splitlock, struct lockf *, sizeof *splitlock, M_LOCKF, M_WAITOK); | 729 MALLOC(splitlock, struct lockf *, sizeof *splitlock, M_LOCKF, 0); |
730 bcopy(lock1, splitlock, sizeof *splitlock); 731 splitlock->lf_start = lock2->lf_end + 1; 732 TAILQ_INIT(&splitlock->lf_blkhd); 733 lock1->lf_end = lock2->lf_start - 1; 734 /* 735 * OK, now link it in 736 */ 737 splitlock->lf_next = lock1->lf_next; --- 107 unchanged lines hidden --- | 730 bcopy(lock1, splitlock, sizeof *splitlock); 731 splitlock->lf_start = lock2->lf_end + 1; 732 TAILQ_INIT(&splitlock->lf_blkhd); 733 lock1->lf_end = lock2->lf_start - 1; 734 /* 735 * OK, now link it in 736 */ 737 splitlock->lf_next = lock1->lf_next; --- 107 unchanged lines hidden --- |