]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - fs/9p/vfs_inode.c
9p: Add mksock support
[karo-tx-linux.git] / fs / 9p / vfs_inode.c
index de9a39590b70eb29b02af909942b8cae2cfd1fc8..29367ee25cb82206c3a7ed7a26aea10c2254a8a2 100644 (file)
@@ -697,8 +697,8 @@ static struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry,
        if (IS_ERR(fid)) {
                result = PTR_ERR(fid);
                if (result == -ENOENT) {
-                       d_add(dentry, NULL);
-                       return NULL;
+                       inode = NULL;
+                       goto inst_out;
                }
 
                return ERR_PTR(result);
@@ -715,7 +715,8 @@ static struct dentry *v9fs_vfs_lookup(struct inode *dir, struct dentry *dentry,
        if (result < 0)
                goto error;
 
-       if ((fid->qid.version) && (v9ses->cache))
+inst_out:
+       if (v9ses->cache)
                dentry->d_op = &v9fs_cached_dentry_operations;
        else
                dentry->d_op = &v9fs_dentry_operations;
@@ -1226,6 +1227,8 @@ v9fs_vfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t rdev)
                sprintf(name, "c %u %u", MAJOR(rdev), MINOR(rdev));
        else if (S_ISFIFO(mode))
                *name = 0;
+       else if (S_ISSOCK(mode))
+               *name = 0;
        else {
                __putname(name);
                return -EINVAL;