Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 30 Jan 2014 02:07:52 +0000 (18:07 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 30 Jan 2014 02:07:52 +0000 (18:07 -0800)
Pull sparc update from David Miller:
 "Two cleanups from Paul Gortmaker and hook up the new scheduler system
  calls"

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
  sparc: Hook up sched_setattr and sched_getattr syscalls.
  sparc: don't use module_init in non-modular pci.c code
  sparc: delete non-required instances of include <linux/init.h>

43 files changed:
Documentation/ABI/testing/configfs-usb-gadget
Documentation/ABI/testing/configfs-usb-gadget-acm
Documentation/ABI/testing/configfs-usb-gadget-ecm
Documentation/ABI/testing/configfs-usb-gadget-eem
Documentation/ABI/testing/configfs-usb-gadget-ffs
Documentation/ABI/testing/configfs-usb-gadget-loopback
Documentation/ABI/testing/configfs-usb-gadget-mass-storage
Documentation/ABI/testing/configfs-usb-gadget-ncm
Documentation/ABI/testing/configfs-usb-gadget-obex
Documentation/ABI/testing/configfs-usb-gadget-phonet
Documentation/ABI/testing/configfs-usb-gadget-rndis
Documentation/ABI/testing/configfs-usb-gadget-serial
Documentation/ABI/testing/configfs-usb-gadget-sourcesink
Documentation/ABI/testing/configfs-usb-gadget-subset
Documentation/sysctl/vm.txt
MAINTAINERS
arch/s390/kernel/compat_linux.c
drivers/ide/ide-cd_verbose.c
drivers/ide/ide-pio-blacklist.c
fs/ceph/acl.c
fs/ceph/dir.c
fs/ceph/inode.c
fs/ceph/super.h
fs/dcookies.c
fs/notify/fanotify/fanotify.c
fs/notify/fanotify/fanotify.h
fs/notify/fanotify/fanotify_user.c
fs/notify/inotify/inotify_fsnotify.c
fs/notify/notification.c
fs/read_write.c
include/linux/compat.h
include/linux/fsnotify_backend.h
include/linux/vmstat.h
lib/dma-debug.c
lib/genalloc.c
mm/internal.h
mm/memblock.c
mm/mempolicy.c
mm/page-writeback.c
mm/readahead.c
mm/slab_common.c
mm/slub.c
mm/vmscan.c

index 01e769d6984d575bc431b3be14f014434633427b..37559a06393b56c743ee9b45c129f268bc16aa6c 100644 (file)
@@ -1,13 +1,13 @@
 What:          /config/usb-gadget
 Date:          Jun 2013
-KenelVersion:  3.11
+KernelVersion: 3.11
 Description:
                This group contains sub-groups corresponding to created
                USB gadgets.
 
 What:          /config/usb-gadget/gadget
 Date:          Jun 2013
-KenelVersion:  3.11
+KernelVersion: 3.11
 Description:
 
                The attributes of a gadget:
@@ -27,7 +27,7 @@ Description:
 
 What:          /config/usb-gadget/gadget/configs
 Date:          Jun 2013
-KenelVersion:  3.11
+KernelVersion: 3.11
 Description:
                This group contains a USB gadget's configurations
 
@@ -58,20 +58,20 @@ Description:
 
 What:          /config/usb-gadget/gadget/functions
 Date:          Jun 2013
-KenelVersion:  3.11
+KernelVersion: 3.11
 Description:
                This group contains functions available to this USB gadget.
 
 What:          /config/usb-gadget/gadget/strings
 Date:          Jun 2013
-KenelVersion:  3.11
+KernelVersion: 3.11
 Description:
                This group contains subdirectories for language-specific
                strings for this gadget.
 
 What:          /config/usb-gadget/gadget/strings/language
 Date:          Jun 2013
-KenelVersion:  3.11
+KernelVersion: 3.11
 Description:
                The attributes:
 
index 5708a568b5f6fb63fa7493e7ff33831ab5acbd90..d21092d75a0587ea8d7edbcd48a9af344388396d 100644 (file)
@@ -1,6 +1,6 @@
 What:          /config/usb-gadget/gadget/functions/acm.name
 Date:          Jun 2013
-KenelVersion:  3.11
+KernelVersion: 3.11
 Description:
 
                This item contains just one readonly attribute: port_num.
index 6b9a582ce0b55afbca2f25688577cc4ea15cc675..0addf7704b4c0ee9639406abfd7f16184d7402fd 100644 (file)
@@ -1,6 +1,6 @@
 What:          /config/usb-gadget/gadget/functions/ecm.name
 Date:          Jun 2013
-KenelVersion:  3.11
+KernelVersion: 3.11
 Description:
                The attributes:
 
index dbddf36b48b3c037f2822f06469c4e85d4e23928..a4c57158fcdef28a8805157b24015eb4edb38568 100644 (file)
@@ -1,6 +1,6 @@
 What:          /config/usb-gadget/gadget/functions/eem.name
 Date:          Jun 2013
-KenelVersion:  3.11
+KernelVersion: 3.11
 Description:
                The attributes:
 
index 14343e237e83910e54255d14f7c85cf5837a7957..e39b27653c65c15f4911db846c7ca98859bf0463 100644 (file)
@@ -1,6 +1,6 @@
 What:          /config/usb-gadget/gadget/functions/ffs.name
 Date:          Nov 2013
-KenelVersion:  3.13
+KernelVersion: 3.13
 Description:   The purpose of this directory is to create and remove it.
 
                A corresponding USB function instance is created/removed.
index 852b2365a5b57a2e0c7f56030815b7397fddb695..9aae5bfb990887a6ad3faee29830d1603a7ecb19 100644 (file)
@@ -1,6 +1,6 @@
 What:          /config/usb-gadget/gadget/functions/Loopback.name
 Date:          Nov 2013
-KenelVersion:  3.13
+KernelVersion: 3.13
 Description:
                The attributes:
 
index ad72a37ee9ff24fab43631db8c8a0b01f02f4252..9931fb0d63ba44ce155d3e859a5bac2df451298a 100644 (file)
@@ -1,6 +1,6 @@
 What:          /config/usb-gadget/gadget/functions/mass_storage.name
 Date:          Oct 2013
-KenelVersion:  3.13
+KernelVersion: 3.13
 Description:
                The attributes:
 
@@ -13,7 +13,7 @@ Description:
 
 What:          /config/usb-gadget/gadget/functions/mass_storage.name/lun.name
 Date:          Oct 2013
-KenelVersion:  3.13
+KernelVersion: 3.13
 Description:
                The attributes:
 
index bc309f42357d60a3843eed7f71b4c0e9fd55d660..6fe723effc7894aeccfc297a34219cd0a5725565 100644 (file)
@@ -1,6 +1,6 @@
 What:          /config/usb-gadget/gadget/functions/ncm.name
 Date:          Jun 2013
-KenelVersion:  3.11
+KernelVersion: 3.11
 Description:
                The attributes:
 
index aaa5c96fb7c609de47de1a716c1d233ce7f43368..a6a9327ed9ba51ea6bd0d2aa7d844ccb00cb32cb 100644 (file)
@@ -1,6 +1,6 @@
 What:          /config/usb-gadget/gadget/functions/obex.name
 Date:          Jun 2013
-KenelVersion:  3.11
+KernelVersion: 3.11
 Description:
 
                This item contains just one readonly attribute: port_num.
index 3e3b742cdfd73aa4c3d04da9e061cb9a932d5257..7037a358e6c48f672b0aab94ec5159a29fe9fcdc 100644 (file)
@@ -1,6 +1,6 @@
 What:          /config/usb-gadget/gadget/functions/phonet.name
 Date:          Jun 2013
-KenelVersion:  3.11
+KernelVersion: 3.11
 Description:
 
                This item contains just one readonly attribute: ifname.
index 822e6dad8fc08e5644a7e8297464f04d804e4d8f..e32879b84b4d092ffc3aa3c655c470ec5135c9fd 100644 (file)
@@ -1,6 +1,6 @@
 What:          /config/usb-gadget/gadget/functions/rndis.name
 Date:          Jun 2013
-KenelVersion:  3.11
+KernelVersion: 3.11
 Description:
                The attributes:
 
index 16f130c1501f009f0d021138d48a8b27da58ee52..474d249f760be01f1311ba17842b4c4e827c8079 100644 (file)
@@ -1,6 +1,6 @@
 What:          /config/usb-gadget/gadget/functions/gser.name
 Date:          Jun 2013
-KenelVersion:  3.11
+KernelVersion: 3.11
 Description:
 
                This item contains just one readonly attribute: port_num.
index a30f3093ef6caeb9b0891474884c40432e898000..29477c319f61bf16f1259962237f4b3f0a7e6287 100644 (file)
@@ -1,6 +1,6 @@
 What:          /config/usb-gadget/gadget/functions/SourceSink.name
 Date:          Nov 2013
-KenelVersion:  3.13
+KernelVersion: 3.13
 Description:
                The attributes:
 
index 154ae597cd99a84604decdd1a667f18707bda7e1..9373e2c51ea454e6de4031908ed5cdee4a04e9b6 100644 (file)
@@ -1,6 +1,6 @@
 What:          /config/usb-gadget/gadget/functions/geth.name
 Date:          Jun 2013
-KenelVersion:  3.11
+KernelVersion: 3.11
 Description:
                The attributes:
 
index 9f5481bdc5a43f942fb833f3131901249d2d5c50..d614a9b6a28048ecf879e96b3aada686ecadb6cb 100644 (file)
@@ -696,7 +696,9 @@ swappiness
 
 This control is used to define how aggressive the kernel will swap
 memory pages.  Higher values will increase agressiveness, lower values
-decrease the amount of swap.
+decrease the amount of swap.  A value of 0 instructs the kernel not to
+initiate swap until the amount of free and file-backed pages is less
+than the high water mark in a zone.
 
 The default value is 60.
 
index 6d73831cfdee11ccc6b1c858a0cd16b22fca0e69..38b81df6701c1d744ce14efbe301f6d16c2257ee 100644 (file)
@@ -309,36 +309,36 @@ F:        sound/pci/ad1889.*
 
 AD525X ANALOG DEVICES DIGITAL POTENTIOMETERS DRIVER
 M:     Michael Hennerich <michael.hennerich@analog.com>
-L:     device-drivers-devel@blackfin.uclinux.org
 W:     http://wiki.analog.com/AD5254
+W:     http://ez.analog.com/community/linux-device-drivers
 S:     Supported
 F:     drivers/misc/ad525x_dpot.c
 
 AD5398 CURRENT REGULATOR DRIVER (AD5398/AD5821)
 M:     Michael Hennerich <michael.hennerich@analog.com>
-L:     device-drivers-devel@blackfin.uclinux.org
 W:     http://wiki.analog.com/AD5398
+W:     http://ez.analog.com/community/linux-device-drivers
 S:     Supported
 F:     drivers/regulator/ad5398.c
 
 AD714X CAPACITANCE TOUCH SENSOR DRIVER (AD7142/3/7/8/7A)
 M:     Michael Hennerich <michael.hennerich@analog.com>
-L:     device-drivers-devel@blackfin.uclinux.org
 W:     http://wiki.analog.com/AD7142
+W:     http://ez.analog.com/community/linux-device-drivers
 S:     Supported
 F:     drivers/input/misc/ad714x.c
 
 AD7877 TOUCHSCREEN DRIVER
 M:     Michael Hennerich <michael.hennerich@analog.com>
-L:     device-drivers-devel@blackfin.uclinux.org
 W:     http://wiki.analog.com/AD7877
+W:     http://ez.analog.com/community/linux-device-drivers
 S:     Supported
 F:     drivers/input/touchscreen/ad7877.c
 
 AD7879 TOUCHSCREEN DRIVER (AD7879/AD7889)
 M:     Michael Hennerich <michael.hennerich@analog.com>
-L:     device-drivers-devel@blackfin.uclinux.org
 W:     http://wiki.analog.com/AD7879
+W:     http://ez.analog.com/community/linux-device-drivers
 S:     Supported
 F:     drivers/input/touchscreen/ad7879.c
 
@@ -374,8 +374,8 @@ F:  include/media/adp1653.h
 
 ADP5520 BACKLIGHT DRIVER WITH IO EXPANDER (ADP5520/ADP5501)
 M:     Michael Hennerich <michael.hennerich@analog.com>
-L:     device-drivers-devel@blackfin.uclinux.org
 W:     http://wiki.analog.com/ADP5520
+W:     http://ez.analog.com/community/linux-device-drivers
 S:     Supported
 F:     drivers/mfd/adp5520.c
 F:     drivers/video/backlight/adp5520_bl.c
@@ -385,16 +385,16 @@ F:        drivers/input/keyboard/adp5520-keys.c
 
 ADP5588 QWERTY KEYPAD AND IO EXPANDER DRIVER (ADP5588/ADP5587)
 M:     Michael Hennerich <michael.hennerich@analog.com>
-L:     device-drivers-devel@blackfin.uclinux.org
 W:     http://wiki.analog.com/ADP5588
+W:     http://ez.analog.com/community/linux-device-drivers
 S:     Supported
 F:     drivers/input/keyboard/adp5588-keys.c
 F:     drivers/gpio/gpio-adp5588.c
 
 ADP8860 BACKLIGHT DRIVER (ADP8860/ADP8861/ADP8863)
 M:     Michael Hennerich <michael.hennerich@analog.com>
-L:     device-drivers-devel@blackfin.uclinux.org
 W:     http://wiki.analog.com/ADP8860
+W:     http://ez.analog.com/community/linux-device-drivers
 S:     Supported
 F:     drivers/video/backlight/adp8860_bl.c
 
@@ -420,8 +420,8 @@ F:  drivers/hwmon/adt7475.c
 
 ADXL34X THREE-AXIS DIGITAL ACCELEROMETER DRIVER (ADXL345/ADXL346)
 M:     Michael Hennerich <michael.hennerich@analog.com>
-L:     device-drivers-devel@blackfin.uclinux.org
 W:     http://wiki.analog.com/ADXL345
+W:     http://ez.analog.com/community/linux-device-drivers
 S:     Supported
 F:     drivers/input/misc/adxl34x.c
 
@@ -627,9 +627,9 @@ F:  drivers/media/i2c/adv7842*
 
 ANALOG DEVICES INC ASOC CODEC DRIVERS
 M:     Lars-Peter Clausen <lars@metafoo.de>
-L:     device-drivers-devel@blackfin.uclinux.org
 L:     alsa-devel@alsa-project.org (moderated for non-subscribers)
 W:     http://wiki.analog.com/
+W:     http://ez.analog.com/community/linux-device-drivers
 S:     Supported
 F:     sound/soc/codecs/adau*
 F:     sound/soc/codecs/adav*
@@ -639,7 +639,7 @@ F:  sound/soc/codecs/ssm*
 F:     sound/soc/codecs/sigmadsp.*
 
 ANALOG DEVICES INC ASOC DRIVERS
-L:     uclinux-dist-devel@blackfin.uclinux.org
+L:     adi-buildroot-devel@lists.sourceforge.net
 L:     alsa-devel@alsa-project.org (moderated for non-subscribers)
 W:     http://blackfin.uclinux.org/
 S:     Supported
@@ -1742,56 +1742,54 @@ F:      fs/bfs/
 F:     include/uapi/linux/bfs_fs.h
 
 BLACKFIN ARCHITECTURE
-M:     Mike Frysinger <vapier@gentoo.org>
-L:     uclinux-dist-devel@blackfin.uclinux.org
+M:     Steven Miao <realmz6@gmail.com>
+L:     adi-buildroot-devel@lists.sourceforge.net
 W:     http://blackfin.uclinux.org
 S:     Supported
 F:     arch/blackfin/
 
 BLACKFIN EMAC DRIVER
-L:     uclinux-dist-devel@blackfin.uclinux.org
+L:     adi-buildroot-devel@lists.sourceforge.net
 W:     http://blackfin.uclinux.org
 S:     Supported
 F:     drivers/net/ethernet/adi/
 
 BLACKFIN RTC DRIVER
-M:     Mike Frysinger <vapier.adi@gmail.com>
-L:     uclinux-dist-devel@blackfin.uclinux.org
+L:     adi-buildroot-devel@lists.sourceforge.net
 W:     http://blackfin.uclinux.org
 S:     Supported
 F:     drivers/rtc/rtc-bfin.c
 
 BLACKFIN SDH DRIVER
 M:     Sonic Zhang <sonic.zhang@analog.com>
-L:     uclinux-dist-devel@blackfin.uclinux.org
+L:     adi-buildroot-devel@lists.sourceforge.net
 W:     http://blackfin.uclinux.org
 S:     Supported
 F:     drivers/mmc/host/bfin_sdh.c
 
 BLACKFIN SERIAL DRIVER
 M:     Sonic Zhang <sonic.zhang@analog.com>
-L:     uclinux-dist-devel@blackfin.uclinux.org
+L:     adi-buildroot-devel@lists.sourceforge.net
 W:     http://blackfin.uclinux.org
 S:     Supported
 F:     drivers/tty/serial/bfin_uart.c
 
 BLACKFIN WATCHDOG DRIVER
-M:     Mike Frysinger <vapier.adi@gmail.com>
-L:     uclinux-dist-devel@blackfin.uclinux.org
+L:     adi-buildroot-devel@lists.sourceforge.net
 W:     http://blackfin.uclinux.org
 S:     Supported
 F:     drivers/watchdog/bfin_wdt.c
 
 BLACKFIN I2C TWI DRIVER
 M:     Sonic Zhang <sonic.zhang@analog.com>
-L:     uclinux-dist-devel@blackfin.uclinux.org
+L:     adi-buildroot-devel@lists.sourceforge.net
 W:     http://blackfin.uclinux.org/
 S:     Supported
 F:     drivers/i2c/busses/i2c-bfin-twi.c
 
 BLACKFIN MEDIA DRIVER
 M:     Scott Jiang <scott.jiang.linux@gmail.com>
-L:     uclinux-dist-devel@blackfin.uclinux.org
+L:     adi-buildroot-devel@lists.sourceforge.net
 W:     http://blackfin.uclinux.org/
 S:     Supported
 F:     drivers/media/platform/blackfin/
index e030d2bdec1b6aa2b9f29288b28c6600710ecfd1..db02052bd137254c1c6d46314005ed4fce1a6204 100644 (file)
@@ -286,8 +286,8 @@ asmlinkage long sys32_getegid16(void)
 }
 
 #ifdef CONFIG_SYSVIPC
