]> Git Repo - linux.git/commitdiff
Merge branch 'for-linus-37rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml
authorLinus Torvalds <[email protected]>
Wed, 10 Oct 2012 02:15:20 +0000 (11:15 +0900)
committerLinus Torvalds <[email protected]>
Wed, 10 Oct 2012 02:15:20 +0000 (11:15 +0900)
Pull UML changes from Richard Weinberger:
 "UML receives this time only cleanups.

  The most outstanding change is the 'include "foo.h"' do 'include
  <foo.h>' conversion done by Al Viro.

  It touches many files, that's why the diffstat is rather big."

* 'for-linus-37rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml:
  typo in UserModeLinux-HOWTO
  hppfs: fix the return value of get_inode()
  hostfs: drop vmtruncate
  um: get rid of pointless include "..." where include <...> will do
  um: move sysrq.h out of include/shared
  um/x86: merge 32 and 64 bit variants of ptrace.h
  um/x86: merge 32 and 64bit variants of checksum.h

1  2 
arch/um/drivers/line.c
arch/um/drivers/mconsole_kern.c
arch/um/kernel/trap.c
fs/hostfs/hostfs_kern.c

diff --combined arch/um/drivers/line.c
index 457475f98414392ece09be3dcfbf0578c31f1215,b8e841c128aa7eb792bfe6ee9f445c2fad1288f6..fd9a15b318afdc5066a8a5a1502cc0c185f947dd
@@@ -3,15 -3,15 +3,15 @@@
   * Licensed under the GPL
   */
  
- #include "linux/irqreturn.h"
- #include "linux/kd.h"
- #include "linux/sched.h"
- #include "linux/slab.h"
+ #include <linux/irqreturn.h>
+ #include <linux/kd.h>
+ #include <linux/sched.h>
+ #include <linux/slab.h>
  #include "chan.h"
- #include "irq_kern.h"
- #include "irq_user.h"
- #include "kern_util.h"
- #include "os.h"
+ #include <irq_kern.h>
+ #include <irq_user.h>
+ #include <kern_util.h>
+ #include <os.h>
  
  #define LINE_BUFSIZE 4096
  
