Module Name:    src
Committed By:   uebayasi
Date:           Thu Feb 11 05:22:38 UTC 2010

Modified Files:
        src/sys/ufs/ffs [uebayasi-xip]: ffs_vfsops.c

Log Message:
XIP hook for ffs.


To generate a diff of this commit:
cvs rdiff -u -r1.257 -r1.257.2.1 src/sys/ufs/ffs/ffs_vfsops.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/ufs/ffs/ffs_vfsops.c
diff -u src/sys/ufs/ffs/ffs_vfsops.c:1.257 src/sys/ufs/ffs/ffs_vfsops.c:1.257.2.1
--- src/sys/ufs/ffs/ffs_vfsops.c:1.257	Fri Feb  5 20:03:36 2010
+++ src/sys/ufs/ffs/ffs_vfsops.c	Thu Feb 11 05:22:38 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: ffs_vfsops.c,v 1.257 2010/02/05 20:03:36 mlelstv Exp $	*/
+/*	$NetBSD: ffs_vfsops.c,v 1.257.2.1 2010/02/11 05:22:38 uebayasi Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,12 +61,13 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.257 2010/02/05 20:03:36 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ffs_vfsops.c,v 1.257.2.1 2010/02/11 05:22:38 uebayasi Exp $");
 
 #if defined(_KERNEL_OPT)
 #include "opt_ffs.h"
 #include "opt_quota.h"
 #include "opt_wapbl.h"
+#include "opt_xip.h"
 #endif
 
 #include <sys/param.h>
@@ -1173,6 +1174,15 @@
 	mp->mnt_dev_bshift = DEV_BSHIFT;	/* XXX */
 	mp->mnt_flag |= MNT_LOCAL;
 	mp->mnt_iflag |= IMNT_MPSAFE;
+#ifdef XIP
+	paddr_t phys_addr = 0;
+	if ((VOP_IOCTL(devvp, DIOCGPHYSADDR, &phys_addr, FREAD,
+	    cred) == 0) &&
+	    phys_addr != 0) {
+		mp->mnt_iflag |= IMNT_XIP;
+		mp->mnt_phys_addr = phys_addr;
+	}
+#endif
 #ifdef FFS_EI
 	if (needswap)
 		ump->um_flags |= UFS_NEEDSWAP;
@@ -1748,6 +1758,12 @@
 
 	vp->v_vflag |= VV_LOCKSWORK;
 
+#ifdef XIP
+	if ((vp->v_mount->mnt_iflag & IMNT_XIP) != 0) {
+		vp->v_vflag |= VV_XIP;
+	}
+#endif
+
 	/*
 	 * XXX MFS ends up here, too, to allocate an inode.  Should we
 	 * XXX create another pool for MFS inodes?

Reply via email to