Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/ufs/lfs Merge ulfs_create into lfs_create.
details: https://anonhg.NetBSD.org/src/rev/b8b6140f2566
branches: trunk
changeset: 329263:b8b6140f2566
user: dholland <dholland%NetBSD.org@localhost>
date: Sat May 17 07:10:27 2014 +0000
description:
Merge ulfs_create into lfs_create.
diffstat:
sys/ufs/lfs/lfs_vnops.c | 55 ++++++++++++++++++------------------------------
1 files changed, 21 insertions(+), 34 deletions(-)
diffs (98 lines):
diff -r 7c882fdd6449 -r b8b6140f2566 sys/ufs/lfs/lfs_vnops.c
--- a/sys/ufs/lfs/lfs_vnops.c Sat May 17 07:09:59 2014 +0000
+++ b/sys/ufs/lfs/lfs_vnops.c Sat May 17 07:10:27 2014 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: lfs_vnops.c,v 1.267 2014/05/17 07:09:59 dholland Exp $ */
+/* $NetBSD: lfs_vnops.c,v 1.268 2014/05/17 07:10:27 dholland Exp $ */
/*-
* Copyright (c) 1999, 2000, 2001, 2002, 2003 The NetBSD Foundation, Inc.
@@ -125,7 +125,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_vnops.c,v 1.267 2014/05/17 07:09:59 dholland Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_vnops.c,v 1.268 2014/05/17 07:10:27 dholland Exp $");
#ifdef _KERNEL_OPT
#include "opt_compat_netbsd.h"
@@ -858,37 +858,6 @@
* Create a regular file
*/
int
-ulfs_create(void *v)
-{
- struct vop_create_v3_args /* {
- struct vnode *a_dvp;
- struct vnode **a_vpp;
- struct componentname *a_cnp;
- struct vattr *a_vap;
- } */ *ap = v;
- int error;
- struct vnode *dvp = ap->a_dvp;
- struct ulfs_lookup_results *ulr;
-
- /* XXX should handle this material another way */
- ulr = &VTOI(dvp)->i_crap;
- ULFS_CHECK_CRAPCOUNTER(VTOI(dvp));
-
- fstrans_start(dvp->v_mount, FSTRANS_SHARED);
- error =
- ulfs_makeinode(MAKEIMODE(ap->a_vap->va_type, ap->a_vap->va_mode),
- dvp, ulr, ap->a_vpp, ap->a_cnp);
- if (error) {
- fstrans_done(dvp->v_mount);
- return (error);
- }
- fstrans_done(dvp->v_mount);
- VN_KNOTE(dvp, NOTE_WRITE);
- VOP_UNLOCK(*ap->a_vpp);
- return (0);
-}
-
-int
lfs_create(void *v)
{
struct vop_create_v3_args /* {
@@ -899,14 +868,21 @@
} */ *ap = v;
struct lfs *fs;
struct vnode *dvp, **vpp;
+ struct vattr *vap;
+ struct ulfs_lookup_results *ulr;
int error;
dvp = ap->a_dvp;
vpp = ap->a_vpp;
+ vap = ap->a_vap;
KASSERT(vpp != NULL);
KASSERT(*vpp == NULL);
+ /* XXX should handle this material another way */
+ ulr = &VTOI(dvp)->i_crap;
+ ULFS_CHECK_CRAPCOUNTER(VTOI(dvp));
+
fs = VFSTOULFS(dvp->v_mount)->um_lfs;
ASSERT_NO_SEGLOCK(fs);
if (fs->lfs_ronly) {
@@ -933,7 +909,18 @@
return error;
}
- error = ulfs_create(ap);
+ fstrans_start(dvp->v_mount, FSTRANS_SHARED);
+ error = ulfs_makeinode(MAKEIMODE(vap->va_type, vap->va_mode),
+ dvp, ulr, vpp, ap->a_cnp);
+ if (error) {
+ fstrans_done(dvp->v_mount);
+ goto out;
+ }
+ fstrans_done(dvp->v_mount);
+ VN_KNOTE(dvp, NOTE_WRITE);
+ VOP_UNLOCK(*vpp);
+
+out:
UNMARK_VNODE(dvp);
UNMARK_VNODE(*vpp);
Home |
Main Index |
Thread Index |
Old Index