ufs_quota.c (33181) | ufs_quota.c (34266) |
---|---|
1/* 2 * Copyright (c) 1982, 1986, 1990, 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 * Robert Elz at The University of Melbourne. 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_quota.c 8.5 (Berkeley) 5/20/95 | 1/* 2 * Copyright (c) 1982, 1986, 1990, 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 * Robert Elz at The University of Melbourne. 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_quota.c 8.5 (Berkeley) 5/20/95 |
37 * $Id: ufs_quota.c,v 1.18 1998/02/06 12:14:18 eivind Exp $ | 37 * $Id: ufs_quota.c,v 1.19 1998/02/09 06:11:12 eivind Exp $ |
38 */ 39 40#include <sys/param.h> 41#include <sys/kernel.h> 42#include <sys/systm.h> 43#include <sys/namei.h> 44#include <sys/malloc.h> 45#include <sys/fcntl.h> --- 374 unchanged lines hidden (view full) --- 420 /* 421 * Search vnodes associated with this mount point, 422 * adding references to quota file being opened. 423 * NB: only need to add dquot's for inodes being modified. 424 */ 425again: 426 for (vp = mp->mnt_vnodelist.lh_first; vp != NULL; vp = nextvp) { 427 nextvp = vp->v_mntvnodes.le_next; | 38 */ 39 40#include <sys/param.h> 41#include <sys/kernel.h> 42#include <sys/systm.h> 43#include <sys/namei.h> 44#include <sys/malloc.h> 45#include <sys/fcntl.h> --- 374 unchanged lines hidden (view full) --- 420 /* 421 * Search vnodes associated with this mount point, 422 * adding references to quota file being opened. 423 * NB: only need to add dquot's for inodes being modified. 424 */ 425again: 426 for (vp = mp->mnt_vnodelist.lh_first; vp != NULL; vp = nextvp) { 427 nextvp = vp->v_mntvnodes.le_next; |
428 if (vp->v_writecount == 0) | 428 if (vp->v_type == VNON || vp->v_writecount == 0) |
429 continue; 430 if (vget(vp, LK_EXCLUSIVE, p)) 431 goto again; 432 error = getinoquota(VTOI(vp)); 433 if (error) { 434 vput(vp); 435 break; 436 } --- 28 unchanged lines hidden (view full) --- 465 ump->um_qflags[type] |= QTF_CLOSING; 466 /* 467 * Search vnodes associated with this mount point, 468 * deleting any references to quota file being closed. 469 */ 470again: 471 for (vp = mp->mnt_vnodelist.lh_first; vp != NULL; vp = nextvp) { 472 nextvp = vp->v_mntvnodes.le_next; | 429 continue; 430 if (vget(vp, LK_EXCLUSIVE, p)) 431 goto again; 432 error = getinoquota(VTOI(vp)); 433 if (error) { 434 vput(vp); 435 break; 436 } --- 28 unchanged lines hidden (view full) --- 465 ump->um_qflags[type] |= QTF_CLOSING; 466 /* 467 * Search vnodes associated with this mount point, 468 * deleting any references to quota file being closed. 469 */ 470again: 471 for (vp = mp->mnt_vnodelist.lh_first; vp != NULL; vp = nextvp) { 472 nextvp = vp->v_mntvnodes.le_next; |
473 if (vp->v_type == VNON) 474 continue; |
|
473 if (vget(vp, LK_EXCLUSIVE, p)) 474 goto again; 475 ip = VTOI(vp); 476 dq = ip->i_dquot[type]; 477 ip->i_dquot[type] = NODQUOT; 478 dqrele(vp, dq); 479 vput(vp); 480 if (vp->v_mntvnodes.le_next != nextvp || vp->v_mount != mp) --- 171 unchanged lines hidden (view full) --- 652 * synchronizing any modified dquot structures. 653 */ 654 simple_lock(&mntvnode_slock); 655again: 656 for (vp = mp->mnt_vnodelist.lh_first; vp != NULL; vp = nextvp) { 657 if (vp->v_mount != mp) 658 goto again; 659 nextvp = vp->v_mntvnodes.le_next; | 475 if (vget(vp, LK_EXCLUSIVE, p)) 476 goto again; 477 ip = VTOI(vp); 478 dq = ip->i_dquot[type]; 479 ip->i_dquot[type] = NODQUOT; 480 dqrele(vp, dq); 481 vput(vp); 482 if (vp->v_mntvnodes.le_next != nextvp || vp->v_mount != mp) --- 171 unchanged lines hidden (view full) --- 654 * synchronizing any modified dquot structures. 655 */ 656 simple_lock(&mntvnode_slock); 657again: 658 for (vp = mp->mnt_vnodelist.lh_first; vp != NULL; vp = nextvp) { 659 if (vp->v_mount != mp) 660 goto again; 661 nextvp = vp->v_mntvnodes.le_next; |
662 if (vp->v_type == VNON) 663 continue; |
|
660 simple_lock(&vp->v_interlock); 661 simple_unlock(&mntvnode_slock); 662 error = vget(vp, LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK, p); 663 if (error) { 664 simple_lock(&mntvnode_slock); 665 if (error == ENOENT) 666 goto again; 667 continue; --- 274 unchanged lines hidden --- | 664 simple_lock(&vp->v_interlock); 665 simple_unlock(&mntvnode_slock); 666 error = vget(vp, LK_EXCLUSIVE | LK_NOWAIT | LK_INTERLOCK, p); 667 if (error) { 668 simple_lock(&mntvnode_slock); 669 if (error == ENOENT) 670 goto again; 671 continue; --- 274 unchanged lines hidden --- |