vfs_syscalls.c (211616) | vfs_syscalls.c (219999) |
---|---|
1/*- 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 21 unchanged lines hidden (view full) --- 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * SUCH DAMAGE. 33 * 34 * @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94 35 */ 36 37#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1989, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 21 unchanged lines hidden (view full) --- 30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32 * SUCH DAMAGE. 33 * 34 * @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94 35 */ 36 37#include <sys/cdefs.h> |
38__FBSDID("$FreeBSD: head/sys/kern/vfs_syscalls.c 211616 2010-08-22 11:18:57Z rpaulo $"); | 38__FBSDID("$FreeBSD: head/sys/kern/vfs_syscalls.c 219999 2011-03-25 14:00:36Z kib $"); |
39 40#include "opt_compat.h" 41#include "opt_kdtrace.h" 42#include "opt_ktrace.h" 43 44#include <sys/param.h> 45#include <sys/systm.h> 46#include <sys/bio.h> --- 1017 unchanged lines hidden (view full) --- 1064 if (flags & O_EXEC) { 1065 if (flags & O_ACCMODE) 1066 return (EINVAL); 1067 } else if ((flags & O_ACCMODE) == O_ACCMODE) 1068 return (EINVAL); 1069 else 1070 flags = FFLAGS(flags); 1071 | 39 40#include "opt_compat.h" 41#include "opt_kdtrace.h" 42#include "opt_ktrace.h" 43 44#include <sys/param.h> 45#include <sys/systm.h> 46#include <sys/bio.h> --- 1017 unchanged lines hidden (view full) --- 1064 if (flags & O_EXEC) { 1065 if (flags & O_ACCMODE) 1066 return (EINVAL); 1067 } else if ((flags & O_ACCMODE) == O_ACCMODE) 1068 return (EINVAL); 1069 else 1070 flags = FFLAGS(flags); 1071 |
1072 error = falloc(td, &nfp, &indx); | 1072 error = fallocf(td, &nfp, &indx, flags); |
1073 if (error) 1074 return (error); 1075 /* An extra reference on `nfp' has been held for us by falloc(). */ 1076 fp = nfp; 1077 /* Set the flags early so the finit in devfs can pick them up. */ 1078 fp->f_flag = flags & FMASK; 1079 cmode = ((mode &~ fdp->fd_cmask) & ALLPERMS) &~ S_ISTXT; 1080 NDINIT_AT(&nd, LOOKUP, FOLLOW | AUDITVNODE1 | MPSAFE, pathseg, path, fd, --- 3402 unchanged lines hidden (view full) --- 4483 4484 if (fmode & FWRITE) 4485 vp->v_writecount++; 4486 4487 /* 4488 * end of vn_open code 4489 */ 4490 | 1073 if (error) 1074 return (error); 1075 /* An extra reference on `nfp' has been held for us by falloc(). */ 1076 fp = nfp; 1077 /* Set the flags early so the finit in devfs can pick them up. */ 1078 fp->f_flag = flags & FMASK; 1079 cmode = ((mode &~ fdp->fd_cmask) & ALLPERMS) &~ S_ISTXT; 1080 NDINIT_AT(&nd, LOOKUP, FOLLOW | AUDITVNODE1 | MPSAFE, pathseg, path, fd, --- 3402 unchanged lines hidden (view full) --- 4483 4484 if (fmode & FWRITE) 4485 vp->v_writecount++; 4486 4487 /* 4488 * end of vn_open code 4489 */ 4490 |
4491 if ((error = falloc(td, &nfp, &indx)) != 0) { | 4491 if ((error = fallocf(td, &nfp, &indx, fmode)) != 0) { |
4492 if (fmode & FWRITE) 4493 vp->v_writecount--; 4494 goto bad; 4495 } 4496 /* An extra reference on `nfp' has been held for us by falloc(). */ 4497 fp = nfp; 4498 nfp->f_vnode = vp; 4499 finit(nfp, fmode & FMASK, DTYPE_VNODE, vp, &vnops); --- 167 unchanged lines hidden --- | 4492 if (fmode & FWRITE) 4493 vp->v_writecount--; 4494 goto bad; 4495 } 4496 /* An extra reference on `nfp' has been held for us by falloc(). */ 4497 fp = nfp; 4498 nfp->f_vnode = vp; 4499 finit(nfp, fmode & FMASK, DTYPE_VNODE, vp, &vnops); --- 167 unchanged lines hidden --- |