diff options
author | David Greenman <dg@FreeBSD.org> | 1995-11-12 10:36:19 +0000 |
---|---|---|
committer | David Greenman <dg@FreeBSD.org> | 1995-11-12 10:36:19 +0000 |
commit | de8583ced0bc3505685181881a08f2688cd99f6f (patch) | |
tree | 560a48f3aedc27388def822d9df7129a17c4d02d /sys/fs | |
parent | ba14c327258056ce8841a79614ef3987108aa9da (diff) | |
download | src-de8583ced0bc3505685181881a08f2688cd99f6f.tar.gz src-de8583ced0bc3505685181881a08f2688cd99f6f.zip |
Brought in the setattr call support from Lite-2 so that more correct error
returns are provided.
Obtained from: 4.4BSD-Lite2
Notes
Notes:
svn path=/head/; revision=12230
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 0296eca22d45..79ec54f27c8f 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 \ |