]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 26 Mar 2009 18:03:39 +0000 (11:03 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 26 Mar 2009 18:03:39 +0000 (11:03 -0700)
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6: (71 commits)
  SELinux: inode_doinit_with_dentry drop no dentry printk
  SELinux: new permission between tty audit and audit socket
  SELinux: open perm for sock files
  smack: fixes for unlabeled host support
  keys: make procfiles per-user-namespace
  keys: skip keys from another user namespace
  keys: consider user namespace in key_permission
  keys: distinguish per-uid keys in different namespaces
  integrity: ima iint radix_tree_lookup locking fix
  TOMOYO: Do not call tomoyo_realpath_init unless registered.
  integrity: ima scatterlist bug fix
  smack: fix lots of kernel-doc notation
  TOMOYO: Don't create securityfs entries unless registered.
  TOMOYO: Fix exception policy read failure.
  SELinux: convert the avc cache hash list to an hlist
  SELinux: code readability with avc_cache
  SELinux: remove unused av.decided field
  SELinux: more careful use of avd in avc_has_perm_noaudit
  SELinux: remove the unused ae.used
  SELinux: check seqno when updating an avc_node
  ...

arch/mips/include/asm/mipsregs.h
arch/mips/kernel/linux32.c
arch/mips/kernel/traps.c
arch/mips/mm/c-r4k.c
arch/mips/mm/dma-default.c
fs/inode.c
fs/namespace.c
include/linux/fs.h
include/linux/mount.h
mm/page-writeback.c

index 0417516503f634484bea51436d9befa8059b4a83..526f327475cea59bf93f0db86505fdd2ef4f86c3 100644 (file)
@@ -1391,11 +1391,11 @@ static inline void tlb_write_random(void)
 static inline unsigned int                                     \
 set_c0_##name(unsigned int set)                                        \
 {                                                              \
-       unsigned int res;                                       \
+       unsigned int res, new;                                  \
                                                                \
        res = read_c0_##name();                                 \
-       res |= set;                                             \
-       write_c0_##name(res);                                   \
+       new = res | set;                                        \
+       write_c0_##name(new);                                   \
                                                                \
        return res;                                             \
 }                                                              \
@@ -1403,24 +1403,24 @@ set_c0_##name(unsigned int set)                                 \
 static inline unsigned int                                     \
 clear_c0_##name(unsigned int clear)                            \
 {                                                              \
-       unsigned int res;                                       \
+       unsigned int res, new;                                  \
                                                                \
        res = read_c0_##name();                                 \
-       res &= ~clear;                                          \
-       write_c0_##name(res);                                   \
+       new = res & ~clear;                                     \
+       write_c0_##name(new);                                   \
                                                                \
        return res;                                             \
 }                                                              \
                                                                \
 static inline unsigned int                                     \
-change_c0_##name(unsigned int change, unsigned int new)                \
+change_c0_##name(unsigned int change, unsigned int val)                \
 {                                                              \
-       unsigned int res;                                       \
+       unsigned int res, new;                                  \
                                                                \
        res = read_c0_##name();                                 \
-       res &= ~change;                                         \
-       res |= (new & change);                                  \
-       write_c0_##name(res);                                   \
+       new = res & ~change;                                    \
+       new |= (val & change);                                  \
+       write_c0_##name(new);                                   \
                                                                \
        return res;                                             \
 }
index 1a86f84fa9470f31030c53fdc9ad45c792d08425..49aac6e17df932a89658840302c7332a8c27f012 100644 (file)
@@ -32,7 +32,6 @@
 #include <linux/module.h>
 #include <linux/binfmts.h>
 #include <linux/security.h>
-#include <linux/syscalls.h>
 #include <linux/compat.h>
 #include <linux/vfs.h>
 #include <linux/ipc.h>
index b2d7041341b8f5afa3e313302c21b90e34e5ea3d..29fadaccecddef31d5da3ea33f819b1ad3941fe0 100644 (file)
@@ -1520,7 +1520,9 @@ void __cpuinit per_cpu_trap_init(void)
 #endif /* CONFIG_MIPS_MT_SMTC */
 
        if (cpu_has_veic || cpu_has_vint) {
+               unsigned long sr = set_c0_status(ST0_BEV);
                write_c0_ebase(ebase);
+               write_c0_status(sr);
                /* Setting vector spacing enables EI/VI mode  */
                change_c0_intctl(0x3e0, VECTORSPACING);
        }
@@ -1602,8 +1604,6 @@ void __cpuinit set_uncached_handler(unsigned long offset, void *addr,
 #ifdef CONFIG_64BIT
        unsigned long uncached_ebase = TO_UNCAC(ebase);
 #endif
-       if (cpu_has_mips_r2)
-               uncached_ebase += (read_c0_ebase() & 0x3ffff000);
 
        if (!addr)
                panic(panic_null_cerr);
@@ -1635,9 +1635,11 @@ void __init trap_init(void)
                return; /* Already done */
 #endif
 
-       if (cpu_has_veic || cpu_has_vint)
-               ebase = (unsigned long) alloc_bootmem_low_pages(0x200 + VECTORSPACING*64);
-       else {
+       if (cpu_has_veic || cpu_has_vint) {
+               unsigned long size = 0x200 + VECTORSPACING*64;
+               ebase = (unsigned long)
+                       __alloc_bootmem(size, 1 << fls(size), 0);
+       } else {
                ebase = CAC_BASE;
                if (cpu_has_mips_r2)
                        ebase += (read_c0_ebase() & 0x3ffff000);
index c43f4b26a69010b63154a734618060c0981b692e..871e828bc62ac2e7db45405f4347b598374301a5 100644 (file)
@@ -780,7 +780,7 @@ static void __cpuinit probe_pcache(void)
                c->dcache.ways = 2;
                c->dcache.waybit = 0;
 
-               c->options |= MIPS_CPU_CACHE_CDEX_P;
+               c->options |= MIPS_CPU_CACHE_CDEX_P | MIPS_CPU_PREFETCH;
                break;
 
        case CPU_TX49XX:
index 546e6977d4ffb0bd1910a57114803bdb1bffe858..bed56f1ac83709887aa1c4b60922d9fa6602d354 100644 (file)
@@ -225,7 +225,7 @@ void dma_unmap_page(struct device *dev, dma_addr_t dma_address, size_t size,
        if (!plat_device_is_coherent(dev) && direction != DMA_TO_DEVICE) {
                unsigned long addr;
 
-               addr = plat_dma_addr_to_phys(dma_address);
+               addr = dma_addr_to_virt(dma_address);
                dma_cache_wback_inv(addr, size);
        }
 
index 8a47ccd9fc381f89c78282ccce531abb0e0f026b..643ac43e5a5c7d6f43fe938fd4c0df6c91e2e0ce 100644 (file)
@@ -1300,6 +1300,40 @@ sector_t bmap(struct inode * inode, sector_t block)
 }
 EXPORT_SYMBOL(bmap);
 
+/*
+ * With relative atime, only update atime if the previous atime is
+ * earlier than either the ctime or mtime or if at least a day has
+ * passed since the last atime update.
+ */
+static int relatime_need_update(struct vfsmount *mnt, struct inode *inode,
+                            struct timespec now)
+{
+
+       if (!(mnt->mnt_flags & MNT_RELATIME))
+               return 1;
+       /*
+        * Is mtime younger than atime? If yes, update atime:
+        */
+       if (timespec_compare(&inode->i_mtime, &inode->i_atime) >= 0)
+               return 1;
+       /*
+        * Is ctime younger than atime? If yes, update atime:
+        */
+       if (timespec_compare(&inode->i_ctime, &inode->i_atime) >= 0)
+               return 1;
+
+       /*
+        * Is the previous atime value older than a day? If yes,
+        * update atime:
+        */
+       if ((long)(now.tv_sec - inode->i_atime.tv_sec) >= 24*60*60)
+               return 1;
+       /*
+        * Good, we can skip the atime update:
+        */
+       return 0;
+}
+
 /**
  *     touch_atime     -       update the access time
  *     @mnt: mount the inode is accessed on
@@ -1327,17 +1361,12 @@ void touch_atime(struct vfsmount *mnt, struct dentry *dentry)
                goto out;
        if ((mnt->mnt_flags & MNT_NODIRATIME) && S_ISDIR(inode->i_mode))
                goto out;
-       if (mnt->mnt_flags & MNT_RELATIME) {
-               /*
-                * With relative atime, only update atime if the previous
-                * atime is earlier than either the ctime or mtime.
-                */
-               if (timespec_compare(&inode->i_mtime, &inode->i_atime) < 0 &&
-                   timespec_compare(&inode->i_ctime, &inode->i_atime) < 0)
-                       goto out;
-       }
 
        now = current_fs_time(inode->i_sb);
+
+       if (!relatime_need_update(mnt, inode, now))
+               goto out;
+
        if (timespec_equal(&inode->i_atime, &now))
                goto out;
 
index 06f8e63f6cb1dc929e0ad9c0627320066db57cb1..f0e753097353b93f581d1ea6e1646df99dcf630a 100644 (file)
@@ -780,6 +780,7 @@ static void show_mnt_opts(struct seq_file *m, struct vfsmount *mnt)
                { MNT_NOATIME, ",noatime" },
                { MNT_NODIRATIME, ",nodiratime" },
                { MNT_RELATIME, ",relatime" },
+               { MNT_STRICTATIME, ",strictatime" },
                { 0, NULL }
        };
        const struct proc_fs_info *fs_infop;
@@ -1919,6 +1920,9 @@ long do_mount(char *dev_name, char *dir_name, char *type_page,
        if (data_page)
                ((char *)data_page)[PAGE_SIZE - 1] = 0;
 
+       /* Default to relatime */
+       mnt_flags |= MNT_RELATIME;
+
        /* Separate the per-mountpoint flags */
        if (flags & MS_NOSUID)
                mnt_flags |= MNT_NOSUID;
@@ -1930,13 +1934,14 @@ long do_mount(char *dev_name, char *dir_name, char *type_page,
                mnt_flags |= MNT_NOATIME;
        if (flags & MS_NODIRATIME)
                mnt_flags |= MNT_NODIRATIME;
-       if (flags & MS_RELATIME)
-               mnt_flags |= MNT_RELATIME;
+       if (flags & MS_STRICTATIME)
+               mnt_flags &= ~(MNT_RELATIME | MNT_NOATIME);
        if (flags & MS_RDONLY)
                mnt_flags |= MNT_READONLY;
 
        flags &= ~(MS_NOSUID | MS_NOEXEC | MS_NODEV | MS_ACTIVE |
-                  MS_NOATIME | MS_NODIRATIME | MS_RELATIME| MS_KERNMOUNT);
+                  MS_NOATIME | MS_NODIRATIME | MS_RELATIME| MS_KERNMOUNT |
+                  MS_STRICTATIME);
 
        /* ... and get the mountpoint */
        retval = kern_path(dir_name, LOOKUP_FOLLOW, &path);
index 92734c0012e679cb3326ba25be08f52dce81fbc8..5bc81c4a98c1913cb0e15adf8d70e9c083956bb8 100644 (file)
@@ -141,6 +141,7 @@ struct inodes_stat_t {
 #define MS_RELATIME    (1<<21) /* Update atime relative to mtime/ctime. */
 #define MS_KERNMOUNT   (1<<22) /* this is a kern_mount call */
 #define MS_I_VERSION   (1<<23) /* Update inode I_version field */
+#define MS_STRICTATIME (1<<24) /* Always perform atime updates */
 #define MS_ACTIVE      (1<<30)
 #define MS_NOUSER      (1<<31)
 
index cab2a85e2ee82f556cf1515eb14bd6d88ad344b0..51f55f903aff5140b9cda4ca104df8d3e2cb4426 100644 (file)
@@ -27,6 +27,7 @@ struct mnt_namespace;
 #define MNT_NODIRATIME 0x10
 #define MNT_RELATIME   0x20
 #define MNT_READONLY   0x40    /* does the user want this to be r/o? */
+#define MNT_STRICTATIME 0x80
 
 #define MNT_SHRINKABLE 0x100
 #define MNT_IMBALANCED_WRITE_COUNT     0x200 /* just for debugging */
index 74dc57c74349ff124dd31a3e04531ee503ecedca..40ca7cdb653ec280d8115ff3d8b35cb6ee57669e 100644 (file)
@@ -66,7 +66,7 @@ static inline long sync_writeback_pages(void)
 /*
  * Start background writeback (via pdflush) at this percentage
  */
-int dirty_background_ratio = 5;
+int dirty_background_ratio = 10;
 
 /*
  * dirty_background_bytes starts at 0 (disabled) so that it is a function of
@@ -83,7 +83,7 @@ int vm_highmem_is_dirtyable;
 /*
  * The generator of dirty data starts writeback at this percentage
  */
-int vm_dirty_ratio = 10;
+int vm_dirty_ratio = 20;
 
 /*
  * vm_dirty_bytes starts at 0 (disabled) so that it is a function of