summaryrefslogtreecommitdiff
path: root/sys/ntfs/ntfs_vfsops.c
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2010-08-12 04:05:04 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2010-08-12 04:05:04 +0000
commita9bd431f6a5f05e49d04975e60951c347a0875c8 (patch)
treee5a5580ffa84fb260f067bbc3ee128e40c5b7ab5 /sys/ntfs/ntfs_vfsops.c
parent9628420868d694a31d68092cb5ef07b851f22f74 (diff)
clean up some macro obfuscation and assorted styling problems.
fix a bonus off by one bug. ok matthew
Diffstat (limited to 'sys/ntfs/ntfs_vfsops.c')
-rw-r--r--sys/ntfs/ntfs_vfsops.c31
1 files changed, 14 insertions, 17 deletions
diff --git a/sys/ntfs/ntfs_vfsops.c b/sys/ntfs/ntfs_vfsops.c
index ee40a3db9f8..459d8d7a9fe 100644
--- a/sys/ntfs/ntfs_vfsops.c
+++ b/sys/ntfs/ntfs_vfsops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntfs_vfsops.c,v 1.18 2010/08/08 01:28:33 tedu Exp $ */
+/* $OpenBSD: ntfs_vfsops.c,v 1.19 2010/08/12 04:05:03 tedu Exp $ */
/* $NetBSD: ntfs_vfsops.c,v 1.7 2003/04/24 07:50:19 christos Exp $ */
/*-
@@ -436,11 +436,10 @@ ntfs_mountfs(devvp, mp, argsp, p)
goto out1;
/* Count valid entries */
- for(num=0;;num++) {
+ for(num = 0; ; num++) {
error = ntfs_readattr(ntmp, VTONT(vp),
- NTFS_A_DATA, NULL,
- num * sizeof(ad), sizeof(ad),
- &ad, NULL);
+ NTFS_A_DATA, NULL, num * sizeof(ad), sizeof(ad),
+ &ad, NULL);
if (error)
goto out1;
if (ad.ad_name[0] == 0)
@@ -448,18 +447,16 @@ ntfs_mountfs(devvp, mp, argsp, p)
}
/* Alloc memory for attribute definitions */
- ntmp->ntm_ad = (struct ntvattrdef *) malloc(
- num * sizeof(struct ntvattrdef),
- M_NTFSMNT, M_WAITOK);
+ ntmp->ntm_ad = malloc(num * sizeof(struct ntvattrdef),
+ M_NTFSMNT, M_WAITOK);
ntmp->ntm_adnum = num;
/* Read them and translate */
- for(i=0;i<num;i++){
+ for(i = 0; i < num; i++){
error = ntfs_readattr(ntmp, VTONT(vp),
- NTFS_A_DATA, NULL,
- i * sizeof(ad), sizeof(ad),
- &ad, NULL);
+ NTFS_A_DATA, NULL, i * sizeof(ad), sizeof(ad),
+ &ad, NULL);
if (error)
goto out1;
j = 0;
@@ -501,9 +498,9 @@ out:
}
/* lock the device vnode before calling VOP_CLOSE() */
- VN_LOCK(devvp, LK_EXCLUSIVE | LK_RETRY, p);
+ vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY, p);
(void)VOP_CLOSE(devvp, ronly ? FREAD : FREAD|FWRITE, NOCRED, p);
- VOP__UNLOCK(devvp, 0, p);
+ VOP_UNLOCK(devvp, 0, p);
return (error);
}
@@ -634,7 +631,7 @@ ntfs_calccfree(
bmsize = VTOF(vp)->f_size;
- tmp = (u_int8_t *) malloc(bmsize, M_TEMP, M_WAITOK);
+ tmp = malloc(bmsize, M_TEMP, M_WAITOK);
error = ntfs_readattr(ntmp, VTONT(vp), NTFS_A_DATA, NULL,
0, bmsize, tmp, NULL);
@@ -828,7 +825,7 @@ ntfs_vgetex(
if (FTOV(fp)) {
/* vget() returns error if the vnode has been recycled */
- if (VGET(FTOV(fp), lkflags, p) == 0) {
+ if (vget(FTOV(fp), lkflags, p) == 0) {
*vpp = FTOV(fp);
return (0);
}
@@ -851,7 +848,7 @@ ntfs_vgetex(
vp->v_flag |= VROOT;
if (lkflags & LK_TYPE_MASK) {
- error = VN_LOCK(vp, lkflags, p);
+ error = vn_lock(vp, lkflags, p);
if (error) {
vput(vp);
return (error);