]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Merge remote-tracking branch 'vfs/for-next'
authorStephen Rothwell <sfr@canb.auug.org.au>
Wed, 3 Oct 2012 01:36:45 +0000 (11:36 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 3 Oct 2012 01:36:48 +0000 (11:36 +1000)
Conflicts:
drivers/staging/android/binder.c
net/socket.c

62 files changed:
1  2 
arch/alpha/kernel/osf_sys.c
arch/ia64/kernel/perfmon.c
arch/s390/hypfs/inode.c
arch/um/drivers/mconsole_kern.c
drivers/infiniband/core/ucma.c
drivers/staging/android/binder.c
drivers/staging/omapdrm/omap_gem.c
drivers/tty/tty_io.c
drivers/usb/gadget/f_fs.c
drivers/video/msm/mdp.c
fs/9p/v9fs.c
fs/adfs/super.c
fs/affs/super.c
fs/befs/linuxvfs.c
fs/bfs/inode.c
fs/btrfs/extent_io.c
fs/btrfs/inode.c
fs/btrfs/ioctl.c
fs/cifs/cifsfs.c
fs/compat_ioctl.c
fs/dcache.c
fs/ecryptfs/main.c
fs/ext3/super.c
fs/ext4/ioctl.c
fs/ext4/super.c
fs/fat/inode.c
fs/fuse/dev.c
fs/fuse/inode.c
fs/hfs/super.c
fs/hpfs/super.c
fs/hugetlbfs/inode.c
fs/isofs/inode.c
fs/jfs/super.c
fs/locks.c
fs/logfs/inode.c
fs/minix/inode.c
fs/namei.c
fs/ncpfs/inode.c
fs/nfs/inode.c
fs/nfsd/nfs4state.c
fs/ntfs/super.c
fs/ocfs2/cluster/heartbeat.c
fs/open.c
fs/proc/base.c
fs/qnx4/inode.c
fs/qnx6/inode.c
fs/stat.c
fs/sysv/inode.c
fs/ubifs/super.c
fs/udf/super.c
fs/xattr.c
fs/xfs/xfs_super.c
include/linux/net.h
include/linux/sched.h
kernel/events/core.c
kernel/exit.c
kernel/taskstats.c
net/9p/trans_fd.c
net/core/netprio_cgroup.c
net/core/scm.c
net/sctp/socket.c
net/socket.c

Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
index b1937ca13575ac097c1b64041d44379737adc7f6,f71d624995eaa78bde3e86a9e0a185533810dcd8..7b0ba92e7e46730d1d5c72137c9f1b2b9ddc3201
@@@ -362,14 -362,9 +362,9 @@@ struct binder_transaction 
  static void
  binder_defer_work(struct binder_proc *proc, enum binder_deferred_state defer);
  
- /*
-  * copied from get_unused_fd_flags
-  */
 -int task_get_unused_fd_flags(struct binder_proc *proc, int flags)
 +static int task_get_unused_fd_flags(struct binder_proc *proc, int flags)
  {
        struct files_struct *files = proc->files;
-       int fd, error;
-       struct fdtable *fdt;
        unsigned long rlim_cur;
        unsigned long irqs;
  
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc fs/9p/v9fs.c
Simple merge
diff --cc fs/adfs/super.c
Simple merge
diff --cc fs/affs/super.c
Simple merge
Simple merge
diff --cc fs/bfs/inode.c
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
Simple merge
diff --cc fs/dcache.c
Simple merge
Simple merge
diff --cc fs/ext3/super.c
Simple merge
diff --cc fs/ext4/ioctl.c
Simple merge
diff --cc fs/ext4/super.c
Simple merge
diff --cc fs/fat/inode.c
Simple merge
diff --cc fs/fuse/dev.c
Simple merge
diff --cc fs/fuse/inode.c
Simple merge
diff --cc fs/hfs/super.c
Simple merge
diff --cc fs/hpfs/super.c
Simple merge
Simple merge
Simple merge
diff --cc fs/jfs/super.c
Simple merge
diff --cc fs/locks.c
Simple merge
Simple merge
Simple merge
diff --cc fs/namei.c
Simple merge
Simple merge
diff --cc fs/nfs/inode.c
Simple merge
Simple merge
diff --cc fs/ntfs/super.c
Simple merge
Simple merge
diff --cc fs/open.c
Simple merge
diff --cc fs/proc/base.c
Simple merge
diff --cc fs/qnx4/inode.c
Simple merge
diff --cc fs/qnx6/inode.c
Simple merge
diff --cc fs/stat.c
Simple merge
diff --cc fs/sysv/inode.c
Simple merge
Simple merge
diff --cc fs/udf/super.c
Simple merge
diff --cc fs/xattr.c
Simple merge
Simple merge
index 99276c3dc89aef2f3d2014ca87b427877247d6f8,c8a9708d4d6604199478aba8511360ae07419208..a3831f30e120a77970654c4e77a748df02dd0119
@@@ -246,7 -247,7 +247,8 @@@ extern int              sock_sendmsg(struct 
                                  size_t len);
  extern int         sock_recvmsg(struct socket *sock, struct msghdr *msg,
                                  size_t size, int flags);
- extern int         sock_map_fd(struct socket *sock, int flags);
 -extern struct file  *sock_alloc_file(struct socket *sock, int flags);
++extern struct file  *sock_alloc_file(struct socket *sock, int flags,
++                                   const char *dname);
  extern struct socket *sockfd_lookup(int fd, int *err);
  extern struct socket *sock_from_file(struct file *file, int *err);
  #define                    sockfd_put(sock) fput(sock->file)
Simple merge
Simple merge
diff --cc kernel/exit.c
Simple merge
Simple merge
index 730a435b2c0bbe74cca7c14dfd22cb1f46adc579,8c4e0b538a8a1b354d950ce6c018b515431e9fde..02efb25c295705141b3c477a2712864674ae42cc
@@@ -802,8 -801,8 +803,8 @@@ static int p9_socket_open(struct p9_cli
                return -ENOMEM;
  
        csocket->sk->sk_allocation = GFP_NOIO;
-       fd = sock_map_fd(csocket, 0);
-       if (fd < 0) {
 -      file = sock_alloc_file(csocket, 0);
++      file = sock_alloc_file(csocket, 0, NULL);
+       if (IS_ERR(file)) {
                pr_err("%s (%d): failed to map fd\n",
                       __func__, task_pid_nr(current));
                sock_release(csocket);
Simple merge
diff --cc net/core/scm.c
Simple merge
index d37d24ff197f094d5200fd9e51a692a08112157e,fb5931ca50d0fc4aad0ac49d60b7591d981ea30f..59d16ea927f0f83d706d3a59c79d13be0a95c1e8
@@@ -4311,6 -4297,13 +4313,13 @@@ static int sctp_getsockopt_peeloff(stru
                goto out;
        }
  
 -      newfile = sock_alloc_file(newsock, 0);
++      newfile = sock_alloc_file(newsock, 0, NULL);
+       if (unlikely(IS_ERR(newfile))) {
+               put_unused_fd(retval);
+               sock_release(newsock);
+               return PTR_ERR(newfile);
+       }
        SCTP_DEBUG_PRINTK("%s: sk: %p newsk: %p sd: %d\n",
                          __func__, sk, newsock->sk, retval);
  
diff --cc net/socket.c
index 80dc7e84b046358581f454ec87993d4195e6edc3,38a14311f3a6ffc0f21a2500a826f39b4ec0271b..5584bd8ccd3fecae87f74b061c919dd9260de3e3
@@@ -347,30 -346,15 +347,23 @@@ static struct file_system_type sock_fs_
   *    but we take care of internal coherence yet.
   */
  
- static int sock_alloc_file(struct socket *sock, struct file **f, int flags,
-                          const char *dname)
 -struct file *sock_alloc_file(struct socket *sock, int flags)
++struct file *sock_alloc_file(struct socket *sock, int flags,
++                           const char *dname)
  {
        struct qstr name = { .name = "" };
        struct path path;
        struct file *file;
-       int fd;
-       fd = get_unused_fd_flags(flags);
-       if (unlikely(fd < 0))
-               return fd;
  
 +      if (dname) {
 +              name.name = dname;
 +              name.len = strlen(name.name);
 +      } else if (sock->sk) {
 +              name.name = sock->sk->sk_prot_creator->name;
 +              name.len = strlen(name.name);
 +      }
        path.dentry = d_alloc_pseudo(sock_mnt->mnt_sb, &name);
-       if (unlikely(!path.dentry)) {
-               put_unused_fd(fd);
-               return -ENOMEM;
-       }
+       if (unlikely(!path.dentry))
+               return ERR_PTR(-ENOMEM);
        path.mnt = mntget(sock_mnt);
  
        d_instantiate(path.dentry, SOCK_INODE(sock));
        file->f_flags = O_RDWR | (flags & O_NONBLOCK);
        file->f_pos = 0;
        file->private_data = sock;
-       *f = file;
-       return fd;
+       return file;
  }
+ EXPORT_SYMBOL(sock_alloc_file);
  
- int sock_map_fd(struct socket *sock, int flags)
static int sock_map_fd(struct socket *sock, int flags)
  {
        struct file *newfile;
-       int fd = sock_alloc_file(sock, &newfile, flags, NULL);
+       int fd = get_unused_fd_flags(flags);
+       if (unlikely(fd < 0))
+               return fd;
  
-       if (likely(fd >= 0))
 -      newfile = sock_alloc_file(sock, flags);
++      newfile = sock_alloc_file(sock, flags, NULL);
+       if (likely(!IS_ERR(newfile))) {
                fd_install(fd, newfile);
+               return fd;
+       }
  
-       return fd;
+       put_unused_fd(fd);
+       return PTR_ERR(newfile);
  }
- EXPORT_SYMBOL(sock_map_fd);
  
  struct socket *sock_from_file(struct file *file, int *err)
  {
@@@ -1471,12 -1395,27 +1467,27 @@@ SYSCALL_DEFINE4(socketpair, int, family
                err = fd1;
                goto out_release_both;
        }
-       fd2 = sock_alloc_file(sock2, &newfile2, flags, NULL);
+       fd2 = get_unused_fd_flags(flags);
        if (unlikely(fd2 < 0)) {
                err = fd2;
 -      newfile1 = sock_alloc_file(sock1, flags);
+               put_unused_fd(fd1);
+               goto out_release_both;
+       }
 -      newfile2 = sock_alloc_file(sock2, flags);
++      newfile1 = sock_alloc_file(sock1, flags, NULL);
+       if (unlikely(IS_ERR(newfile1))) {
+               err = PTR_ERR(newfile1);
+               put_unused_fd(fd1);
+               put_unused_fd(fd2);
+               goto out_release_both;
+       }
++      newfile2 = sock_alloc_file(sock2, flags, NULL);
+       if (IS_ERR(newfile2)) {
+               err = PTR_ERR(newfile2);
                fput(newfile1);
                put_unused_fd(fd1);
+               put_unused_fd(fd2);
                sock_release(sock2);
                goto out;
        }
@@@ -1615,6 -1553,13 +1625,14 @@@ SYSCALL_DEFINE4(accept4, int, fd, struc
                sock_release(newsock);
                goto out_put;
        }
 -      newfile = sock_alloc_file(newsock, flags);
++      newfile = sock_alloc_file(newsock, flags,
++                                sock->sk->sk_prot_creator->name);
+       if (unlikely(IS_ERR(newfile))) {
+               err = PTR_ERR(newfile);
+               put_unused_fd(newfd);
+               sock_release(newsock);
+               goto out_put;
+       }
  
        err = security_socket_accept(sock, newsock);
        if (err)