[Runnix-commits] SF.net SVN: runnix:[103] trunk/target/device
Status: Alpha
Brought to you by:
krisk84
From: <ppr...@us...> - 2010-07-11 21:49:22
|
Revision: 103 http://runnix.svn.sourceforge.net/runnix/?rev=103&view=rev Author: pprindeville Date: 2010-07-11 21:49:15 +0000 (Sun, 11 Jul 2010) Log Message: ----------- Update patches for 2.6.27 Modified Paths: -------------- trunk/target/device/geni586/linux.config Added Paths: ----------- trunk/target/device/kernel-patches/linux-2.6.27-15-routes.patch trunk/target/device/kernel-patches/linux-2.6.27-rc4-squash3.4.patch trunk/target/device/kernel-patches/linux-2.6.27.21-imq.patch trunk/target/device/kernel-patches/linux-2.6.27.34-unionfs-2.5.3.patch Removed Paths: ------------- trunk/target/device/kernel-patches/linux-2.6.25-imq5.patch trunk/target/device/kernel-patches/linux-2.6.25-squashfs3.4.patch trunk/target/device/kernel-patches/linux-2.6.26-15-routes.patch trunk/target/device/kernel-patches/linux-2.6.26.8-unionfs2.5.1.patch trunk/target/device/kernel-patches/linux-wanpipe.patch Modified: trunk/target/device/geni586/linux.config =================================================================== --- trunk/target/device/geni586/linux.config 2010-07-11 21:30:22 UTC (rev 102) +++ trunk/target/device/geni586/linux.config 2010-07-11 21:49:15 UTC (rev 103) @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit -# Linux kernel version: 2.6.26.8 -# Wed Mar 3 15:26:16 2010 +# Linux kernel version: 2.6.27.48 +# Sun Jul 11 15:46:31 2010 # # CONFIG_64BIT is not set CONFIG_X86_32=y @@ -23,7 +23,7 @@ CONFIG_GENERIC_IOMAP=y CONFIG_GENERIC_BUG=y CONFIG_GENERIC_HWEIGHT=y -# CONFIG_GENERIC_GPIO is not set +CONFIG_GENERIC_GPIO=y CONFIG_ARCH_MAY_HAVE_PC_FDC=y # CONFIG_RWSEM_GENERIC_SPINLOCK is not set CONFIG_RWSEM_XCHGADD_ALGORITHM=y @@ -33,6 +33,7 @@ CONFIG_GENERIC_CALIBRATE_DELAY=y # CONFIG_GENERIC_TIME_VSYSCALL is not set CONFIG_ARCH_HAS_CPU_RELAX=y +CONFIG_ARCH_HAS_DEFAULT_IDLE=y CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y # CONFIG_HAVE_SETUP_PER_CPU_AREA is not set # CONFIG_HAVE_CPUMASK_OF_CPU_MAP is not set @@ -91,7 +92,6 @@ # CONFIG_EMBEDDED is not set CONFIG_UID16=y CONFIG_SYSCTL_SYSCALL=y -CONFIG_SYSCTL_SYSCALL_CHECK=y CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_HOTPLUG=y @@ -115,10 +115,16 @@ # CONFIG_PROFILING is not set # CONFIG_MARKERS is not set CONFIG_HAVE_OPROFILE=y +CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS=y +CONFIG_HAVE_IOREMAP_PROT=y CONFIG_HAVE_KPROBES=y CONFIG_HAVE_KRETPROBES=y +# CONFIG_HAVE_ARCH_TRACEHOOK is not set # CONFIG_HAVE_DMA_ATTRS is not set +# CONFIG_USE_GENERIC_SMP_HELPERS is not set +# CONFIG_HAVE_CLK is not set CONFIG_PROC_PAGE_MONITOR=y +CONFIG_HAVE_GENERIC_DMA_COHERENT=y CONFIG_SLABINFO=y CONFIG_RT_MUTEXES=y # CONFIG_TINY_SHMEM is not set @@ -129,6 +135,7 @@ # CONFIG_BLK_DEV_IO_TRACE is not set CONFIG_LSF=y # CONFIG_BLK_DEV_BSG is not set +# CONFIG_BLK_DEV_INTEGRITY is not set # # IO Schedulers @@ -155,16 +162,12 @@ CONFIG_X86_PC=y # CONFIG_X86_ELAN is not set # CONFIG_X86_VOYAGER is not set -# CONFIG_X86_NUMAQ is not set -# CONFIG_X86_SUMMIT is not set -# CONFIG_X86_BIGSMP is not set -# CONFIG_X86_VISWS is not set # CONFIG_X86_GENERICARCH is not set -# CONFIG_X86_ES7000 is not set +# CONFIG_X86_VSMP is not set # CONFIG_X86_RDC321X is not set -# CONFIG_X86_VSMP is not set CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y # CONFIG_PARAVIRT_GUEST is not set +CONFIG_MEMTEST=y # CONFIG_M386 is not set # CONFIG_M486 is not set # CONFIG_M586 is not set @@ -203,7 +206,6 @@ CONFIG_X86_BSWAP=y CONFIG_X86_POPAD_OK=y CONFIG_X86_ALIGNMENT_16=y -CONFIG_X86_GOOD_APIC=y CONFIG_X86_INTEL_USERCOPY=y CONFIG_X86_TSC=y CONFIG_X86_MINIMUM_CPU_FAMILY=4 @@ -246,7 +248,9 @@ CONFIG_ZONE_DMA_FLAG=1 CONFIG_BOUNCE=y CONFIG_VIRT_TO_BUS=y +CONFIG_DEFAULT_MMAP_MIN_ADDR=4096 # CONFIG_HIGHPTE is not set +CONFIG_X86_RESERVE_LOW_64K=y # CONFIG_MATH_EMULATION is not set # CONFIG_MTRR is not set CONFIG_SECCOMP=y @@ -307,10 +311,6 @@ CONFIG_BINFMT_ELF=y # CONFIG_BINFMT_AOUT is not set # CONFIG_BINFMT_MISC is not set - -# -# Networking -# CONFIG_NET=y # @@ -359,6 +359,7 @@ # CONFIG_ATM is not set # CONFIG_BRIDGE is not set CONFIG_VLAN_8021Q=y +# CONFIG_VLAN_8021Q_GVRP is not set # CONFIG_DECNET is not set # CONFIG_LLC2 is not set # CONFIG_IPX is not set @@ -430,6 +431,8 @@ CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y CONFIG_FW_LOADER=y +# CONFIG_FIRMWARE_IN_KERNEL is not set +CONFIG_EXTRA_FIRMWARE="" # CONFIG_SYS_HYPERVISOR is not set # CONFIG_CONNECTOR is not set # CONFIG_MTD is not set @@ -462,12 +465,11 @@ # CONFIG_BLK_DEV_XIP is not set # CONFIG_CDROM_PKTCDVD is not set # CONFIG_ATA_OVER_ETH is not set +# CONFIG_BLK_DEV_HD is not set # CONFIG_MISC_DEVICES is not set CONFIG_HAVE_IDE=y CONFIG_IDE=y # CONFIG_BLK_DEV_IDE is not set -# CONFIG_BLK_DEV_HD_ONLY is not set -# CONFIG_BLK_DEV_HD is not set # # SCSI device support @@ -564,6 +566,7 @@ # CONFIG_SCSI_NSP32 is not set # CONFIG_SCSI_DEBUG is not set # CONFIG_SCSI_SRP is not set +# CONFIG_SCSI_DH is not set CONFIG_ATA=y # CONFIG_ATA_NONSTANDARD is not set # CONFIG_SATA_PMP is not set @@ -643,7 +646,6 @@ # CONFIG_I2O is not set # CONFIG_MACINTOSH_DRIVERS is not set CONFIG_NETDEVICES=y -# CONFIG_NETDEVICES_MULTIQUEUE is not set # CONFIG_DUMMY is not set # CONFIG_BONDING is not set # CONFIG_MACVLAN is not set @@ -707,9 +709,7 @@ CONFIG_NET_PCI=y CONFIG_PCNET32=y CONFIG_AMD8111_ETH=y -# CONFIG_AMD8111E_NAPI is not set CONFIG_ADAPTEC_STARFIRE=y -# CONFIG_ADAPTEC_STARFIRE_NAPI is not set # CONFIG_AC3200 is not set # CONFIG_APRICOT is not set CONFIG_B44=y @@ -737,24 +737,21 @@ CONFIG_TLAN=y CONFIG_VIA_RHINE=y CONFIG_VIA_RHINE_MMIO=y -# CONFIG_VIA_RHINE_NAPI is not set # CONFIG_SC92031 is not set CONFIG_NETDEV_1000=y CONFIG_ACENIC=y # CONFIG_ACENIC_OMIT_TIGON_I is not set CONFIG_DL2K=y CONFIG_E1000=y -# CONFIG_E1000_NAPI is not set # CONFIG_E1000_DISABLE_PACKET_SPLIT is not set CONFIG_E1000E=y -CONFIG_E1000E_ENABLED=y CONFIG_IP1000=y CONFIG_IGB=y +# CONFIG_IGB_LRO is not set CONFIG_NS83820=y CONFIG_HAMACHI=y CONFIG_YELLOWFIN=y CONFIG_R8169=y -# CONFIG_R8169_NAPI is not set CONFIG_R8169_VLAN=y CONFIG_SIS190=y CONFIG_SKGE=y @@ -766,6 +763,7 @@ CONFIG_BNX2=y CONFIG_QLA3XXX=y # CONFIG_ATL1 is not set +# CONFIG_ATL1E is not set # CONFIG_NETDEV_10000 is not set # CONFIG_TR is not set @@ -824,6 +822,7 @@ # CONFIG_KEYBOARD_XTKBD is not set # CONFIG_KEYBOARD_NEWTON is not set # CONFIG_KEYBOARD_STOWAWAY is not set +# CONFIG_KEYBOARD_GPIO is not set # CONFIG_INPUT_MOUSE is not set # CONFIG_INPUT_JOYSTICK is not set # CONFIG_INPUT_TABLET is not set @@ -854,6 +853,7 @@ # Character devices # CONFIG_VT=y +CONFIG_CONSOLE_TRANSLATIONS=y CONFIG_VT_CONSOLE=y CONFIG_HW_CONSOLE=y # CONFIG_VT_HW_CONSOLE_BINDING is not set @@ -914,6 +914,22 @@ CONFIG_DEVPORT=y # CONFIG_I2C is not set # CONFIG_SPI is not set +CONFIG_ARCH_WANT_OPTIONAL_GPIOLIB=y +CONFIG_GPIOLIB=y +CONFIG_GPIO_SYSFS=y + +# +# I2C GPIO expanders: +# + +# +# PCI GPIO expanders: +# +# CONFIG_GPIO_BT8XX is not set + +# +# SPI GPIO expanders: +# # CONFIG_W1 is not set CONFIG_POWER_SUPPLY=y # CONFIG_POWER_SUPPLY_DEBUG is not set @@ -940,8 +956,10 @@ # # Multifunction device drivers # +# CONFIG_MFD_CORE is not set # CONFIG_MFD_SM501 is not set # CONFIG_HTC_PASIC3 is not set +# CONFIG_MFD_TMIO is not set # # Multimedia devices @@ -982,10 +1000,6 @@ # CONFIG_VIDEO_SELECT is not set # CONFIG_MDA_CONSOLE is not set CONFIG_DUMMY_CONSOLE=y - -# -# Sound -# # CONFIG_SOUND is not set CONFIG_HID_SUPPORT=y CONFIG_HID=y @@ -1014,6 +1028,7 @@ CONFIG_USB_DEVICE_CLASS=y # CONFIG_USB_DYNAMIC_MINORS is not set # CONFIG_USB_OTG is not set +# CONFIG_USB_MON is not set # # USB Host Controller Drivers @@ -1068,7 +1083,6 @@ # # CONFIG_USB_MDC800 is not set # CONFIG_USB_MICROTEK is not set -# CONFIG_USB_MON is not set # # USB port drivers @@ -1078,7 +1092,6 @@ # CONFIG_USB_EZUSB is not set # CONFIG_USB_SERIAL_GENERIC is not set # CONFIG_USB_SERIAL_AIRCABLE is not set -# CONFIG_USB_SERIAL_AIRPRIME is not set # CONFIG_USB_SERIAL_ARK3116 is not set # CONFIG_USB_SERIAL_BELKIN is not set # CONFIG_USB_SERIAL_CH341 is not set @@ -1125,7 +1138,6 @@ # CONFIG_USB_EMI62 is not set # CONFIG_USB_EMI26 is not set # CONFIG_USB_ADUTUX is not set -# CONFIG_USB_AUERSWALD is not set # CONFIG_USB_RIO500 is not set # CONFIG_USB_LEGOTOWER is not set # CONFIG_USB_LCD is not set @@ -1171,6 +1183,7 @@ # Firmware Drivers # # CONFIG_EDD is not set +CONFIG_FIRMWARE_MEMMAP=y # CONFIG_DELL_RBU is not set # CONFIG_DCDBAS is not set CONFIG_DMIID=y @@ -1254,6 +1267,7 @@ CONFIG_SQUASHFS_FRAGMENT_CACHE_SIZE=3 # CONFIG_VXFS_FS is not set # CONFIG_MINIX_FS is not set +# CONFIG_OMFS_FS is not set # CONFIG_HPFS_FS is not set # CONFIG_QNX4FS_FS is not set # CONFIG_ROMFS_FS is not set @@ -1322,11 +1336,22 @@ # CONFIG_HEADERS_CHECK is not set # CONFIG_DEBUG_KERNEL is not set CONFIG_DEBUG_BUGVERBOSE=y +CONFIG_DEBUG_MEMORY_INIT=y # CONFIG_LATENCYTOP is not set +CONFIG_SYSCTL_SYSCALL_CHECK=y +CONFIG_HAVE_FTRACE=y +CONFIG_HAVE_DYNAMIC_FTRACE=y +# CONFIG_FTRACE is not set +# CONFIG_IRQSOFF_TRACER is not set +# CONFIG_PREEMPT_TRACER is not set +# CONFIG_SYSPROF_TRACER is not set +# CONFIG_SCHED_TRACER is not set +# CONFIG_CONTEXT_SWITCH_TRACER is not set # CONFIG_PROVIDE_OHCI1394_DMA_INIT is not set # CONFIG_SAMPLES is not set CONFIG_HAVE_ARCH_KGDB=y -# CONFIG_NONPROMISC_DEVMEM is not set +# CONFIG_STRICT_DEVMEM is not set +CONFIG_X86_VERBOSE_BOOTUP=y CONFIG_EARLY_PRINTK=y # CONFIG_4KSTACKS is not set CONFIG_DOUBLEFAULT=y @@ -1339,6 +1364,7 @@ # CONFIG_IO_DELAY_UDELAY is not set # CONFIG_IO_DELAY_NONE is not set CONFIG_DEFAULT_IO_DELAY_TYPE=0 +# CONFIG_OPTIMIZE_INLINING is not set # # Security options @@ -1392,6 +1418,10 @@ # CONFIG_CRYPTO_MD4 is not set CONFIG_CRYPTO_MD5=y CONFIG_CRYPTO_MICHAEL_MIC=y +# CONFIG_CRYPTO_RMD128 is not set +# CONFIG_CRYPTO_RMD160 is not set +# CONFIG_CRYPTO_RMD256 is not set +# CONFIG_CRYPTO_RMD320 is not set CONFIG_CRYPTO_SHA1=y CONFIG_CRYPTO_SHA256=y CONFIG_CRYPTO_SHA512=y @@ -1444,6 +1474,7 @@ CONFIG_GENERIC_FIND_NEXT_BIT=y CONFIG_CRC_CCITT=y CONFIG_CRC16=y +# CONFIG_CRC_T10DIF is not set CONFIG_CRC_ITU_T=y CONFIG_CRC32=y # CONFIG_CRC7 is not set Deleted: trunk/target/device/kernel-patches/linux-2.6.25-imq5.patch =================================================================== --- trunk/target/device/kernel-patches/linux-2.6.25-imq5.patch 2010-07-11 21:30:22 UTC (rev 102) +++ trunk/target/device/kernel-patches/linux-2.6.25-imq5.patch 2010-07-11 21:49:15 UTC (rev 103) @@ -1,914 +0,0 @@ ---- linux-2.6.25.7/drivers/net/imq.c 1970-01-01 02:00:00.000000000 +0200 -+++ linux-2.6.25.7.imq/drivers/net/imq.c 2008-06-17 15:03:01.000000000 +0300 -@@ -0,0 +1,474 @@ -+/* -+ * Pseudo-driver for the intermediate queue device. -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License -+ * as published by the Free Software Foundation; either version -+ * 2 of the License, or (at your option) any later version. -+ * -+ * Authors: Patrick McHardy, <ka...@tr...> -+ * -+ * The first version was written by Martin Devera, <de...@cd...> -+ * -+ * Credits: Jan Rafaj <im...@ce...> -+ * - Update patch to 2.4.21 -+ * Sebastian Strollo <sst...@no...> -+ * - Fix "Dead-loop on netdevice imq"-issue -+ * Marcel Sebek <se...@po...> -+ * - Update to 2.6.2-rc1 -+ * -+ * After some time of inactivity there is a group taking care -+ * of IMQ again: http://www.linuximq.net -+ * -+ * -+ * 2004/06/30 - New version of IMQ patch to kernels <=2.6.7 -+ * including the following changes: -+ * -+ * - Correction of ipv6 support "+"s issue (Hasso Tepper) -+ * - Correction of imq_init_devs() issue that resulted in -+ * kernel OOPS unloading IMQ as module (Norbert Buchmuller) -+ * - Addition of functionality to choose number of IMQ devices -+ * during kernel config (Andre Correa) -+ * - Addition of functionality to choose how IMQ hooks on -+ * PRE and POSTROUTING (after or before NAT) (Andre Correa) -+ * - Cosmetic corrections (Norbert Buchmuller) (Andre Correa) -+ * -+ * -+ * 2005/12/16 - IMQ versions between 2.6.7 and 2.6.13 were -+ * released with almost no problems. 2.6.14-x was released -+ * with some important changes: nfcache was removed; After -+ * some weeks of trouble we figured out that some IMQ fields -+ * in skb were missing in skbuff.c - skb_clone and copy_skb_header. -+ * These functions are correctly patched by this new patch version. -+ * -+ * Thanks for all who helped to figure out all the problems with -+ * 2.6.14.x: Patrick McHardy, Rune Kock, VeNoMouS, Max CtRiX, -+ * Kevin Shanahan, Richard Lucassen, Valery Dachev (hopefully -+ * I didn't forget anybody). I apologize again for my lack of time. -+ * -+ * -+ * 2008/06/17 - 2.6.25 - Changed imq.c to use qdisc_run() instead -+ * of qdisc_restart() and moved qdisc_run() to tasklet to avoid -+ * recursive locking. New initialization routines to fix 'rmmod' not -+ * working anymore. Used code from ifb.c. (Jussi Kivilinna) -+ * -+ * Also, many thanks to pablo Sebastian Greco for making the initial -+ * patch and to those who helped the testing. -+ * -+ * More info at: http://www.linuximq.net/ (Andre Correa) -+ */ -+ -+#include <linux/module.h> -+#include <linux/kernel.h> -+#include <linux/moduleparam.h> -+#include <linux/skbuff.h> -+#include <linux/netdevice.h> -+#include <linux/rtnetlink.h> -+#include <linux/if_arp.h> -+#include <linux/netfilter.h> -+#include <linux/netfilter_ipv4.h> -+#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) -+ #include <linux/netfilter_ipv6.h> -+#endif -+#include <linux/imq.h> -+#include <net/pkt_sched.h> -+#include <net/netfilter/nf_queue.h> -+ -+struct imq_private { -+ struct tasklet_struct tasklet; -+ int tasklet_pending; -+}; -+ -+static nf_hookfn imq_nf_hook; -+ -+static struct nf_hook_ops imq_ingress_ipv4 = { -+ .hook = imq_nf_hook, -+ .owner = THIS_MODULE, -+ .pf = PF_INET, -+ .hooknum = NF_INET_PRE_ROUTING, -+#if defined(CONFIG_IMQ_BEHAVIOR_BA) || defined(CONFIG_IMQ_BEHAVIOR_BB) -+ .priority = NF_IP_PRI_MANGLE + 1 -+#else -+ .priority = NF_IP_PRI_NAT_DST + 1 -+#endif -+}; -+ -+static struct nf_hook_ops imq_egress_ipv4 = { -+ .hook = imq_nf_hook, -+ .owner = THIS_MODULE, -+ .pf = PF_INET, -+ .hooknum = NF_INET_POST_ROUTING, -+#if defined(CONFIG_IMQ_BEHAVIOR_AA) || defined(CONFIG_IMQ_BEHAVIOR_BA) -+ .priority = NF_IP_PRI_LAST -+#else -+ .priority = NF_IP_PRI_NAT_SRC - 1 -+#endif -+}; -+ -+#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) -+static struct nf_hook_ops imq_ingress_ipv6 = { -+ .hook = imq_nf_hook, -+ .owner = THIS_MODULE, -+ .pf = PF_INET6, -+ .hooknum = NF_INET_PRE_ROUTING, -+#if defined(CONFIG_IMQ_BEHAVIOR_BA) || defined(CONFIG_IMQ_BEHAVIOR_BB) -+ .priority = NF_IP6_PRI_MANGLE + 1 -+#else -+ .priority = NF_IP6_PRI_NAT_DST + 1 -+#endif -+}; -+ -+static struct nf_hook_ops imq_egress_ipv6 = { -+ .hook = imq_nf_hook, -+ .owner = THIS_MODULE, -+ .pf = PF_INET6, -+ .hooknum = NF_INET_POST_ROUTING, -+#if defined(CONFIG_IMQ_BEHAVIOR_AA) || defined(CONFIG_IMQ_BEHAVIOR_BA) -+ .priority = NF_IP6_PRI_LAST -+#else -+ .priority = NF_IP6_PRI_NAT_SRC - 1 -+#endif -+}; -+#endif -+ -+#if defined(CONFIG_IMQ_NUM_DEVS) -+static unsigned int numdevs = CONFIG_IMQ_NUM_DEVS; -+#else -+static unsigned int numdevs = IMQ_MAX_DEVS; -+#endif -+ -+static struct net_device *imq_devs_cache[IMQ_MAX_DEVS]; -+ -+static struct net_device_stats *imq_get_stats(struct net_device *dev) -+{ -+ return &dev->stats; -+} -+ -+/* called for packets kfree'd in qdiscs at places other than enqueue */ -+static void imq_skb_destructor(struct sk_buff *skb) -+{ -+ struct nf_queue_entry *entry = skb->nf_queue_entry; -+ -+ if (entry) { -+ if (entry->indev) -+ dev_put(entry->indev); -+ if (entry->outdev) -+ dev_put(entry->outdev); -+ kfree(entry); -+ } -+} -+ -+static int imq_dev_xmit(struct sk_buff *skb, struct net_device *dev) -+{ -+ dev->stats.tx_bytes += skb->len; -+ dev->stats.tx_packets++; -+ -+ skb->imq_flags = 0; -+ skb->destructor = NULL; -+ -+ dev->trans_start = jiffies; -+ nf_reinject(skb->nf_queue_entry, NF_ACCEPT); -+ return 0; -+} -+ -+static int imq_nf_queue(struct nf_queue_entry *entry, unsigned queue_num) -+{ -+ struct net_device *dev; -+ struct imq_private *priv; -+ struct sk_buff *skb2 = NULL; -+ struct Qdisc *q; -+ unsigned int index = entry->skb->imq_flags & IMQ_F_IFMASK; -+ int ret = -1; -+ -+ if (index > numdevs) -+ return -1; -+ -+ /* check for imq device by index from cache */ -+ dev = imq_devs_cache[index]; -+ if (!dev) { -+ char buf[8]; -+ -+ /* get device by name and cache result */ -+ snprintf(buf, sizeof(buf), "imq%d", index); -+ dev = dev_get_by_name(&init_net, buf); -+ if (!dev) { -+ /* not found ?!*/ -+ BUG(); -+ return -1; -+ } -+ -+ imq_devs_cache[index] = dev; -+ } -+ -+ priv = netdev_priv(dev); -+ if (!(dev->flags & IFF_UP)) { -+ entry->skb->imq_flags = 0; -+ nf_reinject(entry, NF_ACCEPT); -+ return 0; -+ } -+ dev->last_rx = jiffies; -+ -+ if (entry->skb->destructor) { -+ skb2 = entry->skb; -+ entry->skb = skb_clone(entry->skb, GFP_ATOMIC); -+ if (!entry->skb) -+ return -1; -+ } -+ entry->skb->nf_queue_entry = entry; -+ -+ dev->stats.rx_bytes += entry->skb->len; -+ dev->stats.rx_packets++; -+ -+ spin_lock_bh(&dev->queue_lock); -+ q = dev->qdisc; -+ if (q->enqueue) { -+ q->enqueue(skb_get(entry->skb), q); -+ if (skb_shared(entry->skb)) { -+ entry->skb->destructor = imq_skb_destructor; -+ kfree_skb(entry->skb); -+ ret = 0; -+ } -+ } -+ if (!test_and_set_bit(1, &priv->tasklet_pending)) -+ tasklet_schedule(&priv->tasklet); -+ spin_unlock_bh(&dev->queue_lock); -+ -+ if (skb2) -+ kfree_skb(ret ? entry->skb : skb2); -+ -+ return ret; -+} -+ -+static struct nf_queue_handler nfqh = { -+ .name = "imq", -+ .outfn = imq_nf_queue, -+}; -+ -+static void qdisc_run_tasklet(unsigned long arg) -+{ -+ struct net_device *dev = (struct net_device *)arg; -+ struct imq_private *priv = netdev_priv(dev); -+ -+ spin_lock(&dev->queue_lock); -+ qdisc_run(dev); -+ clear_bit(1, &priv->tasklet_pending); -+ spin_unlock(&dev->queue_lock); -+} -+ -+static unsigned int imq_nf_hook(unsigned int hook, struct sk_buff *pskb, -+ const struct net_device *indev, -+ const struct net_device *outdev, -+ int (*okfn)(struct sk_buff *)) -+{ -+ if (pskb->imq_flags & IMQ_F_ENQUEUE) -+ return NF_QUEUE; -+ -+ return NF_ACCEPT; -+} -+ -+static int imq_close(struct net_device *dev) -+{ -+ struct imq_private *priv = netdev_priv(dev); -+ -+ tasklet_kill(&priv->tasklet); -+ netif_stop_queue(dev); -+ -+ return 0; -+} -+ -+static int imq_open(struct net_device *dev) -+{ -+ struct imq_private *priv = netdev_priv(dev); -+ -+ tasklet_init(&priv->tasklet, qdisc_run_tasklet, (unsigned long)dev); -+ netif_start_queue(dev); -+ -+ return 0; -+} -+ -+static void imq_setup(struct net_device *dev) -+{ -+ dev->hard_start_xmit = imq_dev_xmit; -+ dev->open = imq_open; -+ dev->get_stats = imq_get_stats; -+ dev->stop = imq_close; -+ dev->type = ARPHRD_VOID; -+ dev->mtu = 16000; -+ dev->tx_queue_len = 11000; -+ dev->flags = IFF_NOARP; -+} -+ -+static struct rtnl_link_ops imq_link_ops __read_mostly = { -+ .kind = "imq", -+ .priv_size = sizeof(struct imq_private), -+ .setup = imq_setup, -+}; -+ -+static int __init imq_init_hooks(void) -+{ -+ int err; -+ -+ err = nf_register_queue_handler(PF_INET, &nfqh); -+ if (err) -+ goto err1; -+ -+ err = nf_register_hook(&imq_ingress_ipv4); -+ if (err) -+ goto err2; -+ -+ err = nf_register_hook(&imq_egress_ipv4); -+ if (err) -+ goto err3; -+ -+#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) -+ err = nf_register_queue_handler(PF_INET6, &nfqh); -+ if (err) -+ goto err4; -+ -+ err = nf_register_hook(&imq_ingress_ipv6); -+ if (err) -+ goto err5; -+ -+ err = nf_register_hook(&imq_egress_ipv6); -+ if (err) -+ goto err6; -+#endif -+ -+ return 0; -+ -+#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) -+err6: -+ nf_unregister_hook(&imq_ingress_ipv6); -+err5: -+ nf_unregister_queue_handler(PF_INET6, &nfqh); -+err4: -+ nf_unregister_hook(&imq_egress_ipv4); -+#endif -+err3: -+ nf_unregister_hook(&imq_ingress_ipv4); -+err2: -+ nf_unregister_queue_handler(PF_INET, &nfqh); -+err1: -+ return err; -+} -+ -+static int __init imq_init_one(int index) -+{ -+ struct net_device *dev; -+ int ret; -+ -+ dev = alloc_netdev(sizeof(struct imq_private), "imq%d", imq_setup); -+ if (!dev) -+ return -ENOMEM; -+ -+ ret = dev_alloc_name(dev, dev->name); -+ if (ret < 0) -+ goto fail; -+ -+ dev->rtnl_link_ops = &imq_link_ops; -+ ret = register_netdevice(dev); -+ if (ret < 0) -+ goto fail; -+ -+ return 0; -+fail: -+ free_netdev(dev); -+ return ret; -+} -+ -+static int __init imq_init_devs(void) -+{ -+ int err, i; -+ -+ if (!numdevs || numdevs > IMQ_MAX_DEVS) { -+ printk(KERN_ERR "IMQ: numdevs has to be betweed 1 and %u\n", -+ IMQ_MAX_DEVS); -+ return -EINVAL; -+ } -+ -+ rtnl_lock(); -+ err = __rtnl_link_register(&imq_link_ops); -+ -+ for (i = 0; i < numdevs && !err; i++) -+ err = imq_init_one(i); -+ -+ if (err) { -+ __rtnl_link_unregister(&imq_link_ops); -+ memset(imq_devs_cache, 0, sizeof(imq_devs_cache)); -+ } -+ rtnl_unlock(); -+ -+ return err; -+} -+ -+static int __init imq_init_module(void) -+{ -+ int err; -+ -+ err = imq_init_devs(); -+ if (err) { -+ printk(KERN_ERR "IMQ: Error trying imq_init_devs(net)\n"); -+ return err; -+ } -+ -+ err = imq_init_hooks(); -+ if (err) { -+ printk(KERN_ERR "IMQ: Error trying imq_init_hooks()\n"); -+ rtnl_link_unregister(&imq_link_ops); -+ memset(imq_devs_cache, 0, sizeof(imq_devs_cache)); -+ return err; -+ } -+ -+ printk(KERN_INFO "IMQ driver loaded successfully.\n"); -+ -+#if defined(CONFIG_IMQ_BEHAVIOR_BA) || defined(CONFIG_IMQ_BEHAVIOR_BB) -+ printk(KERN_INFO "\tHooking IMQ before NAT on PREROUTING.\n"); -+#else -+ printk(KERN_INFO "\tHooking IMQ after NAT on PREROUTING.\n"); -+#endif -+#if defined(CONFIG_IMQ_BEHAVIOR_AB) || defined(CONFIG_IMQ_BEHAVIOR_BB) -+ printk(KERN_INFO "\tHooking IMQ before NAT on POSTROUTING.\n"); -+#else -+ printk(KERN_INFO "\tHooking IMQ after NAT on POSTROUTING.\n"); -+#endif -+ -+ return 0; -+} -+ -+static void __exit imq_unhook(void) -+{ -+#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) -+ nf_unregister_hook(&imq_ingress_ipv6); -+ nf_unregister_hook(&imq_egress_ipv6); -+ nf_unregister_queue_handler(PF_INET6, &nfqh); -+#endif -+ nf_unregister_hook(&imq_ingress_ipv4); -+ nf_unregister_hook(&imq_egress_ipv4); -+ nf_unregister_queue_handler(PF_INET, &nfqh); -+} -+ -+static void __exit imq_cleanup_devs(void) -+{ -+ rtnl_link_unregister(&imq_link_ops); -+ memset(imq_devs_cache, 0, sizeof(imq_devs_cache)); -+} -+ -+static void __exit imq_exit_module(void) -+{ -+ imq_unhook(); -+ imq_cleanup_devs(); -+ printk(KERN_INFO "IMQ driver unloaded successfully.\n"); -+} -+ -+module_init(imq_init_module); -+module_exit(imq_exit_module); -+ -+module_param(numdevs, int, 0); -+MODULE_PARM_DESC(numdevs, "number of IMQ devices (how many imq* devices will " -+ "be created)"); -+MODULE_AUTHOR("http://www.linuximq.net"); -+MODULE_DESCRIPTION("Pseudo-driver for the intermediate queue device. See " -+ "http://www.linuximq.net/ for more information."); -+MODULE_LICENSE("GPL"); -+MODULE_ALIAS_RTNL_LINK("imq"); -+ ---- linux-2.6.25.7/drivers/net/Kconfig 2008-06-16 23:24:36.000000000 +0300 -+++ linux-2.6.25.7.imq/drivers/net/Kconfig 2008-06-17 15:03:21.000000000 +0300 -@@ -117,6 +117,129 @@ - To compile this driver as a module, choose M here: the module - will be called eql. If unsure, say N. - -+config IMQ -+ tristate "IMQ (intermediate queueing device) support" -+ depends on NETDEVICES && NETFILTER -+ ---help--- -+ The IMQ device(s) is used as placeholder for QoS queueing -+ disciplines. Every packet entering/leaving the IP stack can be -+ directed through the IMQ device where it's enqueued/dequeued to the -+ attached qdisc. This allows you to treat network devices as classes -+ and distribute bandwidth among them. Iptables is used to specify -+ through which IMQ device, if any, packets travel. -+ -+ More information at: http://www.linuximq.net/ -+ -+ To compile this driver as a module, choose M here: the module -+ will be called imq. If unsure, say N. -+ -+choice -+ prompt "IMQ behavior (PRE/POSTROUTING)" -+ depends on IMQ -+ default IMQ_BEHAVIOR_AB -+ help -+ -+ This settings defines how IMQ behaves in respect to its -+ hooking in PREROUTING and POSTROUTING. -+ -+ IMQ can work in any of the following ways: -+ -+ PREROUTING | POSTROUTING -+ -----------------|------------------- -+ #1 After NAT | After NAT -+ #2 After NAT | Before NAT -+ #3 Before NAT | After NAT -+ #4 Before NAT | Before NAT -+ -+ The default behavior is to hook before NAT on PREROUTING -+ and after NAT on POSTROUTING (#3). -+ -+ This settings are specially usefull when trying to use IMQ -+ to shape NATed clients. -+ -+ More information can be found at: www.linuximq.net -+ -+ If not sure leave the default settings alone. -+ -+config IMQ_BEHAVIOR_AA -+ bool "IMQ AA" -+ help -+ This settings defines how IMQ behaves in respect to its -+ hooking in PREROUTING and POSTROUTING. -+ -+ Choosing this option will make IMQ hook like this: -+ -+ PREROUTING: After NAT -+ POSTROUTING: After NAT -+ -+ More information can be found at: www.linuximq.net -+ -+ If not sure leave the default settings alone. -+ -+config IMQ_BEHAVIOR_AB -+ bool "IMQ AB" -+ help -+ This settings defines how IMQ behaves in respect to its -+ hooking in PREROUTING and POSTROUTING. -+ -+ Choosing this option will make IMQ hook like this: -+ -+ PREROUTING: After NAT -+ POSTROUTING: Before NAT -+ -+ More information can be found at: www.linuximq.net -+ -+ If not sure leave the default settings alone. -+ -+config IMQ_BEHAVIOR_BA -+ bool "IMQ BA" -+ help -+ This settings defines how IMQ behaves in respect to its -+ hooking in PREROUTING and POSTROUTING. -+ -+ Choosing this option will make IMQ hook like this: -+ -+ PREROUTING: Before NAT -+ POSTROUTING: After NAT -+ -+ More information can be found at: www.linuximq.net -+ -+ If not sure leave the default settings alone. -+ -+config IMQ_BEHAVIOR_BB -+ bool "IMQ BB" -+ help -+ This settings defines how IMQ behaves in respect to its -+ hooking in PREROUTING and POSTROUTING. -+ -+ Choosing this option will make IMQ hook like this: -+ -+ PREROUTING: Before NAT -+ POSTROUTING: Before NAT -+ -+ More information can be found at: www.linuximq.net -+ -+ If not sure leave the default settings alone. -+ -+endchoice -+ -+config IMQ_NUM_DEVS -+ -+ int "Number of IMQ devices" -+ range 2 16 -+ depends on IMQ -+ default "16" -+ help -+ -+ This settings defines how many IMQ devices will be -+ created. -+ -+ The default value is 16. -+ -+ More information can be found at: www.linuximq.net -+ -+ If not sure leave the default settings alone. -+ - config TUN - tristate "Universal TUN/TAP device driver support" - select CRC32 ---- linux-2.6.25.7/drivers/net/Makefile 2008-06-16 23:24:36.000000000 +0300 -+++ linux-2.6.25.7.imq/drivers/net/Makefile 2008-06-17 14:56:58.000000000 +0300 -@@ -143,6 +143,7 @@ - obj-$(CONFIG_XEN_NETDEV_FRONTEND) += xen-netfront.o - - obj-$(CONFIG_DUMMY) += dummy.o -+obj-$(CONFIG_IMQ) += imq.o - obj-$(CONFIG_IFB) += ifb.o - obj-$(CONFIG_MACVLAN) += macvlan.o - obj-$(CONFIG_DE600) += de600.o ---- linux-2.6.25.7/include/linux/imq.h 1970-01-01 02:00:00.000000000 +0200 -+++ linux-2.6.25.7.imq/include/linux/imq.h 2008-06-17 14:56:58.000000000 +0300 -@@ -0,0 +1,9 @@ -+#ifndef _IMQ_H -+#define _IMQ_H -+ -+#define IMQ_MAX_DEVS 16 -+ -+#define IMQ_F_IFMASK 0x7f -+#define IMQ_F_ENQUEUE 0x80 -+ -+#endif /* _IMQ_H */ ---- linux-2.6.25.7/include/linux/netfilter_ipv4/ipt_IMQ.h 1970-01-01 02:00:00.000000000 +0200 -+++ linux-2.6.25.7.imq/include/linux/netfilter_ipv4/ipt_IMQ.h 2008-06-17 14:56:58.000000000 +0300 -@@ -0,0 +1,8 @@ -+#ifndef _IPT_IMQ_H -+#define _IPT_IMQ_H -+ -+struct ipt_imq_info { -+ unsigned int todev; /* target imq device */ -+}; -+ -+#endif /* _IPT_IMQ_H */ ---- linux-2.6.25.7/include/linux/netfilter_ipv6/ip6t_IMQ.h 1970-01-01 02:00:00.000000000 +0200 -+++ linux-2.6.25.7.imq/include/linux/netfilter_ipv6/ip6t_IMQ.h 2008-06-17 14:56:58.000000000 +0300 -@@ -0,0 +1,8 @@ -+#ifndef _IP6T_IMQ_H -+#define _IP6T_IMQ_H -+ -+struct ip6t_imq_info { -+ unsigned int todev; /* target imq device */ -+}; -+ -+#endif /* _IP6T_IMQ_H */ ---- linux-2.6.25.7/include/linux/skbuff.h 2008-06-16 23:24:36.000000000 +0300 -+++ linux-2.6.25.7.imq/include/linux/skbuff.h 2008-06-17 14:56:58.000000000 +0300 -@@ -296,6 +296,10 @@ - struct nf_conntrack *nfct; - struct sk_buff *nfct_reasm; - #endif -+#if defined(CONFIG_IMQ) || defined(CONFIG_IMQ_MODULE) -+ unsigned char imq_flags; -+ struct nf_queue_entry *nf_queue_entry; -+#endif - #ifdef CONFIG_BRIDGE_NETFILTER - struct nf_bridge_info *nf_bridge; - #endif -@@ -1736,6 +1740,10 @@ - dst->nfct_reasm = src->nfct_reasm; - nf_conntrack_get_reasm(src->nfct_reasm); - #endif -+#if defined(CONFIG_IMQ) || defined(CONFIG_IMQ_MODULE) -+ dst->imq_flags = src->imq_flags; -+ dst->nf_queue_entry = src->nf_queue_entry; -+#endif - #ifdef CONFIG_BRIDGE_NETFILTER - dst->nf_bridge = src->nf_bridge; - nf_bridge_get(src->nf_bridge); ---- linux-2.6.25.7/net/core/dev.c 2008-06-16 23:24:36.000000000 +0300 -+++ linux-2.6.25.7.imq/net/core/dev.c 2008-06-17 14:56:58.000000000 +0300 -@@ -95,6 +95,9 @@ - #include <net/net_namespace.h> - #include <net/sock.h> - #include <linux/rtnetlink.h> -+#if defined(CONFIG_IMQ) || defined(CONFIG_IMQ_MODULE) -+#include <linux/imq.h> -+#endif - #include <linux/proc_fs.h> - #include <linux/seq_file.h> - #include <linux/stat.h> -@@ -1537,7 +1540,11 @@ - int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) - { - if (likely(!skb->next)) { -- if (!list_empty(&ptype_all)) -+ if (!list_empty(&ptype_all) -+#if defined(CONFIG_IMQ) || defined(CONFIG_IMQ_MODULE) -+ && !(skb->imq_flags & IMQ_F_ENQUEUE) -+#endif -+ ) - dev_queue_xmit_nit(skb, dev); - - if (netif_needs_gso(dev, skb)) { ---- linux-2.6.25.7/net/ipv4/netfilter/ipt_IMQ.c 1970-01-01 02:00:00.000000000 +0200 -+++ linux-2.6.25.7.imq/net/ipv4/netfilter/ipt_IMQ.c 2008-06-17 14:56:58.000000000 +0300 -@@ -0,0 +1,69 @@ -+/* -+ * This target marks packets to be enqueued to an imq device -+ */ -+#include <linux/module.h> -+#include <linux/skbuff.h> -+#include <linux/netfilter_ipv4/ip_tables.h> -+#include <linux/netfilter_ipv4/ipt_IMQ.h> -+#include <linux/imq.h> -+ -+static unsigned int imq_target(struct sk_buff *pskb, -+ const struct net_device *in, -+ const struct net_device *out, -+ unsigned int hooknum, -+ const struct xt_target *target, -+ const void *targinfo) -+{ -+ struct ipt_imq_info *mr = (struct ipt_imq_info *)targinfo; -+ -+ pskb->imq_flags = mr->todev | IMQ_F_ENQUEUE; -+ -+ return XT_CONTINUE; -+} -+ -+static bool imq_checkentry(const char *tablename, -+ const void *e, -+ const struct xt_target *target, -+ void *targinfo, -+ unsigned int hook_mask) -+{ -+ struct ipt_imq_info *mr; -+ -+ mr = (struct ipt_imq_info *)targinfo; -+ -+ if (mr->todev > IMQ_MAX_DEVS) { -+ printk(KERN_WARNING -+ "IMQ: invalid device specified, highest is %u\n", -+ IMQ_MAX_DEVS); -+ return 0; -+ } -+ -+ return 1; -+} -+ -+static struct xt_target ipt_imq_reg = { -+ .name = "IMQ", -+ .family = AF_INET, -+ .target = imq_target, -+ .targetsize = sizeof(struct ipt_imq_info), -+ .checkentry = imq_checkentry, -+ .me = THIS_MODULE, -+ .table = "mangle" -+}; -+ -+static int __init init(void) -+{ -+ return xt_register_target(&ipt_imq_reg); -+} -+ -+static void __exit fini(void) -+{ -+ xt_unregister_target(&ipt_imq_reg); -+} -+ -+module_init(init); -+module_exit(fini); -+ -+MODULE_AUTHOR("http://www.linuximq.net"); -+MODULE_DESCRIPTION("Pseudo-driver for the intermediate queue device. See http://www.linuximq.net/ for more information."); -+MODULE_LICENSE("GPL"); ---- linux-2.6.25.7/net/ipv4/netfilter/Kconfig 2008-06-16 23:24:36.000000000 +0300 -+++ linux-2.6.25.7.imq/net/ipv4/netfilter/Kconfig 2008-06-17 14:56:58.000000000 +0300 -@@ -123,6 +123,17 @@ - - To compile it as a module, choose M here. If unsure, say N. - -+config IP_NF_TARGET_IMQ -+ tristate "IMQ target support" -+ depends on IP_NF_MANGLE -+ help -+ This option adds a `IMQ' target which is used to specify if and -+ to which IMQ device packets should get enqueued/dequeued. -+ -+ For more information visit: http://www.linuximq.net/ -+ -+ To compile it as a module, choose M here. If unsure, say N. -+ - config IP_NF_TARGET_REJECT - tristate "REJECT target support" - depends on IP_NF_FILTER ---- linux-2.6.25.7/net/ipv4/netfilter/Makefile 2008-06-16 23:24:36.000000000 +0300 -+++ linux-2.6.25.7.imq/net/ipv4/netfilter/Makefile 2008-06-17 14:56:58.000000000 +0300 -@@ -51,6 +51,7 @@ - obj-$(CONFIG_IP_NF_TARGET_CLUSTERIP) += ipt_CLUSTERIP.o - obj-$(CONFIG_IP_NF_TARGET_ECN) += ipt_ECN.o - obj-$(CONFIG_IP_NF_TARGET_LOG) += ipt_LOG.o -+obj-$(CONFIG_IP_NF_TARGET_IMQ) += ipt_IMQ.o - obj-$(CONFIG_IP_NF_TARGET_MASQUERADE) += ipt_MASQUERADE.o - obj-$(CONFIG_IP_NF_TARGET_NETMAP) += ipt_NETMAP.o - obj-$(CONFIG_IP_NF_TARGET_REDIRECT) += ipt_REDIRECT.o ---- linux-2.6.25.7/net/ipv6/netfilter/ip6t_IMQ.c 1970-01-01 02:00:00.000000000 +0200 -+++ linux-2.6.25.7.imq/net/ipv6/netfilter/ip6t_IMQ.c 2008-06-17 14:56:58.000000000 +0300 -@@ -0,0 +1,69 @@ -+/* -+ * This target marks packets to be enqueued to an imq device -+ */ -+#include <linux/module.h> -+#include <linux/skbuff.h> -+#include <linux/netfilter_ipv6/ip6_tables.h> -+#include <linux/netfilter_ipv6/ip6t_IMQ.h> -+#include <linux/imq.h> -+ -+static unsigned int imq_target(struct sk_buff *pskb, -+ const struct net_device *in, -+ const struct net_device *out, -+ unsigned int hooknum, -+ const struct xt_target *target, -+ const void *targinfo) -+{ -+ struct ip6t_imq_info *mr = (struct ip6t_imq_info *)targinfo; -+ -+ pskb->imq_flags = mr->todev | IMQ_F_ENQUEUE; -+ -+ return XT_CONTINUE; -+} -+ -+static bool imq_checkentry(const char *tablename, -+ const void *entry, -+ const struct xt_target *target, -+ void *targinfo, -+ unsigned int hook_mask) -+{ -+ struct ip6t_imq_info *mr; -+ -+ mr = (struct ip6t_imq_info *)targinfo; -+ -+ if (mr->todev > IMQ_MAX_DEVS) { -+ printk(KERN_WARNING -+ "IMQ: invalid device specified, highest is %u\n", -+ IMQ_MAX_DEVS); -+ return 0; -+ } -+ -+ return 1; -+} -+ -+static struct xt_target ip6t_imq_reg = { -+ .name = "IMQ", -+ .family = AF_INET6, -+ .target = imq_target, -+ .targetsize = sizeof(struct ip6t_imq_info), -+ .table = "mangle", -+ .checkentry = imq_checkentry, -+ .me = THIS_MODULE -+}; -+ -+static int __init init(void) -+{ -+ return xt_register_target(&ip6t_imq_reg); -+} -+ -+static void __exit fini(void) -+{ -+ xt_unregister_target(&ip6t_imq_reg); -+} -+ -+module_init(init); -+module_exit(fini); -+ -+MODULE_AUTHOR("http://www.linuximq.net"); -+MODULE_DESCRIPTION("Pseudo-driver for the intermediate queue device. See http://www.linuximq.net/ for more information."); -+MODULE_LICENSE("GPL"); ---- linux-2.6.25.7/net/ipv6/netfilter/Kconfig 2008-06-16 23:24:36.000000000 +0300 -+++ linux-2.6.25.7.imq/net/ipv6/netfilter/Kconfig 2008-06-17 14:56:58.000000000 +0300 -@@ -179,6 +179,15 @@ - - To compile it as a module, choose M here. If unsure, say N. - -+config IP6_NF_TARGET_IMQ -+ tristate "IMQ target support" -+ depends on IP6_NF_MANGLE -+ help -+ This option adds a `IMQ' target which is used to specify if and -+ to which imq device packets should get enqueued/dequeued. -+ -+ To compile it as a module, choose M here. If unsure, say N. -+ - config IP6_NF_TARGET_HL - tristate 'HL (hoplimit) target support' - depends on IP6_NF_MANGLE ---- linux-2.6.25.7/net/ipv6/netfilter/Makefile 2008-06-16 23:24:36.000000000 +0300 -+++ linux-2.6.25.7.imq/net/ipv6/netfilter/Makefile 2008-06-17 14:56:58.000000000 +0300 -@@ -6,6 +6,7 @@ - obj-$(CONFIG_IP6_NF_IPTABLES) += ip6_tables.o - obj-$(CONFIG_IP6_NF_FILTER) += ip6table_filter.o - obj-$(CONFIG_IP6_NF_MANGLE) += ip6table_mangle.o -+obj-$(CONFIG_IP6_NF_TARGET_IMQ) += ip6t_IMQ.o - obj-$(CONFIG_IP6_NF_QUEUE) += ip6_queue.o - obj-$(CONFIG_IP6_NF_RAW) += ip6table_raw.o - ---- linux-2.6.25.7/net/sched/sch_generic.c 2008-06-16 23:24:36.000000000 +0300 -+++ linux-2.6.25.7.imq/net/sched/sch_generic.c 2008-06-17 14:56:58.000000000 +0300 -@@ -203,6 +203,7 @@ - - clear_bit(__LINK_STATE_QDISC_RUNNING, &dev->state); - } -+EXPORT_SYMBOL(__qdisc_run); - - static void dev_watchdog(unsigned long arg) - { Deleted: trunk/target/device/kernel-patches/linux-2.6.25-squashfs3.4.patch =================================================================== --- trunk/target/device/kernel-patches/linux-2.6.25-squashfs3.4.patch 2010-07-11 21:30:22 UTC (rev 102) +++ trunk/target/device/kernel-patches/linux-2.6.25-squashfs3.4.patch 2010-07-11 21:49:15 UTC (rev 103) @@ -1,4218 +0,0 @@ -diff -x .gitignore -Nurp linux-2.6.25/fs/Kconfig linux-2.6.25-squashfs3.4/fs/Kconfig ---- linux-2.6.25/fs/Kconfig 2008-04-17 03:49:44.000000000 +0100 -+++ linux-2.6.25-squashfs3.4/fs/Kconfig 2008-08-18 16:44:29.000000000 +0100 -@@ -1367,6 +1367,56 @@ config CRAMFS - - If unsure, say N. - -+config SQUASHFS -+ tristate "SquashFS 3.4 - Squashed file system support" -+ select ZLIB_INFLATE -+ help -+ Saying Y here includes support for SquashFS 3.4 (a Compressed -+ Read-Only File System). Squashfs is a highly compressed read-only -+ filesystem for Linux. It uses zlib compression to compress both -+ files, inodes and directories. Inodes in the system are very small -+ and all blocks are packed to minimise data overhead. Block sizes -+ greater than 4K are supported up to a maximum of 1 Mbytes (default -+ block size 128K). SquashFS 3.3 supports 64 bit filesystems and files -+ (larger than 4GB), full uid/gid information, hard links and timestamps. -+ -+ Squashfs is intended for general read-only filesystem use, for -+ archival use (i.e. in cases where a .tar.gz file may be used), and in -+ embedded systems where low overhead is needed. Further information -+ and filesystem tools are available from http://squashfs.sourceforge.net. -+ -+ If you want to compile this as a module ( = code which can be -+ inserted in and removed from the running kernel whenever you want), -+ say M here and read <file:Documentation/modules.txt>. The module -+ will be called squashfs. Note that the root file system (the one -+ containing the directory /) cannot be compiled as a module. -+ -+ If unsure, say N. -+ -+config SQUASHFS_EMBEDDED -+ -+ bool "Additional option for memory-constrained systems" -+ depends on SQUASHFS -+ default n -+ help -+ Saying Y here allows you to specify cache size. -+ -+ If unsure, say N. -+ -+config SQUASHFS_FRAGMENT_CACHE_SIZE -+ int "Number of fragments cached" if SQUASHFS_EMBEDDED -+ depends on SQUASHFS -+ default "3" -+ help -+ By default SquashFS caches the last 3 fragments read from -+ the filesystem. Increasing this amount may mean SquashFS -+ has to re-read fragments less often from disk, at the expense -+ of extra system memory. Decreasing this amount will mean -+ SquashFS uses less memory at the expense of extra reads from disk. -+ -+ Note there must be at least one cached fragment. Anything -+ much more than three will probably not make much difference. -+ - config VXFS_FS - tristate "FreeVxFS file system support (VERITAS VxFS(TM) compatible)" - depends on BLOCK -diff -x .gitignore -Nurp linux-2.6.25/fs/Makefile linux-2.6.25-squashfs3.4/fs/Makefile ---- linux-2.6.25/fs/Makefile 2008-04-17 03:49:44.000000000 +0100 -+++ linux-2.6.25-squashfs3.4/fs/Makefile 2008-08-18 16:44:29.000000000 +0100 -@@ -73,6 +73,7 @@ obj-$(CONFIG_JBD) += jbd/ - obj-$(CONFIG_JBD2) += jbd2/ - obj-$(CONFIG_EXT2_FS) += ext2/ - obj-$(CONFIG_CRAMFS) += cramfs/ -+obj-$(CONFIG_SQUASHFS) += squashfs/ - obj-y += ramfs/ - obj-$(CONFIG_HUGETLBFS) += hugetlbfs/ - obj-$(CONFIG_CODA_FS) += coda/ -diff -x .gitignore -Nurp linux-2.6.25/fs/squashfs/inode.c linux-2.6.25-squashfs3.4/fs/squashfs/inode.c ---- linux-2.6.25/fs/squashfs/inode.c 1970-01-01 01:00:00.000000000 +0100 -+++ linux-2.6.25-squashfs3.4/fs/squashfs/inode.c 2008-08-26 08:24:58.000000000 +0100 -@@ -0,0 +1,2173 @@ -+/* -+ * Squashfs - a compressed read only filesystem for Linux -+ * -+ * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008 -+ * Phillip Lougher <ph...@lo...> -+ * -+ * This program is free software; you can redistribute it and/or -+ * modify it under the terms of the GNU General Public License -+ * as published by the Free Software Foundation; either version 2, -+ * or (at your option) any later version. -+ * -+ * This program is distributed in the hope that it will be useful, -+ * but WITHOUT ANY WARRANTY; without even the implied warranty of -+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ * GNU General Public License for more details. -+ * -+ * You should have received a copy of the GNU General Public License -+ * along with this program; if not, write to the Free Software -+ * Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -+ * -+ * inode.c -+ */ -+ -+#include <linux/squashfs_fs.h> -+#include <linux/module.h> -+#include <linux/zlib.h> -+#include <linux/fs.h> -+#include <linux/squashfs_fs_sb.h> -+#include <linux/squashfs_fs_i.h> -+#include <linux/buffer_head.h> -+#include <linux/vfs.h> -+#include <linux/vmalloc.h> -+#include <linux/spinlock.h> -+#include <linux/smp_lock.h> -+#include <linux/exportfs.h> -+ -+#include "squashfs.h" -+ -+static struct dentry *squashfs_fh_to_dentry(struct super_block *s, -+ struct fid *fid, int fh_len, int fh_type); -+static struct dentry *squashfs_fh_to_parent(struct super_block *s, -+ struct fid *fid, int fh_len, int fh_type); -+static struct dentry *squashfs_get_parent(struct dentry *child); -+static int squashfs_read_inode(struct inode *i, squashfs_inode_t inode); -+static int squashfs_statfs(struct dentry *, struct kstatfs *); -+static int squashfs_symlink_readpage(struct file *file, struct page *page); -+static long long read_blocklist(struct inode *inode, int index, -+ int readahead_blks, char *block_list, -+ unsigned short **block_p, unsigned int *bsize); -+static int squashfs_readpage(struct file *file, struct page *page); -+static int squashfs_readdir(struct file *, void *, filldir_t); -+static struct dentry *squashfs_lookup(struct inode *, struct dentry *, -+ struct nameidata *); -+static int squashfs_remount(struct super_block *s, int *flags, char *data); -+static void squashfs_put_super(struct super_block *); -+static int squashfs_get_sb(struct file_system_type *,int, const char *, void *, -+ struct vfsmount *); -+static struct inode *squashfs_alloc_inode(struct super_block *sb); -+static void squashfs_destroy_inode(struct inode *inode); -+static int init_inodecache(void); -+static void destroy_inodecache(void); -+ -+static struct file_system_type squashfs_fs_type = { -+ .owner = THIS_MODULE, -+ .name = "squashfs", -+ .get_sb = squashfs_get_sb, -+ .kill_sb = kill_block_super, -+ .fs_flags = FS_REQUIRES_DEV -+}; -+ -+static const unsigned char squashfs_filetype_table[] = { -+ DT_UNKNOWN, DT_DIR, DT_REG, DT_LNK, DT_BLK, DT_CHR, DT_FIFO, DT_SOCK -+}; -+ -+static struct super_operations squashfs_super_ops = { -+ .alloc_inode = squashfs_alloc_inode, -+ .destroy_inode = squashfs_destroy_inode, -+ .statfs = squashfs_statfs, -+ .put_super = squashfs_put_super, -+ .remount_fs = squashfs_remount -+}; -+ -+static struct export_operations squashfs_export_ops = { -+ .fh_to_dentry = squashfs_fh_to_dentry, -+ .fh_to_parent = squashfs_fh_to_parent, -+ .get_parent = squashfs_get_parent -+}; -+ -+SQSH_EXTERN const struct address_space_operations squashfs_symlink_aops = { -+ .readpage = squashfs_symlink_readpage -+}; -+ -+SQSH_EXTERN const struct address_space_operations squashfs_aops = { -+ .readpage = squashfs_readpage -+}; -+ -+static const struct file_operations squashfs_dir_ops = { -+ .read = generic_read_dir, -+ .readdir = squashfs_readdir -+}; -+ -+SQSH_EXTERN struct inode_operations squashfs_dir_inode_ops = { -+ .lookup = squashfs_lookup -+}; -+ -+ -+static struct buffer_head *get_block_length(struct super_block *s, -+ int *cur_index, int *offset, int *c_byte) -+{ -+ struct squashfs_sb_info *msblk = s->s_fs_info; -+ unsigned short temp; -+ struct buffer_head *bh; -+ -+ if (!(bh = sb_bread(s, *cur_index))) -+ goto out; -+ -+ if (msblk->devblksize - *offset == 1) { -+ if (msblk->swap) -+ ((unsigned char *) &temp)[1] = *((unsigned char *) -+ (bh->b_data + *offset)); -+ else -+ ((unsigned char *) &temp)[0] = *((unsigned char *) -+ (bh->b_data + *offset)); -+ brelse(bh); -+ if (!(bh = sb_bread(s, ++(*cur_index)))) -+ goto out; -+ if (msblk->swap) -+ ((unsigned char *) &temp)[0] = *((unsigned char *) -+ bh->b_data); -+ else -+ ((unsigned char *) &temp)[1] = *((unsigned char *) -+ bh->b_data); -+ *c_byte = temp; -+ *offset = 1; -+ } else { -+ if (msblk->swap) { -+ ((unsigned char *) &temp)[1] = *((unsigned char *) -+ (bh->b_data + *offset)); -+ ((unsigned char *) &temp)[0] = *((unsigned char *) -+ (bh->b_data + *offset + 1)); -+ } else { -+ ((unsigned char *) &temp)[0] = *((unsigned char *) -+ (bh->b_data + *offset)); -+ ((unsigned char *) &temp)[1] = *((unsigned char *) -+ (bh->b_data + *offset + 1)); -+ } -+ *c_byte = temp; -+ *offset += 2; -+ } -+ -+ if (SQUASHFS_CHECK_DATA(msblk->sblk.flags)) { -+ if (*offset == msblk->devblksize) { -+ brelse(bh); -+ if (!(bh = sb_bread(s, ++(*cur_index)))) -+ goto out; -+ *offset = 0; -+ } -+ if (*((unsigned char *) (bh->b_data + *offset)) != -+ SQUASHFS_MARKER_BYTE) { -+ ERROR("Metadata block marker corrupt @ %x\n", -+ *cur_index); -+ brelse(bh); -+ goto out; -+ } -+ (*offset)++; -+ } -+ return bh; -+ -+out: -+ return NULL; -+} -+ -+ -+SQSH_EXTERN unsigned int squashfs_read_data(struct super_block *s, char *buffer, -+ long long index, unsigned int length, -+ long long *next_index, int srclength) -+{ -+ struct squashfs_sb_info *msblk = s->s_fs_info; -+ struct squashfs_super_block *sblk = &msblk->sblk; -+ struct buffer_head **bh; -+ unsigned int offset = index & ((1 << msblk->devblksize_log2) - 1); -+ unsigned int cur_index = index >> msblk->devblksize_log2; -+ int bytes, avail_bytes, b = 0, k = 0; -+ unsigned int compressed; -+ unsigned int c_byte = length; -+ -+ bh = kmalloc(((sblk->block_size >> msblk->devblksize_log2) + 1) * -+ sizeof(struct buffer_head *), GFP_KERNEL); -+ if (bh == NULL) -+ goto read_failure; -+ -+ if (c_byte) { -+ bytes = -offset; -+ compressed = SQUASHFS_COMPRESSED_BLOCK(c_byte); -+ c_byte = SQUASHFS_COMPRESSED_SIZE_BLOCK(c_byte); -+ -+ TRACE("Block @ 0x%llx, %scompressed size %d, src size %d\n", index, -+ compressed ? "" : "un", (unsigned int) c_byte, srclength); -+ -+ if (c_byte > srclength || index < 0 || (index + c_byte) > sblk->bytes_used) -+ goto read_failure; -+ -+ for (b = 0; bytes < (int) c_byte; b++, cur_index++) { -+ bh[b] = sb_getblk(s, cur_index); -+ if (bh[b] == NULL) -+ goto block_release; -+ bytes += msblk->devblksize; -+ } -+ ll_rw_block(READ, b, bh); -+ } else { -+ if (index < 0 || (index + 2) > sblk->bytes_used) -+ goto read_failure; -+ -+ bh[0] = get_block_length(s, &cur_index, &offset, &c_byte); -+ if (bh[0] == NULL) -+ goto read_failure; -+ b = 1; -+ -+ bytes = msblk->devblksize - offset; -+ compressed = SQUASHFS_COMPRESSED(c_byte); -+ c_byte = SQUASHFS_COMPRESSED_SIZE(c_byte); -+ -+ TRACE("Block @ 0x%llx, %scompressed size %d\n", index, compressed -+ ? "" : "un", (unsigned int) c_byte); -+ -+ if (c_byte > srclength || (index + c_byte) > sblk->bytes_used) -+ goto block_release; -+ -+ for (; bytes < c_byte; b++) { -+ bh[b] = sb_getblk(s, ++cur_index); -+ if (bh[b] == NULL) -+ goto block_release; -+ bytes += msblk->devblksize; -+ } -+ ll_rw_block(READ, b - 1, bh + 1); -+ } -+ -+ if (compressed) { -+ int zlib_err = 0; -+ -+ /* -+ * uncompress block -+ */ -+ -+ mutex_lock(&msblk->read_data_mutex); -+ -+ msblk->stream.next_out = buffer; -+ msblk->stream.avail_out = srclength; -+ -+ for (bytes = 0; k < b; k++) { -+ avail_bytes = min(c_byte - bytes, msblk->devblksize - offset); -+ -+ wait_on_buffer(bh[k]); -+ if (!buffer_uptodate(bh[k])) -+ goto release_mutex; -+ -+ msblk->stream.next_in = bh[k]->b_data + offset; -+ msblk->stream.avail_in = avail_bytes; -+ -+ if (k == 0) { -+ zlib_err = zlib_inflateInit(&msblk->stream); -+ if (zlib_err != Z_OK) { -+ ERROR("zlib_inflateInit returned unexpected result 0x%x," -+ " srclength %d\n", zlib_err, srclength); -+ goto release_mutex; -+ } -+ -+ if (avail_bytes == 0) { -+ offset = 0; -+ brelse(bh[k]); -+ continue; -+ } -+ } -+ -+ zlib_err = zlib_inflate(&msblk->stream, Z_NO_FLUSH); -+ if (zlib_err != Z_OK && zlib_err != Z_STREAM_END) { -+ ERROR("zlib_inflate returned unexpected result 0x%x," -+ " srclength %d, avail_in %d, avail_out %d\n", zlib_err, -+ srclength, msblk->stream.avail_in, msblk->stream.avail_out); -+ goto release_mutex; -+ } -+ -+ bytes += avail_bytes; -+ offset = 0; -+ brelse(bh[k]); -+ } -+ -+ if (zlib_err != Z_STREAM_END) -+ goto release_mutex; -+ -+ zlib_err = zlib_inflateEnd(&msblk->stream); -+ if (zlib_err != Z_OK) { -+ ERROR("zlib_inflateEnd returned unexpected result 0x%x," -+ " srclength %d\n", zlib_err, srclength); -+ goto release_mutex; -+ } -+ bytes = msblk->stream.total_out; -+ mutex_unlock(&msblk->read_data_mutex); -+ } else { -+ int i; -+ -+ for(i = 0; i < b; i++) { -+ wait_on_buffer(bh[i]); -+ if (!buffer_uptodate(bh[i])) -+ goto block_release; -+ } -+ -+ for (bytes = 0; k < b; k++) { -+ avail_bytes = min(c_byte - bytes, msblk->devblksize - offset); -+ -+ memcpy(buffer + bytes, bh[k]->b_data + offset, avail_bytes); -+ bytes += avail_bytes; -+ offset = 0; -+ brelse(bh[k]); -+ } -+ } -+ -+ if (next_index) -+ *next_index = index + c_byte + (length ? 0 : -+ (SQUASHFS_CHECK_DATA(msblk->sblk.flags) ? 3 : 2)); -+ -+ kfree(bh); -+ return bytes; -+ -+release_mutex: -+ mutex_unlock(&msblk->read_data_mutex); -+ -+block_release: -+ for (; k < b; k++) -+ brelse(bh[k]); -+ -+read_failure: -+ ERROR("sb_bread failed reading block 0x%x\n", cur_index); -+ kfree(bh); -+ return 0; -+} -+ -+ -+static struct squashfs_cache_entry *squashfs_cache_get(struct super_block *s, -+ struct squashfs_cache *cache, long long block, int length) -+{ -+ int i, n; -+ struct squashfs_cache_entry *entry; -+ -+ spin_lock(&cache->lock); -+ -+ while (1) { -+ for (i = 0; i < cache->entries && cache->entry[i].block != block; i++); -+ -+ if (i == cache->entries) { -+ if (cache->unused_blks == 0) { -+ cache->waiting ++; -+ spin_unlock(&cache->lock); -+ wait_event(cache->wait_queue, cache->unused_blks); -+ spin_lock(&cache->lock); -+ cache->waiting --; -+ continue; -+ } -+ -+ i = cache->next_blk; -+ for (n = 0; n < cache->entries; n++) { -+ if (cache->entry[i].locked == 0) -+ break; -+ i = (i + 1) % cache->entries; -+ } -+ -+ cache->next_blk = (i + 1) % cache->entries; -+ entry = &cache->entry[i]; -+ -+ cache->unused_blks --; -+ entry->block = block; -+ entry->locked = 1; -+ entry->pending = 1; -+ entry->waiting = 0; -+ entry->error = 0; -+ spin_unlock(&cache->lock); -+ -+ entry->length = squashfs_read_data(s, entry->data, -+ block, length, &entry->next_index, cache->block_size); -+ -+ spin_lock(&cache->lock); -+ -+ if (entry->length == 0) -+ entry->error = 1; -+ -+ entry->pending = 0; -+ spin_unlock(&cache->lock); -+ if (entry->waiting) -+ wake_up_all(&entry->wait_queue); -+ goto out; -+ } -+ -+ entry = &cache->entry[i]; -+ if (entry->locked == 0) -+ cache->unused_blks --; -+ entry->locked++; -+ -+ if (entry->pending) { -+ entry->waiting ++; -+ spin_unlock(&cache->lock); -+ wait_event(entry->wait_queue, !entry->pending); -+ goto out; -+ } -+ -+ spin_unlock(&cache->lock); -+ goto out; -+ } -+ -+out: -+ TRACE("Got %s %d, start block %lld, locked %d, error %d\n", i, -+ cache->name, entry->block, entry->locked, entry->error); -+ if (entry->error) -+ ERROR("Unable to read %s cache entry [%llx]\n", cache->name, block); -+ return entry; -+} -+ -+ -+static void squashfs_cache_put(struct squashfs_cache *cache, -+ struct squashfs_cache_entry *entry) -+{ -+ spin_lock(&cache->lock); -+ entry->locked --; -+ if (entry->locked == 0) { -+ cache->unused_blks ++; -+ spin_unlock(&cache->lock); -+ if (cache->waiting) -+ wake_up(&cache->wait_queue); -+ } else -+ spin_unlock(&cache->lock); -+} -+ -+ -+static void squashfs_cache_delete(struct squashfs_cache *cache) -+{ -+ int i; -+ -+ if (cache == NULL) -+ return; -+ -+ for (i = 0; i < cache->entries; i++) -+ if (cache->entry[i].data) { -+ if (cache->use_vmalloc) -+ vfree(cache->entry[i].data); -+ else -+ kfree(cache->entry[i].data); -+ } -+ -+ kfree(cache); -+} -+ -+ -+static struct squashfs_cache *squashfs_cache_init(char *name, int entries, -+ int block_size, int use_vmalloc) -+{ -+ int i; -+ struct squashfs_cache *cache = kzalloc(sizeof(struct squashfs_cache) + -+ entries * sizeof(struct squashfs_cache_entry), GFP_KERNEL); -+ if (cache == NULL) { -+ ERROR("Failed to allocate %s cache\n", name); -+ goto failed; -+ } -+ -+ cache->next_blk = 0; -+ cache->unused_blks = entries; -+ cache->entries = entries; -+ cache->block_size = block_size; -+ cache->use_vmalloc = use_vmalloc; -+ cache->name = name; -+ cache->waiting = 0; -+ spin_lock_init(&cache->lock); -+ init_waitqueue_head(&cache->wait_queue); -+ -+ for (i = 0; i < entries; i++) { -+ init_waitqueue_head(&cache->entry[i].wait_queue); -+ cache->entry[i].block = SQUASHFS_INVALID_BLK; -+ cache->entry[i].data = use_vmalloc ? vmalloc(block_size) : -+ kmalloc(block_size, GFP_KERNEL); -+ if (cache->entry[i].data == NULL) { -+ ERROR("Failed to allocate %s cache entry\n", name); -+ goto cleanup; -+ } -+ } -+ -+ return cache; -+ -+cleanup: -+ squashfs_cache_delete(cache); -+failed: -+ return NULL; -+} -+ -+ -+SQSH_EXTERN int squashfs_get_cached_block(struct super_block *s, void *buffer, -+ long long block, unsigned int offset, -+ int length, long long *next_block, -+ unsigned int *next_offset) -+{ -+ struct squashfs_sb_info *msblk = s->s_fs_info; -+ int bytes, return_length = length; -+ struct squashfs_cache_entry *entry; -+ -+ TRACE("Entered squashfs_get_cached_block [%llx:%x]\n", block, offset); -+ -+ while (1) { -+ entry = squashfs_cache_get(s, msblk->block_cache, block, 0); -+ bytes = entry->length - offset; -+ -+ if (entry->error || bytes < 1) { -+ return_length = 0; -+ goto finish; -+ } else if (bytes >= length) { -+ if (buffer) -+ memcpy(buffer, entry->data + offset, length); -+ if (entry->length - offset == length) { -+ *next_block = entry->next_index; -+ *next_offset = 0; -+ } else { -+ *next_block = block; -+ *next_offset = offset + length; -+ } -+ goto finish; -+ } else { -+ if (buffer) { -+ memcpy(buffer, entry->data + offset, bytes); -+ buffer = (char *) buffer + bytes; -+ } -+ block = entry->next_index; -+ squashfs_cache_put(msblk->block_cache, entry); -+ length -= bytes; -+ offset = 0; -+ } -+ } -+ -+finish: -+ squashfs_cache_put(msblk->block_cache, entry); -+ return return_length; -+} -+ -+ -+static int get_fragment_location(struct super_block *s, unsigned int fragment, -+ long long *fragment_start_block, -+ unsigned int *fragment_size) -+{ -+ struct squashfs_sb_info *msblk = s->s_fs_info; -+ long long start_block = -+ msblk->fragment_index[SQUASHFS_FRAGMENT_INDEX(fragment)]; -+ int offset = SQUASHFS_FRAGMENT_INDEX_OFFSET(fragment); -+ struct squashfs_fragment_entry fragment_entry; -+ -+ if (msblk->swap) { -+ struct squashfs_fragment_entry sfragment_entry; -+ -+ if (!squashfs_get_cached_block(s, &sfragment_entry, start_block, offset, -+ sizeof(sfragment_entry), &start_block, &offset)) -+ goto out; -+ SQUASHFS_SWAP_FRAGMENT_ENTRY(&fragment_entry, &sfragment_entry); -+ } else -+ if (!squashfs_get_cached_block(s, &fragment_entry, start_block, offset, -+ sizeof(fragment_entry), &start_block, &offset)) -+ goto out; -+ -+ *fragment_start_block = fragment_entry.start_block; -+ *fragment_size = fragment_entry.size; -+ -+ return 1; -+ -+out: -+ return 0; -+} -+ -+ -+SQSH_EXTERN void release_cached_fragment(struct squashfs_sb_info *msblk, -+ struct squashfs_cache_entry *fragment) -+{ -+ squashfs_cache_put(msblk->fragment_cache, fragment); -+} -+ -+ -+SQSH_EXTERN -+struct squashfs_cache_entry *get_cached_fragment(struct super_block *s, -+ long long start_block, int length) -+{ -+ struct squashfs_sb_info *msblk = s->s_fs_info; -+ -+ return squashfs_cache_get(s, msblk->fragment_cache, start_block, length); -+} -+ -+ -+static void squashfs_new_inode(struct squashfs_sb_info *msblk, struct inode *i, -+ struct squashfs_base_inode_header *inodeb) -+{ -+ i->i_ino = inodeb->inode_number; -+ i->i_mtime.tv_sec = inodeb->mtime; -+ i->i_atime.tv_sec = inodeb->mtime; -+ i->i_ctime.tv_sec = inodeb->mtime; -+ i->i_uid = msblk->uid[inodeb->uid]; -+ i->i_mode = inodeb->mode; -+ i->i_size = 0; -+ -+ if (inodeb->guid == SQUASHFS_GUIDS) -+ i->i_gid = i->i_uid; -+ else -+ i->i_gid = msblk->guid[inodeb->guid]; -+} -+ -+ -+static squashfs_inode_t squashfs_inode_lookup(struct super_block *s, int ino) -+{ -+ struct squashfs_sb_info *msblk = s->s_fs_info; -+ long long start = msblk->inode_lookup_table[SQUASHFS_LOOKUP_BLOCK(ino - 1)]; -+ int offset = SQUASHFS_LOOKUP_BLOCK_OFFSET(ino - 1); -+ squashfs_inode_t inode; -+ -+ TRACE("Entered squashfs_inode_lookup, inode_number = %d\n", ino); -+ -+ if (msblk->swap) { -+ squashfs_inode_t sinode; -+ -+ if (!squashfs_get_cached_block(s, &sinode, start, offset, -+ sizeof(sinode), &start, &offset)) -+ goto out; -+ SQUASHFS_SWAP_INODE_T((&inode), &sinode); -+ } else if (!squashfs_get_cached_block(s, &inode, start, offset, -+ sizeof(inode), &start, &offset)) -+ goto out; -+ -+ TRACE("squashfs_inode_lookup, inode = 0x%llx\n", inode); -+ -+ return inode; -+ -+out: -+ return SQUASHFS_INVALID_BLK; -+} -+ -+ -+ -+static struct dentry *squashfs_export_iget(struct super_block *s, -+ unsigned int inode_number) -+{ -+ squashfs_inode_t inode; -+ struct inode *i; -+ struct dentry *dentry; -+ -+ TRACE("Entered squashfs_export_iget\n"); -+ -+ inode = squashfs_inode_lookup(s, inode_number); -+ if(inode == SQUASHFS_INVALID_BLK) { -+ dentry = ERR_PTR(-ENOENT); -+ goto failure; -+ } -+ -+ i = squashfs_iget(s, inode, inode_number); -+ if(i == NULL) { -+ dentry = ERR_PTR(-EACCES); -+ goto failure; -+ } -+ -+ dentry = d_alloc_anon(i); -+ if (dentry == NULL) { -+ iput(i); -+ dentry = ERR_PTR(-ENOMEM); -+ } -+ -+failure: -+ return dentry; -+} -+ -+ -+static struct dentry *squashfs_fh_to_dentry(struct super_block *s, -+ struct fid *fid, int fh_len, int fh_type) -+{ -+ if((fh_type != FILEID_INO32_GEN && fh_type != FILEID_INO32_GEN_PARENT) || -+ fh_len < 2) -+ return NULL; -+ -+ return squashfs_export_iget(s, fid->i32.ino); -+} -+ -+ -+static struct dentry *squashfs_fh_to_parent(struct super_block *s, -+ struct fid *fid, int fh_len, int fh_type) -+{ -+ if(fh_type != FILEID_INO32_GEN_PARENT || fh_len < 4) -+ return NULL; -+ -+ return squashfs_export_iget(s, fid->i32.parent_ino); -+} -+ -+ -+static struct dentry *squashfs_get_parent(struct dentry *child) -+{ -+ struct inode *i = child->d_inode; -+ -+ TRACE("Entered squashfs_get_parent\n"); -+ -+ return squashfs_export_iget(i->i_sb, SQUASHFS_I(i)->u.s2.parent_inode); -+} -+ -+ -+SQSH_EXTERN struct inode *squashfs_iget(... [truncated message content] |