Pull sony into release branch
[pandora-kernel.git] / arch / sparc64 / solaris / socksys.c
index fc6669e..c286444 100644 (file)
@@ -26,7 +26,6 @@
 #include <linux/slab.h>
 #include <linux/syscalls.h>
 #include <linux/in.h>
-#include <linux/devfs_fs_kernel.h>
 
 #include <net/sock.h>
 
@@ -97,13 +96,13 @@ static int socksys_open(struct inode * inode, struct file * filp)
         * No shit.  WTF is it supposed to do, anyway?
         *
         * Try instead:
-        * d_delete(filp->f_dentry), then d_instantiate with sock inode
+        * d_delete(filp->f_path.dentry), then d_instantiate with sock inode
         */
-       dentry = filp->f_dentry;
-       filp->f_dentry = dget(fcheck(fd)->f_dentry);
-       filp->f_dentry->d_inode->i_rdev = inode->i_rdev;
-       filp->f_dentry->d_inode->i_flock = inode->i_flock;
-       SOCKET_I(filp->f_dentry->d_inode)->file = filp;
+       dentry = filp->f_path.dentry;
+       filp->f_path.dentry = dget(fcheck(fd)->f_path.dentry);
+       filp->f_path.dentry->d_inode->i_rdev = inode->i_rdev;
+       filp->f_path.dentry->d_inode->i_flock = inode->i_flock;
+       SOCKET_I(filp->f_path.dentry->d_inode)->file = filp;
        filp->f_op = &socksys_file_ops;
         sock = (struct sol_socket_struct*) 
                mykmalloc(sizeof(struct sol_socket_struct), GFP_KERNEL);
@@ -149,7 +148,7 @@ static unsigned int socksys_poll(struct file * filp, poll_table * wait)
        struct inode *ino;
        unsigned int mask = 0;
 
-       ino=filp->f_dentry->d_inode;
+       ino=filp->f_path.dentry->d_inode;
        if (ino && S_ISSOCK(ino->i_mode)) {
                struct sol_socket_struct *sock;
                sock = (struct sol_socket_struct*)filp->private_data;
@@ -164,13 +163,12 @@ static unsigned int socksys_poll(struct file * filp, poll_table * wait)
        return mask;
 }
        
-static struct file_operations socksys_fops = {
+static const struct file_operations socksys_fops = {
        .open =         socksys_open,
        .release =      socksys_release,
 };
 
-int __init
-init_socksys(void)
+int __init init_socksys(void)
 {
        int ret;
        struct file * file;
@@ -190,8 +188,6 @@ init_socksys(void)
                return ret;
        }
 
-       devfs_mk_cdev(MKDEV(30, 0), S_IFCHR|S_IRUSR|S_IWUSR, "socksys");
-
        file = fcheck(ret);
        /* N.B. Is this valid? Suppose the f_ops are in a module ... */
        socksys_file_ops = *file->f_op;
@@ -202,10 +198,8 @@ init_socksys(void)
        return 0;
 }
 
-void
-cleanup_socksys(void)
+void __exit cleanup_socksys(void)
 {
        if (unregister_chrdev(30, "socksys"))
                printk ("Couldn't unregister socksys character device\n");
-       devfs_remove ("socksys");
 }