diff options
author | dg <dg@FreeBSD.org> | 1995-11-12 10:36:19 +0000 |
---|---|---|
committer | dg <dg@FreeBSD.org> | 1995-11-12 10:36:19 +0000 |
commit | 3b89ca83bf66dc04ef44bb3431437ac195a546d4 (patch) | |
tree | 560a48f3aedc27388def822d9df7129a17c4d02d /sys/fs | |
parent | 3f429c5533b604bcf6397dea6ad49e7cf6c7b8ff (diff) | |
download | FreeBSD-src-3b89ca83bf66dc04ef44bb3431437ac195a546d4.zip FreeBSD-src-3b89ca83bf66dc04ef44bb3431437ac195a546d4.tar.gz |
Brought in the setattr call support from Lite-2 so that more correct error
returns are provided.
Obtained from: 4.4BSD-Lite2
Diffstat (limited to 'sys/fs')
-rw-r--r-- | sys/fs/cd9660/cd9660_vnops.c | 41 |
1 files changed, 38 insertions, 3 deletions
diff --git a/sys/fs/cd9660/cd9660_vnops.c b/sys/fs/cd9660/cd9660_vnops.c index 0296eca..79ec54f 100644 --- a/sys/fs/cd9660/cd9660_vnops.c +++ b/sys/fs/cd9660/cd9660_vnops.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)cd9660_vnops.c 8.3 (Berkeley) 1/23/94 - * $Id: cd9660_vnops.c,v 1.19 1995/11/09 08:13:37 bde Exp $ + * $Id: cd9660_vnops.c,v 1.20 1995/11/12 10:16:53 davidg Exp $ */ #include <sys/param.h> @@ -133,6 +133,43 @@ cd9660_mknod(ndp, vap, cred, p) #endif /* + * Setattr call. Only allowed for block and character special devices. + */ +int +cd9660_setattr(ap) + struct vop_setattr_args /* { + struct vnodeop_desc *a_desc; + struct vnode *a_vp; + struct vattr *a_vap; + struct ucred *a_cred; + struct proc *a_p; + } */ *ap; +{ + struct vnode *vp = ap->a_vp; + struct vattr *vap = ap->a_vap; + + if (vap->va_flags != VNOVAL || vap->va_uid != (uid_t)VNOVAL || + vap->va_gid != (gid_t)VNOVAL || vap->va_atime.ts_sec != VNOVAL || + vap->va_mtime.ts_sec != VNOVAL || vap->va_mode != (mode_t)VNOVAL) + return (EROFS); + if (vap->va_size != VNOVAL) { + switch (vp->v_type) { + case VDIR: + return (EISDIR); + case VLNK: + case VREG: + return (EROFS); + case VCHR: + case VBLK: + case VSOCK: + case VFIFO: + return (0); + } + } + return (EOPNOTSUPP); +} + +/* * Open called. * * Nothing to do. @@ -910,8 +947,6 @@ cd9660_enotsupp() #define cd9660_create \ ((int (*) __P((struct vop_create_args *)))cd9660_enotsupp) #define cd9660_mknod ((int (*) __P((struct vop_mknod_args *)))cd9660_enotsupp) -#define cd9660_setattr \ - ((int (*) __P((struct vop_setattr_args *)))cd9660_enotsupp) #define cd9660_write ((int (*) __P((struct vop_write_args *)))cd9660_enotsupp) #define cd9660_fsync ((int (*) __P((struct vop_fsync_args *)))nullop) #define cd9660_remove \ |