Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/fs/v7fs Make v7fs_getattr() report file flags, and adjus...
details: https://anonhg.NetBSD.org/src/rev/b062fb314c6e
branches: trunk
changeset: 778518:b062fb314c6e
user: njoly <njoly%NetBSD.org@localhost>
date: Sat Mar 31 21:44:28 2012 +0000
description:
Make v7fs_getattr() report file flags, and adjust v7fs_setattr() to
allow unsetting SF_APPEND flag.
diffstat:
sys/fs/v7fs/v7fs_vnops.c | 12 +++++-------
1 files changed, 5 insertions(+), 7 deletions(-)
diffs (45 lines):
diff -r b43a754bf977 -r b062fb314c6e sys/fs/v7fs/v7fs_vnops.c
--- a/sys/fs/v7fs/v7fs_vnops.c Sat Mar 31 14:46:16 2012 +0000
+++ b/sys/fs/v7fs/v7fs_vnops.c Sat Mar 31 21:44:28 2012 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: v7fs_vnops.c,v 1.9 2012/03/22 22:16:21 njoly Exp $ */
+/* $NetBSD: v7fs_vnops.c,v 1.10 2012/03/31 21:44:28 njoly Exp $ */
/*-
* Copyright (c) 2004, 2011 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: v7fs_vnops.c,v 1.9 2012/03/22 22:16:21 njoly Exp $");
+__KERNEL_RCSID(0, "$NetBSD: v7fs_vnops.c,v 1.10 2012/03/31 21:44:28 njoly Exp $");
#if defined _KERNEL_OPT
#include "opt_v7fs.h"
#endif
@@ -428,7 +428,7 @@
vap->va_ctime.tv_sec = inode->ctime;
vap->va_birthtime.tv_sec = 0;
vap->va_gen = 1;
- vap->va_flags = 0;
+ vap->va_flags = inode->append_mode ? SF_APPEND : 0;
vap->va_rdev = inode->device;
vap->va_bytes = vap->va_size; /* No sparse support. */
vap->va_filerev = 0;
@@ -482,15 +482,13 @@
return EINVAL;
}
/* File pointer mode. */
- if ((vap->va_flags != VNOVAL) && (vap->va_flags & SF_APPEND)) {
+ if (vap->va_flags != VNOVAL) {
error = kauth_authorize_vnode(cred, KAUTH_VNODE_WRITE_FLAGS,
vp, NULL, genfs_can_chflags(cred, vp->v_type, inode->uid,
false));
if (error)
return error;
-
- DPRINTF("Set append-mode.\n");
- inode->append_mode = true;
+ inode->append_mode = vap->va_flags & SF_APPEND;
}
/* File size change. */
Home |
Main Index |
Thread Index |
Old Index