PERFORCE change 207689 for review
John Baldwin
jhb at FreeBSD.org
Fri Mar 9 18:18:16 UTC 2012
http://p4web.freebsd.org/@@207689?ac=10
Change 207689 by jhb at jhb_jhbbsd on 2012/03/09 18:17:54
IFC @207687
Affected files ...
.. //depot/projects/pci/sys/contrib/pf/net/if_pfsync.c#4 integrate
.. //depot/projects/pci/sys/dev/ath/if_ath.c#11 integrate
.. //depot/projects/pci/sys/dev/ath/if_ath_tx.c#4 integrate
.. //depot/projects/pci/sys/dev/bge/if_bgereg.h#6 integrate
.. //depot/projects/pci/sys/dev/mps/mps_pci.c#3 integrate
.. //depot/projects/pci/sys/dev/pci/pci.c#37 integrate
.. //depot/projects/pci/sys/dev/pci/pcireg.h#6 integrate
.. //depot/projects/pci/sys/dev/pci/pcivar.h#10 integrate
.. //depot/projects/pci/sys/dev/usb/serial/u3g.c#5 integrate
.. //depot/projects/pci/sys/dev/usb/usbdevs#8 integrate
.. //depot/projects/pci/sys/fs/ext2fs/ext2_alloc.c#4 integrate
.. //depot/projects/pci/sys/fs/ext2fs/ext2_dinode.h#4 integrate
.. //depot/projects/pci/sys/fs/ext2fs/ext2_inode_cnv.c#2 integrate
.. //depot/projects/pci/sys/fs/ext2fs/ext2_vfsops.c#5 integrate
.. //depot/projects/pci/sys/fs/ext2fs/ext2_vnops.c#4 integrate
.. //depot/projects/pci/sys/fs/ext2fs/ext2fs.h#4 integrate
.. //depot/projects/pci/sys/fs/ext2fs/inode.h#4 integrate
.. //depot/projects/pci/sys/fs/unionfs/union_subr.c#2 integrate
.. //depot/projects/pci/sys/geom/part/g_part_bsd.c#4 integrate
.. //depot/projects/pci/sys/kern/kern_clocksource.c#4 integrate
.. //depot/projects/pci/sys/kern/kern_descrip.c#8 integrate
.. //depot/projects/pci/sys/kern/kern_exec.c#5 integrate
.. //depot/projects/pci/sys/kern/kern_intr.c#6 integrate
.. //depot/projects/pci/sys/kern/kern_kthread.c#3 integrate
.. //depot/projects/pci/sys/kern/kern_thr.c#5 integrate
.. //depot/projects/pci/sys/kern/sched_4bsd.c#7 integrate
.. //depot/projects/pci/sys/kern/sched_ule.c#7 integrate
.. //depot/projects/pci/sys/kern/vfs_mount.c#8 integrate
.. //depot/projects/pci/sys/kern/vfs_subr.c#9 integrate
.. //depot/projects/pci/sys/kern/vfs_syscalls.c#6 integrate
.. //depot/projects/pci/sys/kern/vfs_vnops.c#4 integrate
.. //depot/projects/pci/sys/mips/conf/OCTEON1#7 integrate
.. //depot/projects/pci/sys/net80211/ieee80211_radiotap.c#3 integrate
.. //depot/projects/pci/sys/netinet/sctp_bsd_addr.c#4 integrate
.. //depot/projects/pci/sys/netinet/sctp_peeloff.c#3 integrate
.. //depot/projects/pci/sys/sys/mount.h#5 integrate
.. //depot/projects/pci/sys/sys/sched.h#2 integrate
.. //depot/projects/pci/sys/ufs/ffs/ffs_softdep.c#10 integrate
.. //depot/projects/pci/sys/ufs/ffs/ffs_vnops.c#7 integrate
.. //depot/projects/pci/sys/ufs/ufs/ufs_extattr.c#3 integrate
.. //depot/projects/pci/sys/vm/vnode_pager.c#5 integrate
.. //depot/projects/pci/sys/x86/include/endian.h#2 integrate
Differences ...
==== //depot/projects/pci/sys/contrib/pf/net/if_pfsync.c#4 (text+ko) ====
@@ -48,6 +48,7 @@
* 1.120, 1.175 - use monotonic time_uptime
* 1.122 - reduce number of updates for non-TCP sessions
* 1.128 - cleanups
+ * 1.146 - bzero() mbuf before sparsely filling it with data
* 1.170 - SIOCSIFMTU checks
*/
@@ -57,7 +58,7 @@
#include "opt_pf.h"
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/contrib/pf/net/if_pfsync.c,v 1.73 2012/01/17 12:14:26 glebius Exp $");
+__FBSDID("$FreeBSD: src/sys/contrib/pf/net/if_pfsync.c,v 1.74 2012/03/08 09:20:00 glebius Exp $");
#define NBPFILTER 1
#endif /* __FreeBSD__ */
@@ -2011,6 +2012,7 @@
{
struct pfsync_upd_c *up = (struct pfsync_upd_c *)(m->m_data + offset);
+ bzero(up, sizeof(*up));
up->id = st->id;
pf_state_peer_hton(&st->src, &up->src);
pf_state_peer_hton(&st->dst, &up->dst);
@@ -2023,8 +2025,6 @@
up->expire = htonl(up->expire - time_second);
up->timeout = st->timeout;
- bzero(up->_pad, sizeof(up->_pad)); /* XXX */
-
return (sizeof(*up));
}
==== //depot/projects/pci/sys/dev/ath/if_ath.c#11 (text+ko) ====
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.390 2012/03/02 03:11:53 adrian Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.391 2012/03/09 08:36:30 adrian Exp $");
/*
* Driver for the Atheros Wireless LAN controller.
@@ -2908,6 +2908,10 @@
static void
ath_txqmove(struct ath_txq *dst, struct ath_txq *src)
{
+
+ ATH_TXQ_LOCK_ASSERT(dst);
+ ATH_TXQ_LOCK_ASSERT(src);
+
TAILQ_CONCAT(&dst->axq_q, &src->axq_q, bf_list);
dst->axq_link = src->axq_link;
src->axq_link = NULL;
==== //depot/projects/pci/sys/dev/ath/if_ath_tx.c#4 (text+ko) ====
@@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath_tx.c,v 1.15 2012/01/11 00:16:44 adrian Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath_tx.c,v 1.16 2012/03/08 23:53:38 adrian Exp $");
/*
* Driver for the Atheros Wireless LAN controller.
@@ -623,19 +623,22 @@
ath_txq_restart_dma(struct ath_softc *sc, struct ath_txq *txq)
{
struct ath_hal *ah = sc->sc_ah;
- struct ath_buf *bf;
+ struct ath_buf *bf, *bf_last;
ATH_TXQ_LOCK_ASSERT(txq);
/* This is always going to be cleared, empty or not */
txq->axq_flags &= ~ATH_TXQ_PUTPENDING;
+ /* XXX make this ATH_TXQ_FIRST */
bf = TAILQ_FIRST(&txq->axq_q);
+ bf_last = ATH_TXQ_LAST(txq, axq_q_s);
+
if (bf == NULL)
return;
ath_hal_puttxbuf(ah, txq->axq_qnum, bf->bf_daddr);
- txq->axq_link = &bf->bf_lastds->ds_link;
+ txq->axq_link = &bf_last->bf_lastds->ds_link;
ath_hal_txstart(ah, txq->axq_qnum);
}
==== //depot/projects/pci/sys/dev/bge/if_bgereg.h#6 (text+ko) ====
@@ -30,7 +30,7 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/bge/if_bgereg.h,v 1.132 2012/01/19 20:21:59 yongari Exp $
+ * $FreeBSD: src/sys/dev/bge/if_bgereg.h,v 1.133 2012/03/09 16:05:11 jhb Exp $
*/
/*
==== //depot/projects/pci/sys/dev/mps/mps_pci.c#3 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/mps/mps_pci.c,v 1.5 2012/02/11 00:28:30 ken Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/mps/mps_pci.c,v 1.6 2012/03/07 22:39:11 ken Exp $");
/* PCI/PCI-X/PCIe bus interface for the LSI MPT2 controllers */
@@ -87,6 +87,7 @@
static devclass_t mps_devclass;
DRIVER_MODULE(mps, pci, mps_pci_driver, mps_devclass, 0, 0);
+MODULE_DEPEND(mps, cam, 1, 1, 1);
struct mps_ident {
uint16_t vendor;
==== //depot/projects/pci/sys/dev/pci/pci.c#37 (text+ko) ====
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/pci/pci.c,v 1.435 2012/03/07 18:57:09 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/pci/pci.c,v 1.436 2012/03/08 21:09:34 kan Exp $");
#include "opt_bus.h"
@@ -735,6 +735,7 @@
if ((cfg->hdrtype & PCIM_HDRTYPE) ==
PCIM_HDRTYPE_BRIDGE)
pcix_chipset = 1;
+ cfg->pcix.pcix_location = ptr;
break;
case PCIY_EXPRESS: /* PCI-express */
/*
@@ -4483,6 +4484,49 @@
return (0);
}
+static void
+pci_cfg_restore_pcie(device_t dev, struct pci_devinfo *dinfo)
+{
+#define WREG(n, v) pci_write_config(dev, pos + (n), (v), 2)
+ struct pcicfg_pcie *cfg;
+ int version, pos;
+
+ cfg = &dinfo->cfg.pcie;
+ pos = cfg->pcie_location;
+
+ version = cfg->pcie_flags & PCIM_EXP_FLAGS_VERSION;
+
+ WREG(PCIR_EXPRESS_DEVICE_CTL, cfg->pcie_device_ctl);
+
+ if (version > 1 || cfg->pcie_type == PCIM_EXP_TYPE_ROOT_PORT ||
+ cfg->pcie_type == PCIM_EXP_TYPE_ENDPOINT ||
+ cfg->pcie_type == PCIM_EXP_TYPE_LEGACY_ENDPOINT)
+ WREG(PCIR_EXPRESS_LINK_CTL, cfg->pcie_link_ctl);
+
+ if (version > 1 || (cfg->pcie_type == PCIM_EXP_TYPE_ROOT_PORT ||
+ (cfg->pcie_type == PCIM_EXP_TYPE_DOWNSTREAM_PORT &&
+ (cfg->pcie_flags & PCIM_EXP_FLAGS_SLOT))))
+ WREG(PCIR_EXPRESS_SLOT_CTL, cfg->pcie_slot_ctl);
+
+ if (version > 1 || cfg->pcie_type == PCIM_EXP_TYPE_ROOT_PORT ||
+ cfg->pcie_type == PCIM_EXP_TYPE_ROOT_EC)
+ WREG(PCIR_EXPRESS_ROOT_CTL, cfg->pcie_root_ctl);
+
+ if (version > 1) {
+ WREG(PCIR_EXPRESS_DEVICE_CTL2, cfg->pcie_device_ctl2);
+ WREG(PCIR_EXPRESS_LINK_CTL2, cfg->pcie_link_ctl2);
+ WREG(PCIR_EXPRESS_SLOT_CTL2, cfg->pcie_slot_ctl2);
+ }
+#undef WREG
+}
+
+static void
+pci_cfg_restore_pcix(device_t dev, struct pci_devinfo *dinfo)
+{
+ pci_write_config(dev, dinfo->cfg.pcix.pcix_location + PCIXR_COMMAND,
+ dinfo->cfg.pcix.pcix_command, 2);
+}
+
void
pci_cfg_restore(device_t dev, struct pci_devinfo *dinfo)
{
@@ -4518,6 +4562,14 @@
pci_write_config(dev, PCIR_PROGIF, dinfo->cfg.progif, 1);
pci_write_config(dev, PCIR_REVID, dinfo->cfg.revid, 1);
+ /*
+ * Restore extended capabilities for PCI-Express and PCI-X
+ */
+ if (dinfo->cfg.pcie.pcie_location != 0)
+ pci_cfg_restore_pcie(dev, dinfo);
+ if (dinfo->cfg.pcix.pcix_location != 0)
+ pci_cfg_restore_pcix(dev, dinfo);
+
/* Restore MSI and MSI-X configurations if they are present. */
if (dinfo->cfg.msi.msi_location != 0)
pci_resume_msi(dev);
@@ -4525,6 +4577,51 @@
pci_resume_msix(dev);
}
+static void
+pci_cfg_save_pcie(device_t dev, struct pci_devinfo *dinfo)
+{
+#define RREG(n) pci_read_config(dev, pos + (n), 2)
+ struct pcicfg_pcie *cfg;
+ int version, pos;
+
+ cfg = &dinfo->cfg.pcie;
+ pos = cfg->pcie_location;
+
+ cfg->pcie_flags = RREG(PCIR_EXPRESS_FLAGS);
+
+ version = cfg->pcie_flags & PCIM_EXP_FLAGS_VERSION;
+
+ cfg->pcie_device_ctl = RREG(PCIR_EXPRESS_DEVICE_CTL);
+
+ if (version > 1 || cfg->pcie_type == PCIM_EXP_TYPE_ROOT_PORT ||
+ cfg->pcie_type == PCIM_EXP_TYPE_ENDPOINT ||
+ cfg->pcie_type == PCIM_EXP_TYPE_LEGACY_ENDPOINT)
+ cfg->pcie_link_ctl = RREG(PCIR_EXPRESS_LINK_CTL);
+
+ if (version > 1 || (cfg->pcie_type == PCIM_EXP_TYPE_ROOT_PORT ||
+ (cfg->pcie_type == PCIM_EXP_TYPE_DOWNSTREAM_PORT &&
+ (cfg->pcie_flags & PCIM_EXP_FLAGS_SLOT))))
+ cfg->pcie_slot_ctl = RREG(PCIR_EXPRESS_SLOT_CTL);
+
+ if (version > 1 || cfg->pcie_type == PCIM_EXP_TYPE_ROOT_PORT ||
+ cfg->pcie_type == PCIM_EXP_TYPE_ROOT_EC)
+ cfg->pcie_root_ctl = RREG(PCIR_EXPRESS_ROOT_CTL);
+
+ if (version > 1) {
+ cfg->pcie_device_ctl2 = RREG(PCIR_EXPRESS_DEVICE_CTL2);
+ cfg->pcie_link_ctl2 = RREG(PCIR_EXPRESS_LINK_CTL2);
+ cfg->pcie_slot_ctl2 = RREG(PCIR_EXPRESS_SLOT_CTL2);
+ }
+#undef RREG
+}
+
+static void
+pci_cfg_save_pcix(device_t dev, struct pci_devinfo *dinfo)
+{
+ dinfo->cfg.pcix.pcix_command = pci_read_config(dev,
+ dinfo->cfg.pcix.pcix_location + PCIXR_COMMAND, 2);
+}
+
void
pci_cfg_save(device_t dev, struct pci_devinfo *dinfo, int setstate)
{
@@ -4567,6 +4664,12 @@
dinfo->cfg.progif = pci_read_config(dev, PCIR_PROGIF, 1);
dinfo->cfg.revid = pci_read_config(dev, PCIR_REVID, 1);
+ if (dinfo->cfg.pcie.pcie_location != 0)
+ pci_cfg_save_pcie(dev, dinfo);
+
+ if (dinfo->cfg.pcix.pcix_location != 0)
+ pci_cfg_save_pcix(dev, dinfo);
+
/*
* don't set the state for display devices, base peripherals and
* memory devices since bad things happen when they are powered down.
==== //depot/projects/pci/sys/dev/pci/pcireg.h#6 (text+ko) ====
@@ -23,7 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/pci/pcireg.h,v 1.84 2012/01/31 15:48:40 jhb Exp $
+ * $FreeBSD: src/sys/dev/pci/pcireg.h,v 1.85 2012/03/08 21:09:34 kan Exp $
*
*/
@@ -667,6 +667,16 @@
#define PCIR_EXPRESS_SLOT_STA 0x1a
#define PCIR_EXPRESS_ROOT_CTL 0x1c
#define PCIR_EXPRESS_ROOT_STA 0x20
+#define PCIR_EXPRESS_DEVICE_CTL2 40
+#define PCIM_EXPRESS_DEVICE_CTL2_ARI 0x20
+#define PCIM_EXPRESS_ID_ORDERED_REQ_EN 0x100
+#define PCIM_EXPRESS_ID_ORDERED_CMP_EN 0x200
+#define PCIM_EXPRESS_LTR_ENABLE 0x400
+#define PCIM_EXPRESS_OBFF_MSGA_ENABLE 0x2000
+#define PCIM_EXPRESS_OBFF_MSGB_ENABLE 0x4000
+#define PCIM_EXPRESS_OBFF_WAKE_ENABLE 0x6000
+#define PCIR_EXPRESS_LINK_CTL2 48
+#define PCIR_EXPRESS_SLOT_CTL2 56
/* MSI-X definitions */
#define PCIR_MSIX_CTRL 0x2
==== //depot/projects/pci/sys/dev/pci/pcivar.h#10 (text+ko) ====
@@ -23,7 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $FreeBSD: src/sys/dev/pci/pcivar.h,v 1.95 2012/03/03 18:08:57 jhb Exp $
+ * $FreeBSD: src/sys/dev/pci/pcivar.h,v 1.96 2012/03/08 21:09:34 kan Exp $
*
*/
@@ -127,6 +127,19 @@
struct pcicfg_pcie {
uint8_t pcie_location; /* Offset of PCI-e capability registers. */
uint8_t pcie_type; /* Device type. */
+ uint16_t pcie_flags; /* Device capabilities register. */
+ uint16_t pcie_device_ctl; /* Device control register. */
+ uint16_t pcie_link_ctl; /* Link control register. */
+ uint16_t pcie_slot_ctl; /* Slot control register. */
+ uint16_t pcie_root_ctl; /* Root control register. */
+ uint16_t pcie_device_ctl2; /* Second device control register. */
+ uint16_t pcie_link_ctl2; /* Second link control register. */
+ uint16_t pcie_slot_ctl2; /* Second slot control register. */
+};
+
+struct pcicfg_pcix {
+ uint16_t pcix_command;
+ uint8_t pcix_location; /* Offset of PCI-X capability registers. */
};
/* config header information common to all header types */
@@ -171,6 +184,7 @@
struct pcicfg_msix msix; /* PCI MSI-X */
struct pcicfg_ht ht; /* HyperTransport */
struct pcicfg_pcie pcie; /* PCI Express */
+ struct pcicfg_pcix pcix; /* PCI-X */
} pcicfgregs;
/* additional type 1 device config header information (PCI to PCI bridge) */
==== //depot/projects/pci/sys/dev/usb/serial/u3g.c#5 (text+ko) ====
@@ -16,7 +16,7 @@
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
- * $FreeBSD: src/sys/dev/usb/serial/u3g.c,v 1.58 2012/02/14 21:36:55 hselasky Exp $
+ * $FreeBSD: src/sys/dev/usb/serial/u3g.c,v 1.59 2012/03/08 07:22:41 hselasky Exp $
*/
/*
@@ -423,6 +423,7 @@
U3G_DEV(QUALCOMMINC, SURFSTICK, 0),
U3G_DEV(QUALCOMMINC, E2002, 0),
U3G_DEV(QUALCOMMINC, E2003, 0),
+ U3G_DEV(QUALCOMMINC, K3772_Z, U3GINIT_SCSIEJECT),
U3G_DEV(QUALCOMMINC, MF626, 0),
U3G_DEV(QUALCOMMINC, MF628, 0),
U3G_DEV(QUALCOMMINC, MF633R, 0),
==== //depot/projects/pci/sys/dev/usb/usbdevs#8 (text+ko) ====
@@ -1,4 +1,4 @@
-$FreeBSD: src/sys/dev/usb/usbdevs,v 1.532 2012/02/28 15:45:42 kevlo Exp $
+$FreeBSD: src/sys/dev/usb/usbdevs,v 1.533 2012/03/08 07:22:41 hselasky Exp $
/* $NetBSD: usbdevs,v 1.392 2004/12/29 08:38:44 imp Exp $ */
/*-
@@ -2750,6 +2750,7 @@
product QUALCOMMINC E0082 0x0082 3G modem
product QUALCOMMINC E0086 0x0086 3G modem
product QUALCOMMINC SURFSTICK 0x0117 1&1 Surf Stick
+product QUALCOMMINC K3772_Z 0x1179 3G modem
product QUALCOMMINC ZTE_STOR 0x2000 USB ZTE Storage
product QUALCOMMINC E2002 0x2002 3G modem
product QUALCOMMINC E2003 0x2003 3G modem
==== //depot/projects/pci/sys/fs/ext2fs/ext2_alloc.c#4 (text+ko) ====
@@ -33,7 +33,7 @@
* SUCH DAMAGE.
*
* @(#)ffs_alloc.c 8.8 (Berkeley) 2/21/94
- * $FreeBSD: src/sys/fs/ext2fs/ext2_alloc.c,v 1.12 2012/01/01 20:47:33 ed Exp $
+ * $FreeBSD: src/sys/fs/ext2fs/ext2_alloc.c,v 1.13 2012/03/08 21:06:05 pfg Exp $
*/
#include <sys/param.h>
@@ -344,6 +344,7 @@
struct ucred *cred;
struct vnode **vpp;
{
+ struct timespec ts;
struct inode *pip;
struct m_ext2fs *fs;
struct inode *ip;
@@ -385,14 +386,14 @@
}
ip = VTOI(*vpp);
- /*
- the question is whether using VGET was such good idea at all -
- Linux doesn't read the old inode in when it's allocating a
- new one. I will set at least i_size & i_blocks the zero.
- */
- ip->i_mode = 0;
+ /*
+ * The question is whether using VGET was such good idea at all:
+ * Linux doesn't read the old inode in when it is allocating a
+ * new one. I will set at least i_size and i_blocks to zero.
+ */
ip->i_size = 0;
ip->i_blocks = 0;
+ ip->i_mode = 0;
ip->i_flags = 0;
/* now we want to make sure that the block pointers are zeroed out */
for (i = 0; i < NDADDR; i++)
@@ -406,6 +407,11 @@
*/
if (ip->i_gen == 0 || ++ip->i_gen == 0)
ip->i_gen = random() / 2 + 1;
+
+ vfs_timestamp(&ts);
+ ip->i_birthtime = ts.tv_sec;
+ ip->i_birthnsec = ts.tv_nsec;
+
/*
printf("ext2_valloc: allocated inode %d\n", ino);
*/
==== //depot/projects/pci/sys/fs/ext2fs/ext2_dinode.h#4 (text+ko) ====
@@ -23,7 +23,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: src/sys/fs/ext2fs/ext2_dinode.h,v 1.5 2012/02/07 22:31:28 pfg Exp $
+ * $FreeBSD: src/sys/fs/ext2fs/ext2_dinode.h,v 1.6 2012/03/08 21:06:05 pfg Exp $
*/
#ifndef _FS_EXT2FS_EXT2_DINODE_H_
@@ -61,6 +61,16 @@
#define EXT2_NODUMP 0x00000040 /* do not dump file */
#define EXT2_NOATIME 0x00000080 /* do not update atime */
+/*
+ * Definitions for nanosecond timestamps.
+ * Ext3 inode versioning, 2006-12-13.
+ */
+#define EXT3_EPOCH_BITS 2
+#define EXT3_EPOCH_MASK ((1 << EXT3_EPOCH_BITS) - 1)
+#define EXT3_NSEC_MASK (~0UL << EXT3_EPOCH_BITS)
+
+#define E2DI_HAS_XTIME(ip) (EXT2_INODE_SIZE((ip)->i_e2fs) > \
+ E2FS_REV0_INODE_SIZE)
/*
* Structure of an inode on the disk
@@ -77,7 +87,7 @@
uint16_t e2di_nlink; /* 26: File link count */
uint32_t e2di_nblock; /* 28: Blocks count */
uint32_t e2di_flags; /* 32: Status flags (chflags) */
- uint32_t e2di_linux_reserved1; /* 36 */
+ uint32_t e2di_version; /* 36: Low 32 bits inode version */
uint32_t e2di_blocks[EXT2_N_BLOCKS]; /* 40: disk blocks */
uint32_t e2di_gen; /* 100: generation number */
uint32_t e2di_facl; /* 104: file ACL (not implemented) */
@@ -91,6 +101,12 @@
uint32_t e2di_linux_reserved3; /* 124 */
uint16_t e2di_extra_isize;
uint16_t e2di_pad1;
+ uint32_t e2di_ctime_extra; /* Extra change time */
+ uint32_t e2di_mtime_extra; /* Extra modification time */
+ uint32_t e2di_atime_extra; /* Extra access time */
+ uint32_t e2di_crtime; /* Creation (birth)time */
+ uint32_t e2di_crtime_extra; /* Extra creation (birth)time */
+ uint32_t e2di_version_hi; /* High 30 bits of inode version */
};
#endif /* !_FS_EXT2FS_EXT2_DINODE_H_ */
==== //depot/projects/pci/sys/fs/ext2fs/ext2_inode_cnv.c#2 (text+ko) ====
@@ -19,7 +19,7 @@
* improvements that they make and grant CSL redistribution rights.
*
* Utah $Hdr$
- * $FreeBSD: src/sys/fs/ext2fs/ext2_inode_cnv.c,v 1.1 2010/01/14 14:30:54 lulf Exp $
+ * $FreeBSD: src/sys/fs/ext2fs/ext2_inode_cnv.c,v 1.2 2012/03/08 21:06:05 pfg Exp $
*/
/*
@@ -36,6 +36,9 @@
#include <fs/ext2fs/ext2_extern.h>
#include <fs/ext2fs/ext2_dinode.h>
+#define XTIME_TO_NSEC(x) ((x & EXT3_NSEC_MASK) >> 2)
+#define NSEC_TO_XTIME(t) ((t << 2) & EXT3_NSEC_MASK)
+
void
ext2_print_inode( in )
struct inode *in;
@@ -83,6 +86,13 @@
ip->i_atime = ei->e2di_atime;
ip->i_mtime = ei->e2di_mtime;
ip->i_ctime = ei->e2di_ctime;
+ if (E2DI_HAS_XTIME(ip)) {
+ ip->i_atimensec = XTIME_TO_NSEC(ei->e2di_atime_extra);
+ ip->i_mtimensec = XTIME_TO_NSEC(ei->e2di_mtime_extra);
+ ip->i_ctimensec = XTIME_TO_NSEC(ei->e2di_ctime_extra);
+ ip->i_birthtime = ei->e2di_crtime;
+ ip->i_birthnsec = XTIME_TO_NSEC(ei->e2di_crtime_extra);
+ }
ip->i_flags = 0;
ip->i_flags |= (ei->e2di_flags & EXT2_APPEND) ? SF_APPEND : 0;
ip->i_flags |= (ei->e2di_flags & EXT2_IMMUTABLE) ? SF_IMMUTABLE : 0;
@@ -121,6 +131,13 @@
ei->e2di_atime = ip->i_atime;
ei->e2di_mtime = ip->i_mtime;
ei->e2di_ctime = ip->i_ctime;
+ if (E2DI_HAS_XTIME(ip)) {
+ ei->e2di_ctime_extra = NSEC_TO_XTIME(ip->i_ctimensec);
+ ei->e2di_mtime_extra = NSEC_TO_XTIME(ip->i_mtimensec);
+ ei->e2di_atime_extra = NSEC_TO_XTIME(ip->i_atimensec);
+ ei->e2di_crtime = ip->i_birthtime;
+ ei->e2di_crtime_extra = NSEC_TO_XTIME(ip->i_birthnsec);
+ }
ei->e2di_flags = ip->i_flags;
ei->e2di_flags = 0;
ei->e2di_flags |= (ip->i_flags & SF_APPEND) ? EXT2_APPEND: 0;
==== //depot/projects/pci/sys/fs/ext2fs/ext2_vfsops.c#5 (text+ko) ====
@@ -33,7 +33,7 @@
* SUCH DAMAGE.
*
* @(#)ffs_vfsops.c 8.8 (Berkeley) 4/18/94
- * $FreeBSD: src/sys/fs/ext2fs/ext2_vfsops.c,v 1.8 2011/12/16 15:47:43 pfg Exp $
+ * $FreeBSD: src/sys/fs/ext2fs/ext2_vfsops.c,v 1.9 2012/03/08 21:06:05 pfg Exp $
*/
#include <sys/param.h>
@@ -47,6 +47,7 @@
#include <sys/bio.h>
#include <sys/buf.h>
#include <sys/conf.h>
+#include <sys/endian.h>
#include <sys/fcntl.h>
#include <sys/malloc.h>
#include <sys/stat.h>
@@ -339,14 +340,21 @@
/*
* Simple sanity check for superblock inode size value.
*/
- if (fs->e2fs_isize < E2FS_REV0_INODE_SIZE ||
- fs->e2fs_isize > fs->e2fs_bsize ||
+ if (EXT2_INODE_SIZE(fs) < E2FS_REV0_INODE_SIZE ||
+ EXT2_INODE_SIZE(fs) > fs->e2fs_bsize ||
(fs->e2fs_isize & (fs->e2fs_isize - 1)) != 0) {
- printf("EXT2-fs: invalid inode size %d\n",
+ printf("ext2fs: invalid inode size %d\n",
fs->e2fs_isize);
return (EIO);
}
}
+ /* Check for extra isize in big inodes. */
+ if (EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT4F_ROCOMPAT_EXTRA_ISIZE) &&
+ EXT2_INODE_SIZE(fs) < sizeof(struct ext2fs_dinode)) {
+ printf("ext2fs: no space for extra inode timestamps\n");
+ return (EINVAL);
+ }
+
fs->e2fs_ipb = fs->e2fs_bsize / EXT2_INODE_SIZE(fs);
fs->e2fs_itpg = fs->e2fs_ipg /fs->e2fs_ipb;
fs->e2fs_descpb = fs->e2fs_bsize / sizeof(struct ext2_gd);
@@ -358,8 +366,8 @@
fs->e2fs_gdbcount = db_count;
fs->e2fs_gd = malloc(db_count * fs->e2fs_bsize,
M_EXT2MNT, M_WAITOK);
- fs->e2fs_contigdirs = malloc(fs->e2fs_gcount * sizeof(*fs->e2fs_contigdirs),
- M_EXT2MNT, M_WAITOK);
+ fs->e2fs_contigdirs = malloc(fs->e2fs_gcount *
+ sizeof(*fs->e2fs_contigdirs), M_EXT2MNT, M_WAITOK);
/*
* Adjust logic_sb_block.
@@ -390,7 +398,7 @@
fs->e2fs_contigdirs[i] = 0;
}
if (es->e2fs_rev == E2FS_REV0 ||
- (es->e2fs_features_rocompat & EXT2F_ROCOMPAT_LARGEFILE) == 0)
+ !EXT2_HAS_RO_COMPAT_FEATURE(fs, EXT2F_ROCOMPAT_LARGEFILE))
fs->e2fs_maxfilesize = 0x7fffffff;
else
fs->e2fs_maxfilesize = 0x7fffffffffffffff;
@@ -967,8 +975,6 @@
ip->i_block_group = ino_to_cg(fs, ino);
ip->i_next_alloc_block = 0;
ip->i_next_alloc_goal = 0;
- ip->i_prealloc_count = 0;
- ip->i_prealloc_block = 0;
/*
* Now we want to make sure that block pointers for unused
==== //depot/projects/pci/sys/fs/ext2fs/ext2_vnops.c#4 (text+ko) ====
@@ -39,7 +39,7 @@
*
* @(#)ufs_vnops.c 8.7 (Berkeley) 2/3/94
* @(#)ufs_vnops.c 8.27 (Berkeley) 5/27/95
- * $FreeBSD: src/sys/fs/ext2fs/ext2_vnops.c,v 1.8 2011/12/16 15:47:43 pfg Exp $
+ * $FreeBSD: src/sys/fs/ext2fs/ext2_vnops.c,v 1.9 2012/03/08 21:06:05 pfg Exp $
*/
#include "opt_suiddir.h"
@@ -360,11 +360,15 @@
vap->va_rdev = ip->i_rdev;
vap->va_size = ip->i_size;
vap->va_atime.tv_sec = ip->i_atime;
- vap->va_atime.tv_nsec = ip->i_atimensec;
+ vap->va_atime.tv_nsec = E2DI_HAS_XTIME(ip) ? ip->i_atimensec : 0;
vap->va_mtime.tv_sec = ip->i_mtime;
- vap->va_mtime.tv_nsec = ip->i_mtimensec;
+ vap->va_mtime.tv_nsec = E2DI_HAS_XTIME(ip) ? ip->i_mtimensec : 0;
vap->va_ctime.tv_sec = ip->i_ctime;
- vap->va_ctime.tv_nsec = ip->i_ctimensec;
+ vap->va_ctime.tv_nsec = E2DI_HAS_XTIME(ip) ? ip->i_ctimensec : 0;
+ if E2DI_HAS_XTIME(ip) {
+ vap->va_birthtime.tv_sec = ip->i_birthtime;
+ vap->va_birthtime.tv_nsec = ip->i_birthnsec;
+ }
vap->va_flags = ip->i_flags;
vap->va_gen = ip->i_gen;
vap->va_blocksize = vp->v_mount->mnt_stat.f_iosize;
@@ -501,6 +505,8 @@
ip->i_mtime = vap->va_mtime.tv_sec;
ip->i_mtimensec = vap->va_mtime.tv_nsec;
}
+ ip->i_birthtime = vap->va_birthtime.tv_sec;
+ ip->i_birthnsec = vap->va_birthtime.tv_nsec;
error = ext2_update(vp, 0);
if (error)
return (error);
==== //depot/projects/pci/sys/fs/ext2fs/ext2fs.h#4 (text+ko) ====
@@ -4,7 +4,7 @@
* Aug 1995, Godmar Back (gback at cs.utah.edu)
* University of Utah, Department of Computer Science
*
- * $FreeBSD: src/sys/fs/ext2fs/ext2fs.h,v 1.9 2012/02/07 22:31:28 pfg Exp $
+ * $FreeBSD: src/sys/fs/ext2fs/ext2fs.h,v 1.10 2012/03/08 21:06:05 pfg Exp $
*/
/*-
* Copyright (c) 2009 Aditya Sarawgi
@@ -129,7 +129,7 @@
uint32_t e4fs_rbcount_hi; /* reserved blocks count */
uint32_t e4fs_fbcount_hi; /* free blocks count */
uint16_t e4fs_min_extra_isize;/* all inodes have at least some bytes */
- uint16_t e4fs_want_extra_isize; /* new inodes should reserve some bytes */
+ uint16_t e4fs_want_extra_isize; /* inodes must reserve some bytes */
uint32_t e4fs_flags; /* miscellaneous flags */
uint16_t e4fs_raid_stride; /* RAID stride */
uint16_t e4fs_mmpintv; /* number of seconds to wait in MMP checking */
@@ -214,6 +214,7 @@
#define EXT2F_ROCOMPAT_SPARSESUPER 0x0001
#define EXT2F_ROCOMPAT_LARGEFILE 0x0002
#define EXT2F_ROCOMPAT_BTREE_DIR 0x0004
+#define EXT4F_ROCOMPAT_EXTRA_ISIZE 0x0040
#define EXT2F_INCOMPAT_COMP 0x0001
#define EXT2F_INCOMPAT_FTYPE 0x0002
@@ -227,8 +228,9 @@
* - EXT2F_INCOMPAT_FTYPE
*/
#define EXT2F_COMPAT_SUPP 0x0000
-#define EXT2F_ROCOMPAT_SUPP (EXT2F_ROCOMPAT_SPARSESUPER \
- | EXT2F_ROCOMPAT_LARGEFILE)
+#define EXT2F_ROCOMPAT_SUPP (EXT2F_ROCOMPAT_SPARSESUPER | \
+ EXT2F_ROCOMPAT_LARGEFILE | \
+ EXT4F_ROCOMPAT_EXTRA_ISIZE)
#define EXT2F_INCOMPAT_SUPP EXT2F_INCOMPAT_FTYPE
/* Assume that user mode programs are passing in an ext2fs superblock, not
==== //depot/projects/pci/sys/fs/ext2fs/inode.h#4 (text+ko) ====
@@ -32,7 +32,7 @@
* SUCH DAMAGE.
*
* @(#)inode.h 8.9 (Berkeley) 5/14/95
- * $FreeBSD: src/sys/fs/ext2fs/inode.h,v 1.7 2012/02/07 22:31:28 pfg Exp $
+ * $FreeBSD: src/sys/fs/ext2fs/inode.h,v 1.8 2012/03/08 21:06:05 pfg Exp $
*/
#ifndef _FS_EXT2FS_INODE_H_
@@ -77,8 +77,6 @@
uint32_t i_block_group;
uint32_t i_next_alloc_block;
uint32_t i_next_alloc_goal;
- uint32_t i_prealloc_block;
- uint32_t i_prealloc_count;
/* Fields from struct dinode in UFS. */
uint16_t i_mode; /* IFMT, permissions; see below. */
==== //depot/projects/pci/sys/fs/unionfs/union_subr.c#2 (text+ko) ====
@@ -33,7 +33,7 @@
* SUCH DAMAGE.
*
* @(#)union_subr.c 8.20 (Berkeley) 5/20/95
- * $FreeBSD: src/sys/fs/unionfs/union_subr.c,v 1.115 2010/08/25 21:32:08 trasz Exp $
+ * $FreeBSD: src/sys/fs/unionfs/union_subr.c,v 1.116 2012/03/08 20:27:20 jhb Exp $
*/
#include <sys/param.h>
@@ -952,6 +952,8 @@
goto unionfs_vn_create_on_upper_free_out1;
}
vp->v_writecount++;
+ CTR3(KTR_VFS, "%s: vp %p v_writecount increased to %d", __func__, vp,
+ vp->v_writecount);
*vpp = vp;
unionfs_vn_create_on_upper_free_out1:
@@ -1087,6 +1089,8 @@
}
VOP_CLOSE(uvp, FWRITE, cred, td);
uvp->v_writecount--;
+ CTR3(KTR_VFS, "%s: vp %p v_writecount decreased to %d", __func__, uvp,
+ uvp->v_writecount);
vn_finished_write(mp);
==== //depot/projects/pci/sys/geom/part/g_part_bsd.c#4 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/geom/part/g_part_bsd.c,v 1.23 2011/06/20 12:22:30 ae Exp $");
+__FBSDID("$FreeBSD: src/sys/geom/part/g_part_bsd.c,v 1.24 2012/03/08 01:48:44 emaste Exp $");
#include <sys/param.h>
#include <sys/bio.h>
@@ -389,10 +389,6 @@
goto invalid_label;
if (heads != basetable->gpt_heads && !basetable->gpt_fixgeom)
basetable->gpt_heads = heads;
- if (sectors != basetable->gpt_sectors || heads != basetable->gpt_heads)
- printf("GEOM: %s: geometry does not match label"
- " (%uh,%us != %uh,%us).\n", pp->name, heads, sectors,
- basetable->gpt_heads, basetable->gpt_sectors);
chs = le32dec(buf + 60);
if (chs < 1)
@@ -402,9 +398,6 @@
chs = msize;
le32enc(buf + 60, msize);
}
- if (chs != msize)
- printf("GEOM: %s: media size does not match label.\n",
- pp->name);
basetable->gpt_first = 0;
basetable->gpt_last = msize - 1;
==== //depot/projects/pci/sys/kern/kern_clocksource.c#4 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_clocksource.c,v 1.17 2011/06/22 16:40:45 jkim Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_clocksource.c,v 1.18 2012/03/09 07:30:48 mav Exp $");
/*
* Common routines to manage event timers hardware.
@@ -854,10 +854,11 @@
* If timer is global - there is chance it is already programmed.
*/
if (periodic || (timer->et_flags & ET_FLAGS_PERCPU) == 0) {
- state->nextevent = state->nexthard;
tmp = hardperiod;
bintime_mul(&tmp, ticks - 1);
- bintime_add(&state->nextevent, &tmp);
+ bintime_add(&tmp, &state->nexthard);
+ if (bintime_cmp(&tmp, &state->nextevent, <))
+ state->nextevent = tmp;
if (periodic ||
bintime_cmp(&state->nextevent, &nexttick, >=)) {
ET_HW_UNLOCK(state);
==== //depot/projects/pci/sys/kern/kern_descrip.c#8 (text+ko) ====
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_descrip.c,v 1.383 2011/11/15 01:48:53 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_descrip.c,v 1.384 2012/03/08 20:34:13 pho Exp $");
#include "opt_capsicum.h"
#include "opt_compat.h"
@@ -104,6 +104,8 @@
"file desc to leader structures");
static MALLOC_DEFINE(M_SIGIO, "sigio", "sigio structures");
+MALLOC_DECLARE(M_FADVISE);
+
static uma_zone_t file_zone;
@@ -2577,6 +2579,7 @@
error = fo_close(fp, td);
atomic_subtract_int(&openfiles, 1);
crfree(fp->f_cred);
+ free(fp->f_advice, M_FADVISE);
uma_zfree(file_zone, fp);
return (error);
==== //depot/projects/pci/sys/kern/kern_exec.c#5 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_exec.c,v 1.367 2012/01/19 23:03:31 kib Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_exec.c,v 1.368 2012/03/08 19:41:05 jhb Exp $");
#include "opt_capsicum.h"
#include "opt_hwpmc_hooks.h"
@@ -57,6 +57,7 @@
#include <sys/pioctl.h>
#include <sys/namei.h>
#include <sys/resourcevar.h>
+#include <sys/sched.h>
#include <sys/sdt.h>
#include <sys/sf_buf.h>
#include <sys/syscallsubr.h>
@@ -636,6 +637,9 @@
else if (vn_commname(binvp, p->p_comm, sizeof(p->p_comm)) != 0)
bcopy(fexecv_proc_title, p->p_comm, sizeof(fexecv_proc_title));
bcopy(p->p_comm, td->td_name, sizeof(td->td_name));
+#ifdef KTR
+ sched_clear_tdname(td);
+#endif
/*
* mark as execed, wakeup the process that vforked (if any) and tell
==== //depot/projects/pci/sys/kern/kern_intr.c#6 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_intr.c,v 1.183 2012/01/16 20:42:56 pluknet Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_intr.c,v 1.184 2012/03/08 19:41:05 jhb Exp $");
#include "opt_ddb.h"
@@ -180,6 +180,9 @@
/* Update name and priority. */
strlcpy(td->td_name, ie->ie_fullname, sizeof(td->td_name));
+#ifdef KTR
+ sched_clear_tdname(td);
+#endif
thread_lock(td);
sched_prio(td, pri);
thread_unlock(td);
==== //depot/projects/pci/sys/kern/kern_kthread.c#3 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_kthread.c,v 1.62 2012/02/04 16:49:29 rstone Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_kthread.c,v 1.63 2012/03/08 19:41:05 jhb Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -115,6 +115,9 @@
va_start(ap, fmt);
vsnprintf(td->td_name, sizeof(td->td_name), fmt, ap);
va_end(ap);
+#ifdef KTR
+ sched_clear_tdname(td);
+#endif
/* call the processes' main()... */
cpu_set_fork_handler(td, func, arg);
@@ -453,6 +456,9 @@
va_start(ap, fmt);
vsnprintf(td->td_name, sizeof(td->td_name), fmt, ap);
va_end(ap);
+#ifdef KTR
+ sched_clear_tdname(td);
+#endif
return (0);
}
va_start(ap, fmt);
==== //depot/projects/pci/sys/kern/kern_thr.c#5 (text+ko) ====
@@ -25,7 +25,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/kern_thr.c,v 1.98 2011/12/13 00:38:50 eadler Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/kern_thr.c,v 1.99 2012/03/08 19:41:05 jhb Exp $");
#include "opt_compat.h"
#include "opt_posix.h"
@@ -548,6 +548,9 @@
if (ttd == NULL)
return (ESRCH);
strcpy(ttd->td_name, name);
+#ifdef KTR
+ sched_clear_tdname(ttd);
+#endif
PROC_UNLOCK(p);
return (error);
}
==== //depot/projects/pci/sys/kern/sched_4bsd.c#7 (text+ko) ====
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/kern/sched_4bsd.c,v 1.160 2012/01/03 21:03:28 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/kern/sched_4bsd.c,v 1.161 2012/03/08 19:41:05 jhb Exp $");
#include "opt_hwpmc_hooks.h"
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list