-COMPAT_SYSCALL_DEFINE5(s390_ipc, uint, call, int, first, unsigned long, second,
-               unsigned long, third, compat_uptr_t, ptr)
+COMPAT_SYSCALL_DEFINE5(s390_ipc, uint, call, int, first, compat_ulong_t, second,
+               compat_ulong_t, third, compat_uptr_t, ptr)
 {
        if (call >> 16)         /* hack for backward compatibility */
                return -EINVAL;
index 6490a2dea96b01526657615ceb7139d9b1603a55..f079ca2f260b605ae5f20b7f1010d653baad22e2 100644 (file)
@@ -9,7 +9,9 @@
 #include <linux/kernel.h>
 #include <linux/blkdev.h>
 #include <linux/cdrom.h>
+#include <linux/ide.h>
 #include <scsi/scsi.h>
+#include "ide-cd.h"
 
 #ifndef CONFIG_BLK_DEV_IDECD_VERBOSE_ERRORS
 void ide_cd_log_error(const char *name, struct request *failed_command,
index a8c2c8f8660a6a312c7d6767f9a0fee14abf79e1..40e683a84ff91b61ebd7487cd6e074528c7d3c67 100644 (file)
@@ -7,6 +7,7 @@
  */
 
 #include <linux/string.h>
+#include <linux/ide.h>
 
 static struct ide_pio_info {
        const char      *name;
index f6911284c9bd63e45bf174b290f272656f9f29e1..66d377a12f7c197b5e4e20b94606aae80d71e696 100644 (file)
@@ -107,14 +107,14 @@ struct posix_acl *ceph_get_acl(struct inode *inode, int type)
        return acl;
 }
 
-static int ceph_set_acl(struct dentry *dentry, struct inode *inode,
-                               struct posix_acl *acl, int type)
+int ceph_set_acl(struct inode *inode, struct posix_acl *acl, int type)
 {
        int ret = 0, size = 0;
        const char *name = NULL;
        char *value = NULL;
        struct iattr newattrs;
        umode_t new_mode = inode->i_mode, old_mode = inode->i_mode;
+       struct dentry *dentry = d_find_alias(inode);
 
        if (acl) {
                ret = posix_acl_valid(acl);
@@ -208,8 +208,7 @@ int ceph_init_acl(struct dentry *dentry, struct inode *inode, struct inode *dir)
 
        if (IS_POSIXACL(dir) && acl) {
                if (S_ISDIR(inode->i_mode)) {
-                       ret = ceph_set_acl(dentry, inode, acl,
-                                               ACL_TYPE_DEFAULT);
+                       ret = ceph_set_acl(inode, acl, ACL_TYPE_DEFAULT);
                        if (ret)
                                goto out_release;
                }
@@ -217,7 +216,7 @@ int ceph_init_acl(struct dentry *dentry, struct inode *inode, struct inode *dir)
                if (ret < 0)
                        goto out;
                else if (ret > 0)
-                       ret = ceph_set_acl(dentry, inode, acl, ACL_TYPE_ACCESS);
+                       ret = ceph_set_acl(inode, acl, ACL_TYPE_ACCESS);
                else
                        cache_no_acl(inode);
        } else {
index 619616d585b04128d9084a0051d9c43ea533a3b6..6da4df84ba300824a8a6afdea9f2a20121600765 100644 (file)
@@ -1303,6 +1303,7 @@ const struct inode_operations ceph_dir_iops = {
        .listxattr = ceph_listxattr,
        .removexattr = ceph_removexattr,
        .get_acl = ceph_get_acl,
+       .set_acl = ceph_set_acl,
        .mknod = ceph_mknod,
        .symlink = ceph_symlink,
        .mkdir = ceph_mkdir,
index 8b8b506636ccce45fa38ab8bca6758d2b3d6ef82..32d519d8a2e210316fbf2af3b2c0a842d47a13b2 100644 (file)
@@ -97,6 +97,7 @@ const struct inode_operations ceph_file_iops = {
        .listxattr = ceph_listxattr,
        .removexattr = ceph_removexattr,
        .get_acl = ceph_get_acl,
+       .set_acl = ceph_set_acl,
 };
 
 
@@ -1616,6 +1617,7 @@ static const struct inode_operations ceph_symlink_iops = {
        .listxattr = ceph_listxattr,
        .removexattr = ceph_removexattr,
        .get_acl = ceph_get_acl,
+       .set_acl = ceph_set_acl,
 };
 
 /*
index 345933948b6e9d4320430bb3b1cbeba2cd5af29f..aa260590f6154cce25517c24789e62f58ed1b7a3 100644 (file)
@@ -718,6 +718,7 @@ extern void ceph_queue_writeback(struct inode *inode);
 extern int ceph_do_getattr(struct inode *inode, int mask);
 extern int ceph_permission(struct inode *inode, int mask);
 extern int ceph_setattr(struct dentry *dentry, struct iattr *attr);
+extern int ceph_setattr(struct dentry *dentry, struct iattr *attr);
 extern int ceph_getattr(struct vfsmount *mnt, struct dentry *dentry,
                        struct kstat *stat);
 
@@ -741,12 +742,14 @@ extern const struct xattr_handler *ceph_xattr_handlers[];
 #ifdef CONFIG_CEPH_FS_POSIX_ACL
 
 struct posix_acl *ceph_get_acl(struct inode *, int);
+int ceph_set_acl(struct inode *inode, struct posix_acl *acl, int type);
 int ceph_init_acl(struct dentry *, struct inode *, struct inode *);
 void ceph_forget_all_cached_acls(struct inode *inode);
 
 #else
 
 #define ceph_get_acl NULL
+#define ceph_set_acl NULL
 
 static inline int ceph_init_acl(struct dentry *dentry, struct inode *inode,
                                struct inode *dir)
index ab5954b50267d29afa219bbaec128af2304f59e2..ac44a69fbea9a533dbcc27cdc27771f4f7795f1e 100644 (file)
@@ -204,7 +204,7 @@ out:
 }
 
 #ifdef CONFIG_COMPAT
-COMPAT_SYSCALL_DEFINE4(lookup_dcookie, u32, w0, u32, w1, char __user *, buf, size_t, len)
+COMPAT_SYSCALL_DEFINE4(lookup_dcookie, u32, w0, u32, w1, char __user *, buf, compat_size_t, len)
 {
 #ifdef __BIG_ENDIAN
        return sys_lookup_dcookie(((u64)w0 << 32) | w1, buf, len);
index 58772623f02a90e7e7c4355921ba0c8457024175..0e792f5e3147c3cfcf38a980716075ea509b0e46 100644 (file)
@@ -16,12 +16,6 @@ static bool should_merge(struct fsnotify_event *old_fsn,
 {
        struct fanotify_event_info *old, *new;
 
-#ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS
-       /* dont merge two permission events */
-       if ((old_fsn->mask & FAN_ALL_PERM_EVENTS) &&
-           (new_fsn->mask & FAN_ALL_PERM_EVENTS))
-               return false;
-#endif
        pr_debug("%s: old=%p new=%p\n", __func__, old_fsn, new_fsn);
        old = FANOTIFY_E(old_fsn);
        new = FANOTIFY_E(new_fsn);
@@ -34,14 +28,23 @@ static bool should_merge(struct fsnotify_event *old_fsn,
 }
 
 /* and the list better be locked by something too! */
-static struct fsnotify_event *fanotify_merge(struct list_head *list,
-                                            struct fsnotify_event *event)
+static int fanotify_merge(struct list_head *list, struct fsnotify_event *event)
 {
        struct fsnotify_event *test_event;
        bool do_merge = false;
 
        pr_debug("%s: list=%p event=%p\n", __func__, list, event);
 
+#ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS
+       /*
+        * Don't merge a permission event with any other event so that we know
+        * the event structure we have created in fanotify_handle_event() is the
+        * one we should check for permission response.
+        */
+       if (event->mask & FAN_ALL_PERM_EVENTS)
+               return 0;
+#endif
+
        list_for_each_entry_reverse(test_event, list, list) {
                if (should_merge(test_event, event)) {
                        do_merge = true;
@@ -50,10 +53,10 @@ static struct fsnotify_event *fanotify_merge(struct list_head *list,
        }
 
        if (!do_merge)
-               return NULL;
+               return 0;
 
        test_event->mask |= event->mask;
-       return test_event;
+       return 1;
 }
 
 #ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS
@@ -149,7 +152,6 @@ static int fanotify_handle_event(struct fsnotify_group *group,
        int ret = 0;
        struct fanotify_event_info *event;
        struct fsnotify_event *fsn_event;
-       struct fsnotify_event *notify_fsn_event;
 
        BUILD_BUG_ON(FAN_ACCESS != FS_ACCESS);
        BUILD_BUG_ON(FAN_MODIFY != FS_MODIFY);
@@ -188,21 +190,19 @@ static int fanotify_handle_event(struct fsnotify_group *group,
        event->response = 0;
 #endif
 
-       notify_fsn_event = fsnotify_add_notify_event(group, fsn_event,
-                                                    fanotify_merge);
-       if (notify_fsn_event) {
+       ret = fsnotify_add_notify_event(group, fsn_event, fanotify_merge);
+       if (ret) {
+               BUG_ON(mask & FAN_ALL_PERM_EVENTS);
                /* Our event wasn't used in the end. Free it. */
                fsnotify_destroy_event(group, fsn_event);
-               if (IS_ERR(notify_fsn_event))
-                       return PTR_ERR(notify_fsn_event);
-               /* We need to ask about a different events after a merge... */
-               event = FANOTIFY_E(notify_fsn_event);
-               fsn_event = notify_fsn_event;
+               ret = 0;
        }
 
 #ifdef CONFIG_FANOTIFY_ACCESS_PERMISSIONS
-       if (fsn_event->mask & FAN_ALL_PERM_EVENTS)
+       if (mask & FAN_ALL_PERM_EVENTS) {
                ret = fanotify_get_response_from_access(group, event);
+               fsnotify_destroy_event(group, fsn_event);
+       }
 #endif
        return ret;
 }
index 0e90174a116a2c337f77af9e11760f1c21e00e43..32a2f034fb94b5915d1e8362ecbac21f362653fb 100644 (file)
@@ -4,6 +4,13 @@
 
 extern struct kmem_cache *fanotify_event_cachep;
 
+/*
+ * Lifetime of the structure differs for normal and permission events. In both
+ * cases the structure is allocated in fanotify_handle_event(). For normal
+ * events the structure is freed immediately after reporting it to userspace.
+ * For permission events we free it only after we receive response from
+ * userspace.
+ */
 struct fanotify_event_info {
        struct fsnotify_event fse;
        /*
index 1fd66abe574003cce8766e4533c1c42b27de4aff..b6175fa11bf856809d1ee6a43ee9b861980e9160 100644 (file)
@@ -319,7 +319,12 @@ static ssize_t fanotify_read(struct file *file, char __user *buf,
                        if (IS_ERR(kevent))
                                break;
                        ret = copy_event_to_user(group, kevent, buf);
-                       fsnotify_destroy_event(group, kevent);
+                       /*
+                        * Permission events get destroyed after we
+                        * receive response
+                        */
+                       if (!(kevent->mask & FAN_ALL_PERM_EVENTS))
+                               fsnotify_destroy_event(group, kevent);
                        if (ret < 0)
                                break;
                        buf += ret;
index aad1a35e9af117fdc397cca897ba6f192f2de7a0..d5ee56348bb803fd0ddff46d4f3da7d0fa7016d1 100644 (file)
@@ -53,15 +53,13 @@ static bool event_compare(struct fsnotify_event *old_fsn,
        return false;
 }
 
-static struct fsnotify_event *inotify_merge(struct list_head *list,
-                                           struct fsnotify_event *event)
+static int inotify_merge(struct list_head *list,
+                         struct fsnotify_event *event)
 {
        struct fsnotify_event *last_event;
 
        last_event = list_entry(list->prev, struct fsnotify_event, list);
-       if (!event_compare(last_event, event))
-               return NULL;
-       return last_event;
+       return event_compare(last_event, event);
 }
 
 int inotify_handle_event(struct fsnotify_group *group,
@@ -73,9 +71,8 @@ int inotify_handle_event(struct fsnotify_group *group,
 {
        struct inotify_inode_mark *i_mark;
        struct inotify_event_info *event;
-       struct fsnotify_event *added_event;
        struct fsnotify_event *fsn_event;
-       int ret = 0;
+       int ret;
        int len = 0;
        int alloc_len = sizeof(struct inotify_event_info);
 
@@ -110,18 +107,16 @@ int inotify_handle_event(struct fsnotify_group *group,
        if (len)
                strcpy(event->name, file_name);
 
-       added_event = fsnotify_add_notify_event(group, fsn_event, inotify_merge);
-       if (added_event) {
+       ret = fsnotify_add_notify_event(group, fsn_event, inotify_merge);
+       if (ret) {
                /* Our event wasn't used in the end. Free it. */
                fsnotify_destroy_event(group, fsn_event);
-               if (IS_ERR(added_event))
-                       ret = PTR_ERR(added_event);
        }
 
        if (inode_mark->mask & IN_ONESHOT)
                fsnotify_destroy_mark(inode_mark, group);
 
-       return ret;
+       return 0;
 }
 
 static void inotify_freeing_mark(struct fsnotify_mark *fsn_mark, struct fsnotify_group *group)
index 952237b8e2d27bbea9466bf41db33ba854b937c6..18b3c4427dcac0f2c9125581cc171be3f1eb3a9f 100644 (file)
@@ -79,15 +79,15 @@ void fsnotify_destroy_event(struct fsnotify_group *group,
 
 /*
  * Add an event to the group notification queue.  The group can later pull this
- * event off the queue to deal with.  If the event is successfully added to the
- * group's notification queue, a reference is taken on event.
+ * event off the queue to deal with.  The function returns 0 if the event was
+ * added to the queue, 1 if the event was merged with some other queued event.
  */
-struct fsnotify_event *fsnotify_add_notify_event(struct fsnotify_group *group,
-                                                struct fsnotify_event *event,
-                                                struct fsnotify_event *(*merge)(struct list_head *,
-                                                                                struct fsnotify_event *))
+int fsnotify_add_notify_event(struct fsnotify_group *group,
+                             struct fsnotify_event *event,
+                             int (*merge)(struct list_head *,
+                                          struct fsnotify_event *))
 {
-       struct fsnotify_event *return_event = NULL;
+       int ret = 0;
        struct list_head *list = &group->notification_list;
 
        pr_debug("%s: group=%p event=%p\n", __func__, group, event);
@@ -98,14 +98,14 @@ struct fsnotify_event *fsnotify_add_notify_event(struct fsnotify_group *group,
                /* Queue overflow event only if it isn't already queued */
                if (list_empty(&group->overflow_event.list))
                        event = &group->overflow_event;
-               return_event = event;
+               ret = 1;
        }
 
        if (!list_empty(list) && merge) {
-               return_event = merge(list, event);
-               if (return_event) {
+               ret = merge(list, event);
+               if (ret) {
                        mutex_unlock(&group->notification_mutex);
-                       return return_event;
+                       return ret;
                }
        }
 
@@ -115,7 +115,7 @@ struct fsnotify_event *fsnotify_add_notify_event(struct fsnotify_group *group,
 
        wake_up(&group->notification_waitq);
        kill_fasync(&group->fsn_fa, SIGIO, POLL_IN);
-       return return_event;
+       return ret;
 }
 
 /*
index 1193ffd0356547b63cdf0a503a2eb68ae84d8ba6..edc5746a902a090ce4dbda6b8b1205e729dff5b3 100644 (file)
@@ -964,9 +964,9 @@ out:
        return ret;
 }
 
-COMPAT_SYSCALL_DEFINE3(readv, unsigned long, fd,
+COMPAT_SYSCALL_DEFINE3(readv, compat_ulong_t, fd,
                const struct compat_iovec __user *,vec,
-               unsigned long, vlen)
+               compat_ulong_t, vlen)
 {
        struct fd f = fdget(fd);
        ssize_t ret;
@@ -1001,9 +1001,9 @@ COMPAT_SYSCALL_DEFINE4(preadv64, unsigned long, fd,
        return ret;
 }
 
-COMPAT_SYSCALL_DEFINE5(preadv, unsigned long, fd,
+COMPAT_SYSCALL_DEFINE5(preadv, compat_ulong_t, fd,
                const struct compat_iovec __user *,vec,
-               unsigned long, vlen, u32, pos_low, u32, pos_high)
+               compat_ulong_t, vlen, u32, pos_low, u32, pos_high)
 {
        loff_t pos = ((loff_t)pos_high << 32) | pos_low;
        return compat_sys_preadv64(fd, vec, vlen, pos);
@@ -1031,9 +1031,9 @@ out:
        return ret;
 }
 
-COMPAT_SYSCALL_DEFINE3(writev, unsigned long, fd,
+COMPAT_SYSCALL_DEFINE3(writev, compat_ulong_t, fd,
                const struct compat_iovec __user *, vec,
-               unsigned long, vlen)
+               compat_ulong_t, vlen)
 {
        struct fd f = fdget(fd);
        ssize_t ret;
@@ -1068,9 +1068,9 @@ COMPAT_SYSCALL_DEFINE4(pwritev64, unsigned long, fd,
        return ret;
 }
 
-COMPAT_SYSCALL_DEFINE5(pwritev, unsigned long, fd,
+COMPAT_SYSCALL_DEFINE5(pwritev, compat_ulong_t, fd,
                const struct compat_iovec __user *,vec,
-               unsigned long, vlen, u32, pos_low, u32, pos_high)
+               compat_ulong_t, vlen, u32, pos_low, u32, pos_high)
 {
        loff_t pos = ((loff_t)pos_high << 32) | pos_low;
        return compat_sys_pwritev64(fd, vec, vlen, pos);
index eb8a49d75ab3155bb6910eab585e5dfed9f64dee..19f6003291def61a40a2305a453838d13c92892f 100644 (file)
@@ -327,16 +327,16 @@ asmlinkage long compat_sys_keyctl(u32 option,
                              u32 arg2, u32 arg3, u32 arg4, u32 arg5);
 asmlinkage long compat_sys_ustat(unsigned dev, struct compat_ustat __user *u32);
 
-asmlinkage ssize_t compat_sys_readv(unsigned long fd,
-               const struct compat_iovec __user *vec, unsigned long vlen);
-asmlinkage ssize_t compat_sys_writev(unsigned long fd,
-               const struct compat_iovec __user *vec, unsigned long vlen);
-asmlinkage ssize_t compat_sys_preadv(unsigned long fd,
+asmlinkage ssize_t compat_sys_readv(compat_ulong_t fd,
+               const struct compat_iovec __user *vec, compat_ulong_t vlen);
+asmlinkage ssize_t compat_sys_writev(compat_ulong_t fd,
+               const struct compat_iovec __user *vec, compat_ulong_t vlen);
+asmlinkage ssize_t compat_sys_preadv(compat_ulong_t fd,
                const struct compat_iovec __user *vec,
-               unsigned long vlen, u32 pos_low, u32 pos_high);
-asmlinkage ssize_t compat_sys_pwritev(unsigned long fd,
+               compat_ulong_t vlen, u32 pos_low, u32 pos_high);
+asmlinkage ssize_t compat_sys_pwritev(compat_ulong_t fd,
                const struct compat_iovec __user *vec,
-               unsigned long vlen, u32 pos_low, u32 pos_high);
+               compat_ulong_t vlen, u32 pos_low, u32 pos_high);
 asmlinkage long comat_sys_lseek(unsigned int, compat_off_t, unsigned int);
 
 asmlinkage long compat_sys_execve(const char __user *filename, const compat_uptr_t __user *argv,
@@ -422,7 +422,7 @@ extern long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
 asmlinkage long compat_sys_ptrace(compat_long_t request, compat_long_t pid,
                                  compat_long_t addr, compat_long_t data);
 
-asmlinkage long compat_sys_lookup_dcookie(u32, u32, char __user *, size_t);
+asmlinkage long compat_sys_lookup_dcookie(u32, u32, char __user *, compat_size_t);
 /*
  * epoll (fs/eventpoll.c) compat bits follow ...
  */
index 7d8d5e608594c911c2eacc78dbb094c5384fd4af..3d286ff49ab0c82309ec3499bf27cc77f75f3670 100644 (file)
@@ -322,10 +322,10 @@ extern int fsnotify_fasync(int fd, struct file *file, int on);
 extern void fsnotify_destroy_event(struct fsnotify_group *group,
                                   struct fsnotify_event *event);
 /* attach the event to the group notification queue */
-extern struct fsnotify_event *fsnotify_add_notify_event(struct fsnotify_group *group,
-                                                       struct fsnotify_event *event,
-                                                       struct fsnotify_event *(*merge)(struct list_head *,
-                                                                                       struct fsnotify_event *));
+extern int fsnotify_add_notify_event(struct fsnotify_group *group,
+                                    struct fsnotify_event *event,
+                                    int (*merge)(struct list_head *,
+                                                 struct fsnotify_event *));
 /* true if the group notification queue is empty */
 extern bool fsnotify_notify_queue_is_empty(struct fsnotify_group *group);
 /* return, but do not dequeue the first event on the notification queue */
index e4b948080d20e7a537c7a83da17b8b5b7fec0008..a67b384157689ec9fda2abfec0173122fc98a4a8 100644 (file)
@@ -142,8 +142,6 @@ static inline unsigned long zone_page_state_snapshot(struct zone *zone,
        return x;
 }
 
-extern unsigned long global_reclaimable_pages(void);
-
 #ifdef CONFIG_NUMA
 /*
  * Determine the per node value of a stat item. This function
index c38083871f11dbaf3f7252674b937fe5e161380a..2defd1308b045c46389a6232391999914573deb6 100644 (file)
@@ -463,7 +463,7 @@ static int active_pfn_set_overlap(unsigned long pfn, int overlap)
        int i;
 
        if (overlap > ACTIVE_PFN_MAX_OVERLAP || overlap < 0)
-               return 0;
+               return overlap;
 
        for (i = RADIX_TREE_MAX_TAGS - 1; i >= 0; i--)
                if (overlap & 1 << i)
@@ -486,7 +486,7 @@ static void active_pfn_inc_overlap(unsigned long pfn)
         * debug_dma_assert_idle() as the pfn may be marked idle
         * prematurely.
         */
-       WARN_ONCE(overlap == 0,
+       WARN_ONCE(overlap > ACTIVE_PFN_MAX_OVERLAP,
                  "DMA-API: exceeded %d overlapping mappings of pfn %lx\n",
                  ACTIVE_PFN_MAX_OVERLAP, pfn);
 }
@@ -517,7 +517,11 @@ static void active_pfn_remove(struct dma_debug_entry *entry)
        unsigned long flags;
 
        spin_lock_irqsave(&radix_lock, flags);
-       if (active_pfn_dec_overlap(entry->pfn) == 0)
+       /* since we are counting overlaps the final put of the
+        * entry->pfn will occur when the overlap count is 0.
+        * active_pfn_dec_overlap() returns -1 in that case
+        */
+       if (active_pfn_dec_overlap(entry->pfn) < 0)
                radix_tree_delete(&dma_active_pfn, entry->pfn);
        spin_unlock_irqrestore(&radix_lock, flags);
 }
index dda31168844f42c9c6fe2f9c9d25526e30884529..bdb9a456bcbb50471310b9f636df72c6bc377ddd 100644 (file)
@@ -316,7 +316,7 @@ EXPORT_SYMBOL(gen_pool_alloc);
  * gen_pool_dma_alloc - allocate special memory from the pool for DMA usage
  * @pool: pool to allocate from
  * @size: number of bytes to allocate from the pool
- * @dma: dma-view physical address
+ * @dma: dma-view physical address return value.  Use NULL if unneeded.
  *
  * Allocate the requested number of bytes from the specified pool.
  * Uses the pool allocation function (with first-fit algorithm by default).
@@ -334,7 +334,8 @@ void *gen_pool_dma_alloc(struct gen_pool *pool, size_t size, dma_addr_t *dma)
        if (!vaddr)
                return NULL;
 
-       *dma = gen_pool_virt_to_phys(pool, vaddr);
+       if (dma)
+               *dma = gen_pool_virt_to_phys(pool, vaddr);
 
        return (void *)vaddr;
 }
index 612c14f5e0f570159fcf775991e88615fca26606..29e1e761f9ebe3fee42eea1b0e77589122a23d24 100644 (file)
@@ -83,7 +83,6 @@ extern unsigned long highest_memmap_pfn;
  */
 extern int isolate_lru_page(struct page *page);
 extern void putback_lru_page(struct page *page);
-extern unsigned long zone_reclaimable_pages(struct zone *zone);
 extern bool zone_reclaimable(struct zone *zone);
 
 /*
index 87d21a6ff63c5730a2708414b6054a139b77cdf1..39a31e7f004505991e37219bdb1e17f571efb933 100644 (file)
@@ -1077,6 +1077,9 @@ static void * __init memblock_virt_alloc_internal(
        if (!align)
                align = SMP_CACHE_BYTES;
 
+       if (max_addr > memblock.current_limit)
+               max_addr = memblock.current_limit;
+
 again:
        alloc = memblock_find_in_range_node(size, align, min_addr, max_addr,
                                            nid);
index 36cb46cddf61aacc1b47f3d925ad58cc7a9926bb..873de7e542bc91993e6922a6b5ada5d4759a6da6 100644 (file)
@@ -2654,7 +2654,7 @@ void mpol_free_shared_policy(struct shared_policy *p)
 }
 
 #ifdef CONFIG_NUMA_BALANCING
-static bool __initdata numabalancing_override;
+static int __initdata numabalancing_override;
 
 static void __init check_numabalancing_enable(void)
 {
@@ -2663,9 +2663,15 @@ static void __init check_numabalancing_enable(void)
        if (IS_ENABLED(CONFIG_NUMA_BALANCING_DEFAULT_ENABLED))
                numabalancing_default = true;
 
+       /* Parsed by setup_numabalancing. override == 1 enables, -1 disables */
+       if (numabalancing_override)
+               set_numabalancing_state(numabalancing_override == 1);
+
        if (nr_node_ids > 1 && !numabalancing_override) {
-               printk(KERN_INFO "Enabling automatic NUMA balancing. "
-                       "Configure with numa_balancing= or the kernel.numa_balancing sysctl");
+               pr_info("%s automatic NUMA balancing. "
+                       "Configure with numa_balancing= or the "
+                       "kernel.numa_balancing sysctl",
+                       numabalancing_default ? "Enabling" : "Disabling");
                set_numabalancing_state(numabalancing_default);
        }
 }
@@ -2675,18 +2681,17 @@ static int __init setup_numabalancing(char *str)
        int ret = 0;
        if (!str)
                goto out;
-       numabalancing_override = true;
 
        if (!strcmp(str, "enable")) {
-               set_numabalancing_state(true);
+               numabalancing_override = 1;
                ret = 1;
        } else if (!strcmp(str, "disable")) {
-               set_numabalancing_state(false);
+               numabalancing_override = -1;
                ret = 1;
        }
 out:
        if (!ret)
-               printk(KERN_WARNING "Unable to parse numa_balancing=\n");
+               pr_warn("Unable to parse numa_balancing=\n");
 
        return ret;
 }
index 63807583d8e89f1c96f8b05bcf5fe422ed200c26..2d30e2cfe8047606064f117fbaca4675540e00dd 100644 (file)
@@ -191,6 +191,26 @@ static unsigned long writeout_period_time = 0;
  * global dirtyable memory first.
  */
 
+/**
+ * zone_dirtyable_memory - number of dirtyable pages in a zone
+ * @zone: the zone
+ *
+ * Returns the zone's number of pages potentially available for dirty
+ * page cache.  This is the base value for the per-zone dirty limits.
+ */
+static unsigned long zone_dirtyable_memory(struct zone *zone)
+{
+       unsigned long nr_pages;
+
+       nr_pages = zone_page_state(zone, NR_FREE_PAGES);
+       nr_pages -= min(nr_pages, zone->dirty_balance_reserve);
+
+       nr_pages += zone_page_state(zone, NR_INACTIVE_FILE);
+       nr_pages += zone_page_state(zone, NR_ACTIVE_FILE);
+
+       return nr_pages;
+}
+
 static unsigned long highmem_dirtyable_memory(unsigned long total)
 {
 #ifdef CONFIG_HIGHMEM
@@ -198,11 +218,9 @@ static unsigned long highmem_dirtyable_memory(unsigned long total)
        unsigned long x = 0;
 
        for_each_node_state(node, N_HIGH_MEMORY) {
-               struct zone *z =
-                       &NODE_DATA(node)->node_zones[ZONE_HIGHMEM];
+               struct zone *z = &NODE_DATA(node)->node_zones[ZONE_HIGHMEM];
 
-               x += zone_page_state(z, NR_FREE_PAGES) +
-                    zone_reclaimable_pages(z) - z->dirty_balance_reserve;
+               x += zone_dirtyable_memory(z);
        }
        /*
         * Unreclaimable memory (kernel memory or anonymous memory
@@ -238,9 +256,12 @@ static unsigned long global_dirtyable_memory(void)
 {
        unsigned long x;
 
-       x = global_page_state(NR_FREE_PAGES) + global_reclaimable_pages();
+       x = global_page_state(NR_FREE_PAGES);
        x -= min(x, dirty_balance_reserve);
 
+       x += global_page_state(NR_INACTIVE_FILE);
+       x += global_page_state(NR_ACTIVE_FILE);
+
        if (!vm_highmem_is_dirtyable)
                x -= highmem_dirtyable_memory(x);
 
@@ -288,32 +309,6 @@ void global_dirty_limits(unsigned long *pbackground, unsigned long *pdirty)
        trace_global_dirty_state(background, dirty);
 }
 
-/**
- * zone_dirtyable_memory - number of dirtyable pages in a zone
- * @zone: the zone
- *
- * Returns the zone's number of pages potentially available for dirty
- * page cache.  This is the base value for the per-zone dirty limits.
- */
-static unsigned long zone_dirtyable_memory(struct zone *zone)
-{
-       /*
-        * The effective global number of dirtyable pages may exclude
-        * highmem as a big-picture measure to keep the ratio between
-        * dirty memory and lowmem reasonable.
-        *
-        * But this function is purely about the individual zone and a
-        * highmem zone can hold its share of dirty pages, so we don't
-        * care about vm_highmem_is_dirtyable here.
-        */
-       unsigned long nr_pages = zone_page_state(zone, NR_FREE_PAGES) +
-               zone_reclaimable_pages(zone);
-
-       /* don't allow this to underflow */
-       nr_pages -= min(nr_pages, zone->dirty_balance_reserve);
-       return nr_pages;
-}
-
 /**
  * zone_dirty_limit - maximum number of dirty pages allowed in a zone
  * @zone: the zone
index 7cdbb44aa90bd99bef05f43ee27cc13b2121ed7a..0de2360d65f3f4f4cce4e0ae94f02d78a51a2429 100644 (file)
@@ -211,8 +211,6 @@ out:
 int force_page_cache_readahead(struct address_space *mapping, struct file *filp,
                pgoff_t offset, unsigned long nr_to_read)
 {
-       int ret = 0;
-
        if (unlikely(!mapping->a_ops->readpage && !mapping->a_ops->readpages))
                return -EINVAL;
 
@@ -226,15 +224,13 @@ int force_page_cache_readahead(struct address_space *mapping, struct file *filp,
                        this_chunk = nr_to_read;
                err = __do_page_cache_readahead(mapping, filp,
                                                offset, this_chunk, 0);
-               if (err < 0) {
-                       ret = err;
-                       break;
-               }
-               ret += err;
+               if (err < 0)
+                       return err;
+
                offset += this_chunk;
                nr_to_read -= this_chunk;
        }
-       return ret;
+       return 0;
 }
 
 /*
@@ -576,8 +572,7 @@ do_readahead(struct address_space *mapping, struct file *filp,
        if (!mapping || !mapping->a_ops)
                return -EINVAL;
 
-       force_page_cache_readahead(mapping, filp, index, nr);
-       return 0;
+       return force_page_cache_readahead(mapping, filp, index, nr);
 }
 
 SYSCALL_DEFINE3(readahead, int, fd, loff_t, offset, size_t, count)
index 8e40321da091b66f24f983b266acb344ce41d56c..1ec3c619ba04b955f0d64f32ae3d432d113488f6 100644 (file)
@@ -233,14 +233,17 @@ out_unlock:
        mutex_unlock(&slab_mutex);
        put_online_cpus();
 
-       /*
-        * There is no point in flooding logs with warnings or especially
-        * crashing the system if we fail to create a cache for a memcg. In
-        * this case we will be accounting the memcg allocation to the root
-        * cgroup until we succeed to create its own cache, but it isn't that
-        * critical.
-        */
-       if (err && !memcg) {
+       if (err) {
+               /*
+                * There is no point in flooding logs with warnings or
+                * especially crashing the system if we fail to create a cache
+                * for a memcg. In this case we will be accounting the memcg
+                * allocation to the root cgroup until we succeed to create its
+                * own cache, but it isn't that critical.
+                */
+               if (!memcg)
+                       return NULL;
+
                if (flags & SLAB_PANIC)
                        panic("kmem_cache_create: Failed to create slab '%s'. Error %d\n",
                                name, err);
index 34bb8c65a2d8d7e9973fa501fafbe10cf571b8f3..545a170ebf9f66cf0e3716c9cd6f4cb7eef0eda6 100644 (file)
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1559,7 +1559,7 @@ static inline void *acquire_slab(struct kmem_cache *s,
                new.freelist = freelist;
        }
 
-       VM_BUG_ON_PAGE(new.frozen, &new);
+       VM_BUG_ON(new.frozen);
        new.frozen = 1;
 
        if (!__cmpxchg_double_slab(s, page,
@@ -1812,7 +1812,7 @@ static void deactivate_slab(struct kmem_cache *s, struct page *page,
                        set_freepointer(s, freelist, prior);
                        new.counters = counters;
                        new.inuse--;
-                       VM_BUG_ON_PAGE(!new.frozen, &new);
+                       VM_BUG_ON(!new.frozen);
 
                } while (!__cmpxchg_double_slab(s, page,
                        prior, counters,
@@ -1840,7 +1840,7 @@ redo:
 
        old.freelist = page->freelist;
        old.counters = page->counters;
-       VM_BUG_ON_PAGE(!old.frozen, &old);
+       VM_BUG_ON(!old.frozen);
 
        /* Determine target state of the slab */
        new.counters = old.counters;
@@ -1952,7 +1952,7 @@ static void unfreeze_partials(struct kmem_cache *s,
 
                        old.freelist = page->freelist;
                        old.counters = page->counters;
-                       VM_BUG_ON_PAGE(!old.frozen, &old);
+                       VM_BUG_ON(!old.frozen);
 
                        new.counters = old.counters;
                        new.freelist = old.freelist;
@@ -2225,7 +2225,7 @@ static inline void *get_freelist(struct kmem_cache *s, struct page *page)
                counters = page->counters;
 
                new.counters = counters;
-               VM_BUG_ON_PAGE(!new.frozen, &new);
+               VM_BUG_ON(!new.frozen);
 
                new.inuse = page->objects;
                new.frozen = freelist != NULL;
@@ -2319,7 +2319,7 @@ load_freelist:
         * page is pointing to the page from which the objects are obtained.
         * That page must be frozen for per cpu allocations to work.
         */
-       VM_BUG_ON_PAGE(!c->page->frozen, c->page);
+       VM_BUG_ON(!c->page->frozen);
        c->freelist = get_freepointer(s, freelist);
        c->tid = next_tid(c->tid);
        local_irq_restore(flags);
index 90c4075d8d75af6358ba6c789bc0747f53460a4d..a9c74b409681a460f2c2ef5f45b3f2283a81a4b8 100644 (file)
@@ -147,7 +147,7 @@ static bool global_reclaim(struct scan_control *sc)
 }
 #endif
 
-unsigned long zone_reclaimable_pages(struct zone *zone)
+static unsigned long zone_reclaimable_pages(struct zone *zone)
 {
        int nr;
 
@@ -3315,27 +3315,6 @@ void wakeup_kswapd(struct zone *zone, int order, enum zone_type classzone_idx)
        wake_up_interruptible(&pgdat->kswapd_wait);
 }
 
-/*
- * The reclaimable count would be mostly accurate.
- * The less reclaimable pages may be
- * - mlocked pages, which will be moved to unevictable list when encountered
- * - mapped pages, which may require several travels to be reclaimed
- * - dirty pages, which is not "instantly" reclaimable
- */
-unsigned long global_reclaimable_pages(void)
-{
-       int nr;
-
-       nr = global_page_state(NR_ACTIVE_FILE) +
-            global_page_state(NR_INACTIVE_FILE);
-
-       if (get_nr_swap_pages() > 0)
-               nr += global_page_state(NR_ACTIVE_ANON) +
-                     global_page_state(NR_INACTIVE_ANON);
-
-       return nr;
-}
-
 #ifdef CONFIG_HIBERNATION
 /*
  * Try to free `nr_to_reclaim' of memory, system-wide, and return the number of