diff options
author | Constantine Sapuntzakis <csapuntz@cvs.openbsd.org> | 2001-06-23 02:15:25 +0000 |
---|---|---|
committer | Constantine Sapuntzakis <csapuntz@cvs.openbsd.org> | 2001-06-23 02:15:25 +0000 |
commit | 0d0bb60489a587654939a483986aa833252268f3 (patch) | |
tree | 46d13607dd3390caa52db66106725cb83e20395c /sys | |
parent | c7b0cb75249b0df0ca9bfb325be9fa4b8b6551a4 (diff) |
Get rid of several vnode operations
Diffstat (limited to 'sys')
-rw-r--r-- | sys/msdosfs/denode.h | 5 | ||||
-rw-r--r-- | sys/msdosfs/msdosfs_denode.c | 26 | ||||
-rw-r--r-- | sys/msdosfs/msdosfs_vnops.c | 81 |
3 files changed, 26 insertions, 86 deletions
diff --git a/sys/msdosfs/denode.h b/sys/msdosfs/denode.h index 6a573fa2ada..665c74d2fd3 100644 --- a/sys/msdosfs/denode.h +++ b/sys/msdosfs/denode.h @@ -1,4 +1,4 @@ -/* $OpenBSD: denode.h,v 1.9 2001/02/23 14:42:38 csapuntz Exp $ */ +/* $OpenBSD: denode.h,v 1.10 2001/06/23 02:15:24 csapuntz Exp $ */ /* $NetBSD: denode.h,v 1.24 1997/10/17 11:23:39 ws Exp $ */ /*- @@ -274,9 +274,7 @@ int lease_check __P((void *)); #endif int msdosfs_ioctl __P((void *)); int msdosfs_select __P((void *)); -int msdosfs_mmap __P((void *)); int msdosfs_fsync __P((void *)); -int msdosfs_seek __P((void *)); int msdosfs_remove __P((void *)); int msdosfs_link __P((void *)); int msdosfs_rename __P((void *)); @@ -296,7 +294,6 @@ int msdosfs_islocked __P((void *)); int msdosfs_advlock __P((void *)); int msdosfs_reallocblks __P((void *)); int msdosfs_pathconf __P((void *)); -int msdosfs_update __P((void *)); /* * Internal service routine prototypes. diff --git a/sys/msdosfs/msdosfs_denode.c b/sys/msdosfs/msdosfs_denode.c index 036770e8f8f..82187cbd7df 100644 --- a/sys/msdosfs/msdosfs_denode.c +++ b/sys/msdosfs/msdosfs_denode.c @@ -1,4 +1,4 @@ -/* $OpenBSD: msdosfs_denode.c,v 1.16 1999/04/28 09:28:16 art Exp $ */ +/* $OpenBSD: msdosfs_denode.c,v 1.17 2001/06/23 02:15:24 csapuntz Exp $ */ /* $NetBSD: msdosfs_denode.c,v 1.23 1997/10/17 11:23:58 ws Exp $ */ /*- @@ -340,10 +340,32 @@ deupdat(dep, waitfor) struct denode *dep; int waitfor; { + struct buf *bp; + struct direntry *dirp; + int error; struct timespec ts; + if (DETOV(dep)->v_mount->mnt_flag & MNT_RDONLY) + return (0); TIMEVAL_TO_TIMESPEC(&time, &ts); - return (VOP_UPDATE(DETOV(dep), &ts, &ts, waitfor)); + DETIMES(dep, &ts, &ts, &ts); + if ((dep->de_flag & DE_MODIFIED) == 0) + return (0); + dep->de_flag &= ~DE_MODIFIED; + if (dep->de_Attributes & ATTR_DIRECTORY) + return (0); + if (dep->de_refcnt <= 0) + return (0); + error = readde(dep, &bp, &dirp); + if (error) + return (error); + DE_EXTERNALIZE(dirp, dep); + if (waitfor) + return (bwrite(bp)); + else { + bdwrite(bp); + return (0); + } } /* diff --git a/sys/msdosfs/msdosfs_vnops.c b/sys/msdosfs/msdosfs_vnops.c index f2fa0cadeda..6c1638b2db1 100644 --- a/sys/msdosfs/msdosfs_vnops.c +++ b/sys/msdosfs/msdosfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: msdosfs_vnops.c,v 1.23 2001/02/23 14:42:38 csapuntz Exp $ */ +/* $OpenBSD: msdosfs_vnops.c,v 1.24 2001/06/23 02:15:24 csapuntz Exp $ */ /* $NetBSD: msdosfs_vnops.c,v 1.63 1997/10/17 11:24:19 ws Exp $ */ /*- @@ -730,22 +730,6 @@ msdosfs_select(v) return (1); /* DOS filesystems never block? */ } -int -msdosfs_mmap(v) - void *v; -{ -#if 0 - struct vop_mmap_args /* { - struct vnode *a_vp; - int a_fflags; - struct ucred *a_cred; - struct proc *a_p; - } */ *ap; -#endif - - return (EINVAL); -} - /* * Flush the blocks of a file to disk. * @@ -769,66 +753,6 @@ msdosfs_fsync(v) } /* - * Now the whole work of extending a file is done in the write function. - * So nothing to do here. - */ -int -msdosfs_seek(v) - void *v; -{ -#if 0 - struct vop_seek_args /* { - struct vnode *a_vp; - off_t a_oldoff; - off_t a_newoff; - struct ucred *a_cred; - } */ *ap = v; -#endif - - return (0); -} - -int -msdosfs_update(v) - void *v; -{ - struct vop_update_args /* { - struct vnode *a_vp; - struct timespec *a_access; - struct timespec *a_modify; - int a_waitfor; - } */ *ap = v; - struct buf *bp; - struct direntry *dirp; - struct denode *dep; - int error; - struct timespec ts; - - if (ap->a_vp->v_mount->mnt_flag & MNT_RDONLY) - return (0); - dep = VTODE(ap->a_vp); - TIMEVAL_TO_TIMESPEC(&time, &ts); - DETIMES(dep, ap->a_access, ap->a_modify, &ts); - if ((dep->de_flag & DE_MODIFIED) == 0) - return (0); - dep->de_flag &= ~DE_MODIFIED; - if (dep->de_Attributes & ATTR_DIRECTORY) - return (0); - if (dep->de_refcnt <= 0) - return (0); - error = readde(dep, &bp, &dirp); - if (error) - return (error); - DE_EXTERNALIZE(dirp, dep); - if (ap->a_waitfor) - return (bwrite(bp)); - else { - bdwrite(bp); - return (0); - } -} - -/* * Flush the blocks of a file to disk. * * This function is worthless for vnodes that represent directories. Maybe we @@ -1976,9 +1900,7 @@ struct vnodeopv_entry_desc msdosfs_vnodeop_entries[] = { { &vop_lease_desc, msdosfs_lease_check }, /* lease */ { &vop_ioctl_desc, msdosfs_ioctl }, /* ioctl */ { &vop_select_desc, msdosfs_select }, /* select */ - { &vop_mmap_desc, msdosfs_mmap }, /* mmap */ { &vop_fsync_desc, msdosfs_fsync }, /* fsync */ - { &vop_seek_desc, msdosfs_seek }, /* seek */ { &vop_remove_desc, msdosfs_remove }, /* remove */ { &vop_link_desc, msdosfs_link }, /* link */ { &vop_rename_desc, msdosfs_rename }, /* rename */ @@ -1999,7 +1921,6 @@ struct vnodeopv_entry_desc msdosfs_vnodeop_entries[] = { { &vop_pathconf_desc, msdosfs_pathconf }, /* pathconf */ { &vop_advlock_desc, msdosfs_advlock }, /* advlock */ { &vop_reallocblks_desc, msdosfs_reallocblks }, /* reallocblks */ - { &vop_update_desc, msdosfs_update }, /* update */ { &vop_bwrite_desc, vop_generic_bwrite }, /* bwrite */ { (struct vnodeop_desc *)NULL, (int (*) __P((void *)))NULL } }; |