Remove the now-pointless ulfs ops macros.

This commit is contained in:
dholland 2013-07-28 00:37:07 +00:00
parent 933722845b
commit 62ec15fbc5
7 changed files with 47 additions and 62 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: lfs_rename.c,v 1.2 2013/07/20 20:01:24 dholland Exp $ */
/* $NetBSD: lfs_rename.c,v 1.3 2013/07/28 00:37:07 dholland Exp $ */
/* from NetBSD: ufs_rename.c,v 1.6 2013/01/22 09:39:18 dholland Exp */
/*-
@ -89,7 +89,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: lfs_rename.c,v 1.2 2013/07/20 20:01:24 dholland Exp $");
__KERNEL_RCSID(0, "$NetBSD: lfs_rename.c,v 1.3 2013/07/28 00:37:07 dholland Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -842,7 +842,7 @@ ulfs_gro_rename(struct mount *mp, kauth_cred_t cred,
VTOI(fvp)->i_nlink++;
DIP_ASSIGN(VTOI(fvp), nlink, VTOI(fvp)->i_nlink);
VTOI(fvp)->i_flag |= IN_CHANGE;
error = ULFS_UPDATE(fvp, NULL, NULL, UPDATE_DIROP);
error = lfs_update(fvp, NULL, NULL, UPDATE_DIROP);
if (error)
goto whymustithurtsomuch;
@ -869,7 +869,7 @@ ulfs_gro_rename(struct mount *mp, kauth_cred_t cred,
VTOI(tdvp)->i_nlink++;
DIP_ASSIGN(VTOI(tdvp), nlink, VTOI(tdvp)->i_nlink);
VTOI(tdvp)->i_flag |= IN_CHANGE;
error = ULFS_UPDATE(tdvp, NULL, NULL, UPDATE_DIROP);
error = lfs_update(tdvp, NULL, NULL, UPDATE_DIROP);
if (error) {
/*
* Link count update didn't take --
@ -901,7 +901,7 @@ ulfs_gro_rename(struct mount *mp, kauth_cred_t cred,
DIP_ASSIGN(VTOI(tdvp), nlink,
VTOI(tdvp)->i_nlink);
VTOI(tdvp)->i_flag |= IN_CHANGE;
(void)ULFS_UPDATE(tdvp, NULL, NULL,
(void)lfs_update(tdvp, NULL, NULL,
UPDATE_WAIT | UPDATE_DIROP);
}
goto whymustithurtsomuch;
@ -962,7 +962,7 @@ ulfs_gro_rename(struct mount *mp, kauth_cred_t cred,
"hard-linked directory");
VTOI(tvp)->i_nlink = 0;
DIP_ASSIGN(VTOI(tvp), nlink, 0);
error = ULFS_TRUNCATE(tvp, (off_t)0, IO_SYNC, cred);
error = lfs_truncate(tvp, (off_t)0, IO_SYNC, cred);
if (error)
goto whymustithurtsomuch;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: ulfs_inode.c,v 1.8 2013/07/28 00:29:18 dholland Exp $ */
/* $NetBSD: ulfs_inode.c,v 1.9 2013/07/28 00:37:07 dholland Exp $ */
/* from NetBSD: ufs_inode.c,v 1.89 2013/01/22 09:39:18 dholland Exp */
/*
@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ulfs_inode.c,v 1.8 2013/07/28 00:29:18 dholland Exp $");
__KERNEL_RCSID(0, "$NetBSD: ulfs_inode.c,v 1.9 2013/07/28 00:37:07 dholland Exp $");
#if defined(_KERNEL_OPT)
#include "opt_lfs.h"
@ -102,7 +102,7 @@ ulfs_inactive(void *v)
ulfs_extattr_vnode_inactive(vp, curlwp);
#endif
if (ip->i_size != 0) {
error = ULFS_TRUNCATE(vp, (off_t)0, 0, NOCRED);
error = lfs_truncate(vp, (off_t)0, 0, NOCRED);
}
#if defined(LFS_QUOTA) || defined(LFS_QUOTA2)
(void)lfs_chkiq(ip, -1, NOCRED, 0);
@ -119,7 +119,7 @@ ulfs_inactive(void *v)
}
if (ip->i_flag & (IN_CHANGE | IN_UPDATE | IN_MODIFIED)) {
ULFS_UPDATE(vp, NULL, NULL, 0);
lfs_update(vp, NULL, NULL, 0);
}
out:
@ -146,8 +146,8 @@ ulfs_reclaim(struct vnode *vp)
/* XXX: do we really need two of these? */
/* note: originally the first was inside a wapbl txn */
ULFS_UPDATE(vp, NULL, NULL, UPDATE_CLOSE);
ULFS_UPDATE(vp, NULL, NULL, UPDATE_CLOSE);
lfs_update(vp, NULL, NULL, UPDATE_CLOSE);
lfs_update(vp, NULL, NULL, UPDATE_CLOSE);
/*
* Remove the inode from its hash chain.

View File

@ -1,4 +1,4 @@
/* $NetBSD: ulfs_lookup.c,v 1.13 2013/07/28 00:29:18 dholland Exp $ */
/* $NetBSD: ulfs_lookup.c,v 1.14 2013/07/28 00:37:07 dholland Exp $ */
/* from NetBSD: ufs_lookup.c,v 1.122 2013/01/22 09:39:18 dholland Exp */
/*
@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ulfs_lookup.c,v 1.13 2013/07/28 00:29:18 dholland Exp $");
__KERNEL_RCSID(0, "$NetBSD: ulfs_lookup.c,v 1.14 2013/07/28 00:37:07 dholland Exp $");
#ifdef _KERNEL_OPT
#include "opt_lfs.h"
@ -842,7 +842,7 @@ ulfs_direnter(struct vnode *dvp, const struct ulfs_lookup_results *ulr,
*/
if (ulr->ulr_offset & (dirblksiz - 1))
panic("ulfs_direnter: newblk");
if ((error = ULFS_BALLOC(dvp, (off_t)ulr->ulr_offset, dirblksiz,
if ((error = lfs_balloc(dvp, (off_t)ulr->ulr_offset, dirblksiz,
cr, B_CLRBUF | B_SYNC, &bp)) != 0) {
return (error);
}
@ -875,7 +875,7 @@ ulfs_direnter(struct vnode *dvp, const struct ulfs_lookup_results *ulr,
#endif
error = VOP_BWRITE(bp->b_vp, bp);
vfs_timestamp(&ts);
ret = ULFS_UPDATE(dvp, &ts, &ts, UPDATE_DIROP);
ret = lfs_update(dvp, &ts, &ts, UPDATE_DIROP);
if (error == 0)
return (ret);
return (error);
@ -1018,7 +1018,7 @@ ulfs_direnter(struct vnode *dvp, const struct ulfs_lookup_results *ulr,
if (dp->i_dirhash != NULL)
ulfsdirhash_dirtrunc(dp, ulr->ulr_endoff);
#endif
(void) ULFS_TRUNCATE(dvp, (off_t)ulr->ulr_endoff, IO_SYNC, cr);
(void) lfs_truncate(dvp, (off_t)ulr->ulr_endoff, IO_SYNC, cr);
}
return (error);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: ulfs_quota2.c,v 1.7 2013/07/28 00:29:18 dholland Exp $ */
/* $NetBSD: ulfs_quota2.c,v 1.8 2013/07/28 00:37:07 dholland Exp $ */
/* from NetBSD: ufs_quota2.c,v 1.35 2012/09/27 07:47:56 bouyer Exp */
/*-
@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ulfs_quota2.c,v 1.7 2013/07/28 00:29:18 dholland Exp $");
__KERNEL_RCSID(0, "$NetBSD: ulfs_quota2.c,v 1.8 2013/07/28 00:37:07 dholland Exp $");
#include <sys/buf.h>
#include <sys/param.h>
@ -314,7 +314,7 @@ quota2_q2ealloc(struct ulfsmount *ump, int type, uid_t uid, struct dquot *dq)
struct inode *ip = VTOI(vp);
uint64_t size = ip->i_size;
/* need to alocate a new disk block */
error = ULFS_BALLOC(vp, size, ump->umq2_bsize,
error = lfs_balloc(vp, size, ump->umq2_bsize,
ump->um_cred[type], B_CLRBUF | B_SYNC, &bp);
if (error) {
brelse(hbp, 0);
@ -328,7 +328,7 @@ quota2_q2ealloc(struct ulfsmount *ump, int type, uid_t uid, struct dquot *dq)
lfsquota2_addfreeq2e(q2h, bp->b_data, size, ump->umq2_bsize,
needswap);
error = bwrite(bp);
error2 = ULFS_UPDATE(vp, NULL, NULL, UPDATE_WAIT);
error2 = lfs_update(vp, NULL, NULL, UPDATE_WAIT);
if (error || error2) {
brelse(hbp, 0);
if (error)

View File

@ -1,4 +1,4 @@
/* $NetBSD: ulfs_readwrite.c,v 1.4 2013/06/18 18:18:58 christos Exp $ */
/* $NetBSD: ulfs_readwrite.c,v 1.5 2013/07/28 00:37:07 dholland Exp $ */
/* from NetBSD: ufs_readwrite.c,v 1.105 2013/01/22 09:39:18 dholland Exp */
/*-
@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(1, "$NetBSD: ulfs_readwrite.c,v 1.4 2013/06/18 18:18:58 christos Exp $");
__KERNEL_RCSID(1, "$NetBSD: ulfs_readwrite.c,v 1.5 2013/07/28 00:37:07 dholland Exp $");
#ifdef LFS_READWRITE
#define FS struct lfs
@ -183,7 +183,7 @@ READ(void *v)
if (!(vp->v_mount->mnt_flag & MNT_NOATIME)) {
ip->i_flag |= IN_ACCESS;
if ((ap->a_ioflag & IO_SYNC) == IO_SYNC) {
error = ULFS_UPDATE(vp, NULL, NULL, UPDATE_WAIT);
error = lfs_update(vp, NULL, NULL, UPDATE_WAIT);
}
}
@ -436,7 +436,7 @@ WRITE(void *v)
break;
need_unreserve = true;
#endif
error = ULFS_BALLOC(vp, uio->uio_offset, xfersize,
error = lfs_balloc(vp, uio->uio_offset, xfersize,
ap->a_cred, flags, &bp);
if (error)
@ -514,11 +514,11 @@ out:
if (resid > uio->uio_resid)
VN_KNOTE(vp, NOTE_WRITE | (extended ? NOTE_EXTEND : 0));
if (error) {
(void) ULFS_TRUNCATE(vp, osize, ioflag & IO_SYNC, ap->a_cred);
(void) lfs_truncate(vp, osize, ioflag & IO_SYNC, ap->a_cred);
uio->uio_offset -= resid - uio->uio_resid;
uio->uio_resid = resid;
} else if (resid > uio->uio_resid && (ioflag & IO_SYNC) == IO_SYNC) {
error = ULFS_UPDATE(vp, NULL, NULL, UPDATE_WAIT);
error = lfs_update(vp, NULL, NULL, UPDATE_WAIT);
} else {
/* nothing */
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: ulfs_vnops.c,v 1.16 2013/07/28 00:31:54 dholland Exp $ */
/* $NetBSD: ulfs_vnops.c,v 1.17 2013/07/28 00:37:07 dholland Exp $ */
/* from NetBSD: ufs_vnops.c,v 1.213 2013/06/08 05:47:02 kardel Exp */
/*-
@ -67,7 +67,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: ulfs_vnops.c,v 1.16 2013/07/28 00:31:54 dholland Exp $");
__KERNEL_RCSID(0, "$NetBSD: ulfs_vnops.c,v 1.17 2013/07/28 00:37:07 dholland Exp $");
#if defined(_KERNEL_OPT)
#include "opt_lfs.h"
@ -384,7 +384,7 @@ ulfs_setattr(void *v)
error = EPERM;
goto out;
}
error = ULFS_TRUNCATE(vp, vap->va_size, 0, cred);
error = lfs_truncate(vp, vap->va_size, 0, cred);
if (error)
goto out;
break;
@ -421,7 +421,7 @@ ulfs_setattr(void *v)
ip->i_ffs2_birthtime = vap->va_birthtime.tv_sec;
ip->i_ffs2_birthnsec = vap->va_birthtime.tv_nsec;
}
error = ULFS_UPDATE(vp, &vap->va_atime, &vap->va_mtime, 0);
error = lfs_update(vp, &vap->va_atime, &vap->va_mtime, 0);
if (error)
goto out;
}
@ -620,7 +620,7 @@ ulfs_link(void *v)
ip->i_nlink++;
DIP_ASSIGN(ip, nlink, ip->i_nlink);
ip->i_flag |= IN_CHANGE;
error = ULFS_UPDATE(vp, NULL, NULL, UPDATE_DIROP);
error = lfs_update(vp, NULL, NULL, UPDATE_DIROP);
if (!error) {
newdir = pool_cache_get(ulfs_direct_cache, PR_WAITOK);
ulfs_makedirentry(ip, cnp, newdir);
@ -748,7 +748,7 @@ ulfs_mkdir(void *v)
* but not have it entered in the parent directory. The entry is
* made later after writing "." and ".." entries.
*/
if ((error = ULFS_VALLOC(dvp, dmode, cnp->cn_cred, ap->a_vpp)) != 0)
if ((error = lfs_valloc(dvp, dmode, cnp->cn_cred, ap->a_vpp)) != 0)
goto out;
tvp = *ap->a_vpp;
@ -760,7 +760,7 @@ ulfs_mkdir(void *v)
DIP_ASSIGN(ip, gid, ip->i_gid);
#if defined(LFS_QUOTA) || defined(LFS_QUOTA2)
if ((error = lfs_chkiq(ip, 1, cnp->cn_cred, 0))) {
ULFS_VFREE(tvp, ip->i_number, dmode);
lfs_vfree(tvp, ip->i_number, dmode);
fstrans_done(dvp->v_mount);
vput(tvp);
vput(dvp);
@ -786,7 +786,7 @@ ulfs_mkdir(void *v)
dp->i_nlink++;
DIP_ASSIGN(dp, nlink, dp->i_nlink);
dp->i_flag |= IN_CHANGE;
if ((error = ULFS_UPDATE(dvp, NULL, NULL, UPDATE_DIROP)) != 0)
if ((error = lfs_update(dvp, NULL, NULL, UPDATE_DIROP)) != 0)
goto bad;
/*
@ -813,7 +813,7 @@ ulfs_mkdir(void *v)
} else
dirtemplate.dot_type = dirtemplate.dotdot_type = 0;
}
if ((error = ULFS_BALLOC(tvp, (off_t)0, dirblksiz, cnp->cn_cred,
if ((error = lfs_balloc(tvp, (off_t)0, dirblksiz, cnp->cn_cred,
B_CLRBUF, &bp)) != 0)
goto bad;
ip->i_size = dirblksiz;
@ -829,7 +829,7 @@ ulfs_mkdir(void *v)
*/
if ((error = VOP_BWRITE(bp->b_vp, bp)) != 0)
goto bad;
if ((error = ULFS_UPDATE(tvp, NULL, NULL, UPDATE_DIROP)) != 0) {
if ((error = lfs_update(tvp, NULL, NULL, UPDATE_DIROP)) != 0) {
goto bad;
}
newdir = pool_cache_get(ulfs_direct_cache, PR_WAITOK);
@ -844,14 +844,14 @@ ulfs_mkdir(void *v)
DIP_ASSIGN(dp, nlink, dp->i_nlink);
dp->i_flag |= IN_CHANGE;
/*
* No need to do an explicit ULFS_TRUNCATE here, vrele will
* No need to do an explicit lfs_truncate here, vrele will
* do this for us because we set the link count to 0.
*/
ip->i_nlink = 0;
DIP_ASSIGN(ip, nlink, 0);
ip->i_flag |= IN_CHANGE;
/* If IN_ADIROP, account for it */
ULFS_UNMARK_VNODE(tvp);
lfs_unmark_vnode(tvp);
vput(tvp);
}
out:
@ -937,7 +937,7 @@ ulfs_rmdir(void *v)
ip->i_nlink--;
DIP_ASSIGN(ip, nlink, ip->i_nlink);
ip->i_flag |= IN_CHANGE;
error = ULFS_TRUNCATE(vp, (off_t)0, IO_SYNC, cnp->cn_cred);
error = lfs_truncate(vp, (off_t)0, IO_SYNC, cnp->cn_cred);
cache_purge(vp);
#ifdef LFS_DIRHASH
if (ip->i_dirhash != NULL)
@ -1424,7 +1424,7 @@ ulfs_makeinode(int mode, struct vnode *dvp, const struct ulfs_lookup_results *ul
if ((mode & LFS_IFMT) == 0)
mode |= LFS_IFREG;
if ((error = ULFS_VALLOC(dvp, mode, cnp->cn_cred, vpp)) != 0) {
if ((error = lfs_valloc(dvp, mode, cnp->cn_cred, vpp)) != 0) {
vput(dvp);
return (error);
}
@ -1436,7 +1436,7 @@ ulfs_makeinode(int mode, struct vnode *dvp, const struct ulfs_lookup_results *ul
DIP_ASSIGN(ip, uid, ip->i_uid);
#if defined(LFS_QUOTA) || defined(LFS_QUOTA2)
if ((error = lfs_chkiq(ip, 1, cnp->cn_cred, 0))) {
ULFS_VFREE(tvp, ip->i_number, mode);
lfs_vfree(tvp, ip->i_number, mode);
vput(tvp);
vput(dvp);
return (error);
@ -1468,7 +1468,7 @@ ulfs_makeinode(int mode, struct vnode *dvp, const struct ulfs_lookup_results *ul
/*
* Make sure inode goes to disk before directory entry.
*/
if ((error = ULFS_UPDATE(tvp, NULL, NULL, UPDATE_DIROP)) != 0)
if ((error = lfs_update(tvp, NULL, NULL, UPDATE_DIROP)) != 0)
goto bad;
newdir = pool_cache_get(ulfs_direct_cache, PR_WAITOK);
ulfs_makedirentry(ip, cnp, newdir);
@ -1489,7 +1489,7 @@ ulfs_makeinode(int mode, struct vnode *dvp, const struct ulfs_lookup_results *ul
DIP_ASSIGN(ip, nlink, 0);
ip->i_flag |= IN_CHANGE;
/* If IN_ADIROP, account for it */
ULFS_UNMARK_VNODE(tvp);
lfs_unmark_vnode(tvp);
tvp->v_type = VNON; /* explodes later if VBLK */
vput(tvp);
vput(dvp);
@ -1518,13 +1518,13 @@ ulfs_gop_alloc(struct vnode *vp, off_t off, off_t len, int flags,
while (len > 0) {
bsize = MIN(bsize, len);
error = ULFS_BALLOC(vp, off, bsize, cred, flags, NULL);
error = lfs_balloc(vp, off, bsize, cred, flags, NULL);
if (error) {
goto out;
}
/*
* increase file size now, ULFS_BALLOC() requires that
* increase file size now, lfs_balloc() requires that
* EOF be up-to-date before each call.
*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: ulfsmount.h,v 1.10 2013/07/28 00:29:18 dholland Exp $ */
/* $NetBSD: ulfsmount.h,v 1.11 2013/07/28 00:37:07 dholland Exp $ */
/* from NetBSD: ufsmount.h,v 1.39 2012/10/19 17:09:08 drochner Exp */
/*
@ -104,21 +104,6 @@ struct ulfsmount {
#define umq2_bmask um_q.um_q2.q2_bmask
};
#define ULFS_ITIMES(vp, acc, mod, cre) \
((void)0)
#define ULFS_UPDATE(vp, acc, mod, flags) \
lfs_update((vp), (acc), (mod), (flags))
#define ULFS_TRUNCATE(vp, off, flags, cr) \
lfs_truncate((vp), (off), (flags), (cr))
#define ULFS_VALLOC(vp, mode, cr, vpp) \
lfs_valloc((vp), (mode), (cr), (vpp))
#define ULFS_VFREE(vp, ino, mode) \
lfs_vfree((vp), (ino), (mode))
#define ULFS_BALLOC(vp, off, size, cr, flags, bpp) \
lfs_balloc((vp), (off), (size), (cr), (flags), (bpp))
#define ULFS_UNMARK_VNODE(vp) \
lfs_unmark_vnode((vp))
/* ULFS-specific flags for um_flags */
#define ULFS_NEEDSWAP 0x01 /* filesystem metadata need byte-swapping */
/* unused 0x02 */