Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/ufs/lfs Teach LFS_ORPHAN_NEXTFREE about lfs64.



details:   https://anonhg.NetBSD.org/src/rev/b039f26441c7
branches:  trunk
changeset: 745137:b039f26441c7
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sun Feb 23 08:49:34 2020 +0000

description:
Teach LFS_ORPHAN_NEXTFREE about lfs64.

diffstat:

 sys/ufs/lfs/lfs.h       |  7 ++++---
 sys/ufs/lfs/lfs_alloc.c |  8 ++++----
 2 files changed, 8 insertions(+), 7 deletions(-)

diffs (56 lines):

diff -r d4f8b9024ef1 -r b039f26441c7 sys/ufs/lfs/lfs.h
--- a/sys/ufs/lfs/lfs.h Sun Feb 23 08:42:53 2020 +0000
+++ b/sys/ufs/lfs/lfs.h Sun Feb 23 08:49:34 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs.h,v 1.204 2019/01/10 06:31:04 martin Exp $ */
+/*     $NetBSD: lfs.h,v 1.205 2020/02/23 08:49:34 riastradh Exp $      */
 
 /*  from NetBSD: dinode.h,v 1.25 2016/01/22 23:06:10 dholland Exp  */
 /*  from NetBSD: dir.h,v 1.25 2015/09/01 06:16:03 dholland Exp  */
@@ -596,8 +596,9 @@
 
 /* magic value for daddrs */
 #define        LFS_UNUSED_DADDR        0       /* out-of-band daddr */
-/* magic value for if_nextfree */
-#define LFS_ORPHAN_NEXTFREE    (~(uint32_t)0) /* indicate orphaned file */
+/* magic value for if_nextfree -- indicate orphaned file */
+#define LFS_ORPHAN_NEXTFREE(fs) \
+       ((fs)->lfs_is64 ? ~(uint64_t)0 : ~(uint32_t)0)
 
 typedef struct ifile64 IFILE64;
 struct ifile64 {
diff -r d4f8b9024ef1 -r b039f26441c7 sys/ufs/lfs/lfs_alloc.c
--- a/sys/ufs/lfs/lfs_alloc.c   Sun Feb 23 08:42:53 2020 +0000
+++ b/sys/ufs/lfs/lfs_alloc.c   Sun Feb 23 08:49:34 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lfs_alloc.c,v 1.139 2020/02/22 00:32:08 kamil Exp $    */
+/*     $NetBSD: lfs_alloc.c,v 1.140 2020/02/23 08:49:34 riastradh Exp $        */
 
 /*-
  * Copyright (c) 1999, 2000, 2001, 2002, 2003, 2007 The NetBSD Foundation, Inc.
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lfs_alloc.c,v 1.139 2020/02/22 00:32:08 kamil Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lfs_alloc.c,v 1.140 2020/02/23 08:49:34 riastradh Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_quota.h"
@@ -757,7 +757,7 @@
                 * but presumably it doesn't work... not sure what
                 * happens to such files currently. -- dholland 20160806
                 */
-               if (lfs_if_getnextfree(fs, ifp) == LFS_ORPHAN_NEXTFREE &&
+               if (lfs_if_getnextfree(fs, ifp) == LFS_ORPHAN_NEXTFREE(fs) &&
                    VFS_VGET(fs->lfs_ivnode->v_mount, ino, LK_EXCLUSIVE, &vp)
                     == 0) {
                        unsigned segno;
@@ -852,6 +852,6 @@
        struct buf *bp;
 
        LFS_IENTRY(ifp, fs, ino, bp);
-       lfs_if_setnextfree(fs, ifp, LFS_ORPHAN_NEXTFREE);
+       lfs_if_setnextfree(fs, ifp, LFS_ORPHAN_NEXTFREE(fs));
        LFS_BWRITE_LOG(bp);
 }



Home | Main Index | Thread Index | Old Index