Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/ufs/ext2fs PR kern/7867 add support for UF_NODUMP flag t...
details: https://anonhg.NetBSD.org/src/rev/eaeca0ffc706
branches: trunk
changeset: 346891:eaeca0ffc706
user: jdolecek <jdolecek%NetBSD.org@localhost>
date: Fri Aug 05 20:15:41 2016 +0000
description:
PR kern/7867 add support for UF_NODUMP flag to ext2fs
diffstat:
sys/ufs/ext2fs/ext2fs_vnops.c | 17 +++++++++++------
1 files changed, 11 insertions(+), 6 deletions(-)
diffs (59 lines):
diff -r 6214da522205 -r eaeca0ffc706 sys/ufs/ext2fs/ext2fs_vnops.c
--- a/sys/ufs/ext2fs/ext2fs_vnops.c Fri Aug 05 20:06:55 2016 +0000
+++ b/sys/ufs/ext2fs/ext2fs_vnops.c Fri Aug 05 20:15:41 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ext2fs_vnops.c,v 1.119 2016/08/03 23:29:05 jdolecek Exp $ */
+/* $NetBSD: ext2fs_vnops.c,v 1.120 2016/08/05 20:15:41 jdolecek Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1993
@@ -65,7 +65,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ext2fs_vnops.c,v 1.119 2016/08/03 23:29:05 jdolecek Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ext2fs_vnops.c,v 1.120 2016/08/05 20:15:41 jdolecek Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -311,13 +311,17 @@
if (EXT2_DINODE_FITS(ip->i_din.e2fs_din, e2di_crtime, EXT2_DINODE_SIZE(ip->i_e2fs))) {
EXT2_DINODE_TIME_GET(&vap->va_birthtime, ip->i_din.e2fs_din, e2di_crtime, EXT2_DINODE_SIZE(ip->i_e2fs));
}
+
+ vap->va_flags = 0;
+ vap->va_flags |= (ip->i_e2fs_flags & EXT2_NODUMP) ? UF_NODUMP : 0;
#ifdef EXT2FS_SYSTEM_FLAGS
- vap->va_flags = (ip->i_e2fs_flags & EXT2_APPEND) ? SF_APPEND : 0;
vap->va_flags |= (ip->i_e2fs_flags & EXT2_IMMUTABLE) ? SF_IMMUTABLE : 0;
+ vap->va_flags |= (ip->i_e2fs_flags & EXT2_APPEND) ? SF_APPEND : 0;
#else
- vap->va_flags = (ip->i_e2fs_flags & EXT2_APPEND) ? UF_APPEND : 0;
vap->va_flags |= (ip->i_e2fs_flags & EXT2_IMMUTABLE) ? UF_IMMUTABLE : 0;
+ vap->va_flags |= (ip->i_e2fs_flags & EXT2_APPEND) ? UF_APPEND : 0;
#endif
+
vap->va_gen = ip->i_e2fs_gen;
/* this doesn't belong here */
if (vp->v_type == VBLK)
@@ -391,17 +395,18 @@
if (error)
return (error);
+ ip->i_e2fs_flags &= ~(EXT2_APPEND | EXT2_IMMUTABLE | EXT2_NODUMP);
#ifdef EXT2FS_SYSTEM_FLAGS
- ip->i_e2fs_flags &= ~(EXT2_APPEND | EXT2_IMMUTABLE);
ip->i_e2fs_flags |=
(vap->va_flags & SF_APPEND) ? EXT2_APPEND : 0 |
(vap->va_flags & SF_IMMUTABLE) ? EXT2_IMMUTABLE : 0;
#else
- ip->i_e2fs_flags &= ~(EXT2_APPEND | EXT2_IMMUTABLE);
ip->i_e2fs_flags |=
(vap->va_flags & UF_APPEND) ? EXT2_APPEND : 0 |
(vap->va_flags & UF_IMMUTABLE) ? EXT2_IMMUTABLE : 0;
#endif
+ ip->i_e2fs_flags |=
+ (vap->va_flags & UF_NODUMP) ? EXT2_NODUMP : 0;
ip->i_flag |= IN_CHANGE;
if (vap->va_flags & (IMMUTABLE | APPEND))
return (0);
Home |
Main Index |
Thread Index |
Old Index