@@@ -409,8 -409,7 +409,8 @@@ int setup_one_line(struct line *lines, 
                line->valid = 1;
                err = parse_chan_pair(new, line, n, opts, error_out);
                if (!err) {
 -                      struct device *d = tty_register_device(driver, n, NULL);
 +                      struct device *d = tty_port_register_device(&line->port,
 +                                      driver, n, NULL);
                        if (IS_ERR(d)) {
                                *error_out = "Failed to register device";
                                err = PTR_ERR(d);
index 9efeb6da48bc6c959fd1c87d92fba1057baa07a1,25e63fdd8028a0501b7fd05a0a08d2526e430263..79ccfe6c70787054c61d1116cb42449d562dfca8
  #include <linux/un.h>
  #include <linux/workqueue.h>
  #include <linux/mutex.h>
 +#include <linux/fs.h>
 +#include <linux/mount.h>
 +#include <linux/file.h>
  #include <asm/uaccess.h>
  #include <asm/switch_to.h>
  
- #include "init.h"
- #include "irq_kern.h"
- #include "irq_user.h"
- #include "kern_util.h"
+ #include <init.h>
+ #include <irq_kern.h>
+ #include <irq_user.h>
+ #include <kern_util.h>
  #include "mconsole.h"
  #include "mconsole_kern.h"
- #include "os.h"
+ #include <os.h>
  
  static int do_unlink_socket(struct notifier_block *notifier,
                            unsigned long what, void *data)
@@@ -121,38 -118,90 +121,38 @@@ void mconsole_log(struct mc_request *re
        mconsole_reply(req, "", 0, 0);
  }
  
 -/* This is a more convoluted version of mconsole_proc, which has some stability
 - * problems; however, we need it fixed, because it is expected that UML users
 - * mount HPPFS instead of procfs on /proc. And we want mconsole_proc to still
 - * show the real procfs content, not the ones from hppfs.*/
 -#if 0
  void mconsole_proc(struct mc_request *req)
  {
        struct vfsmount *mnt = current->nsproxy->pid_ns->proc_mnt;
 -      struct file *file;
 -      int n;
 -      char *ptr = req->request.data, *buf;
 -      mm_segment_t old_fs = get_fs();
 -
 -      ptr += strlen("proc");
 -      ptr = skip_spaces(ptr);
 -
 -      file = file_open_root(mnt->mnt_root, mnt, ptr, O_RDONLY);
 -      if (IS_ERR(file)) {
 -              mconsole_reply(req, "Failed to open file", 1, 0);
 -              goto out;
 -      }
 -
 -      buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
 -      if (buf == NULL) {
 -              mconsole_reply(req, "Failed to allocate buffer", 1, 0);
 -              goto out_fput;
 -      }
 -
 -      if (file->f_op->read) {
 -              do {
 -                      loff_t pos;
 -                      set_fs(KERNEL_DS);
 -                      n = vfs_read(file, buf, PAGE_SIZE - 1, &pos);
 -                      file_pos_write(file, pos);
 -                      set_fs(old_fs);
 -                      if (n >= 0) {
 -                              buf[n] = '\0';
 -                              mconsole_reply(req, buf, 0, (n > 0));
 -                      }
 -                      else {
 -                              mconsole_reply(req, "Read of file failed",
 -                                             1, 0);
 -                              goto out_free;
 -                      }
 -              } while (n > 0);
 -      }
 -      else mconsole_reply(req, "", 0, 0);
 -
 - out_free:
 -      kfree(buf);
 - out_fput:
 -      fput(file);
 - out: ;
 -}
 -#endif
 -
 -void mconsole_proc(struct mc_request *req)
 -{
 -      char path[64];
        char *buf;
        int len;
 -      int fd;
 +      struct file *file;
        int first_chunk = 1;
        char *ptr = req->request.data;
  
        ptr += strlen("proc");
        ptr = skip_spaces(ptr);
 -      snprintf(path, sizeof(path), "/proc/%s", ptr);
  
 -      fd = sys_open(path, 0, 0);
 -      if (fd < 0) {
 +      file = file_open_root(mnt->mnt_root, mnt, ptr, O_RDONLY);
 +      if (IS_ERR(file)) {
                mconsole_reply(req, "Failed to open file", 1, 0);
 -              printk(KERN_ERR "open %s: %d\n",path,fd);
 +              printk(KERN_ERR "open /proc/%s: %ld\n", ptr, PTR_ERR(file));
                goto out;
        }
  
        buf = kmalloc(PAGE_SIZE, GFP_KERNEL);
        if (buf == NULL) {
                mconsole_reply(req, "Failed to allocate buffer", 1, 0);
 -              goto out_close;
 +              goto out_fput;
        }
  
 -      for (;;) {
 -              len = sys_read(fd, buf, PAGE_SIZE-1);
 +      do {
 +              loff_t pos;
 +              mm_segment_t old_fs = get_fs();
 +              set_fs(KERNEL_DS);
 +              len = vfs_read(file, buf, PAGE_SIZE - 1, &pos);
 +              set_fs(old_fs);
 +              file->f_pos = pos;
                if (len < 0) {
                        mconsole_reply(req, "Read of file failed", 1, 0);
                        goto out_free;
                        mconsole_reply(req, "\n", 0, 1);
                        first_chunk = 0;
                }
 -              if (len == PAGE_SIZE-1) {
 -                      buf[len] = '\0';
 -                      mconsole_reply(req, buf, 0, 1);
 -              } else {
 -                      buf[len] = '\0';
 -                      mconsole_reply(req, buf, 0, 0);
 -                      break;
 -              }
 -      }
 -
 +              buf[len] = '\0';
 +              mconsole_reply(req, buf, 0, (len > 0));
 +      } while (len > 0);
   out_free:
        kfree(buf);
 - out_close:
 -      sys_close(fd);
 - out:
 -      /* nothing */;
 + out_fput:
 +      fput(file);
 + out: ;
  }
  
  #define UML_MCONSOLE_HELPTEXT \
@@@ -648,7 -705,6 +648,7 @@@ static void stack_proc(void *arg
        struct task_struct *from = current, *to = arg;
  
        to->thread.saved_task = from;
 +      rcu_switch(from, to);
        switch_to(from, to, from);
  }
  
diff --combined arch/um/kernel/trap.c
index 0f00e9c82080f644030191cb31bc7ae3e0937f49,cf7585fbc9fa6d4b758974cb700dbd857da2341c..089f3987e273a2c3f9576ef923dbd8ba8648cca5
  #include <asm/current.h>
  #include <asm/pgtable.h>
  #include <asm/tlbflush.h>
- #include "arch.h"
- #include "as-layout.h"
- #include "kern_util.h"
- #include "os.h"
- #include "skas.h"
+ #include <arch.h>
+ #include <as-layout.h>
+ #include <kern_util.h>
+ #include <os.h>
+ #include <skas.h>
  
  /*
   * Note this is constrained to return 0, -EFAULT, -EACCESS, -ENOMEM by
@@@ -89,7 -89,6 +89,7 @@@ good_area
                                current->min_flt++;
                        if (fault & VM_FAULT_RETRY) {
                                flags &= ~FAULT_FLAG_ALLOW_RETRY;
 +                              flags |= FAULT_FLAG_TRIED;
  
                                goto retry;
                        }
diff --combined fs/hostfs/hostfs_kern.c
index 6c9f3a9d5e211adcadb8e93c80bbd7b12d4460db,3c423c746b59d9062716e95df56549471c742ea6..457addc5c91f2f2da42092d9f193a47aa8f678dd
@@@ -16,8 -16,8 +16,8 @@@
  #include <linux/mount.h>
  #include <linux/namei.h>
  #include "hostfs.h"
- #include "init.h"
- #include "kern.h"
+ #include <init.h>
+ #include <kern.h>
  
  struct hostfs_inode_info {
        int fd;
@@@ -542,8 -542,8 +542,8 @@@ static int read_name(struct inode *ino
        ino->i_ino = st.ino;
        ino->i_mode = st.mode;
        set_nlink(ino, st.nlink);
 -      ino->i_uid = st.uid;
 -      ino->i_gid = st.gid;
 +      i_uid_write(ino, st.uid);
 +      i_gid_write(ino, st.gid);
        ino->i_atime = st.atime;
        ino->i_mtime = st.mtime;
        ino->i_ctime = st.ctime;
@@@ -808,11 -808,11 +808,11 @@@ int hostfs_setattr(struct dentry *dentr
        }
        if (attr->ia_valid & ATTR_UID) {
                attrs.ia_valid |= HOSTFS_ATTR_UID;
 -              attrs.ia_uid = attr->ia_uid;
 +              attrs.ia_uid = from_kuid(&init_user_ns, attr->ia_uid);
        }
        if (attr->ia_valid & ATTR_GID) {
                attrs.ia_valid |= HOSTFS_ATTR_GID;
 -              attrs.ia_gid = attr->ia_gid;
 +              attrs.ia_gid = from_kgid(&init_user_ns, attr->ia_gid);
        }
        if (attr->ia_valid & ATTR_SIZE) {
                attrs.ia_valid |= HOSTFS_ATTR_SIZE;
            attr->ia_size != i_size_read(inode)) {
                int error;
  
-               error = vmtruncate(inode, attr->ia_size);
-               if (err)
-                       return err;
+               error = inode_newsize_ok(inode, attr->ia_size);
+               if (error)
+                       return error;
+               truncate_setsize(inode, attr->ia_size);
        }
  
        setattr_copy(inode, attr);
This page took 0.074615 seconds and 4 git commands to generate.