]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/relayfs/relay.c
[PATCH] relayfs: decouple buffer creation from inode creation
[linux-2.6-omap-h63xx.git] / fs / relayfs / relay.c
index 2a6f7f12b7f9458a96f19be651f1d05bbef4f601..7fbda177ad8fd144cc359817a483211bd90c0c45 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);