[PATCH] relayfs: decouple buffer creation from inode creation
[powerpc.git] / fs / relayfs / relay.c
index 2a6f7f1..7fbda17 100644 (file)
@@ -171,12 +171,17 @@ static struct rchan_buf *relay_open_buf(struct rchan *chan,
        struct rchan_buf *buf;
        struct dentry *dentry;
 
+       buf = relay_create_buf(chan);
+       if (!buf)
+               return NULL;
+
        /* Create file in fs */
-       dentry = relayfs_create_file(filename, parent, S_IRUSR, chan);
-       if (!dentry)
+       dentry = relayfs_create_file(filename, parent, S_IRUSR, buf);
+       if (!dentry) {
+               relay_destroy_buf(buf);
                return NULL;
+       }
 
-       buf = RELAYFS_I(dentry->d_inode)->buf;
        buf->dentry = dentry;
        __relay_reset(buf, 1);