Pull bugzilla-7897 into release branch
[sfrench/cifs-2.6.git] / block / blktrace.c
index 74e02c04b2dab6eb9567a49f9e589cfe69fb2e9e..3f0e7c37c059037080cbe44456f176c5a4800319 100644 (file)
@@ -264,7 +264,7 @@ static ssize_t blk_dropped_read(struct file *filp, char __user *buffer,
        return simple_read_from_buffer(buffer, count, ppos, buf, strlen(buf));
 }
 
-static struct file_operations blk_dropped_fops = {
+static const struct file_operations blk_dropped_fops = {
        .owner =        THIS_MODULE,
        .open =         blk_dropped_open,
        .read =         blk_dropped_read,
@@ -363,10 +363,9 @@ static int blk_trace_setup(request_queue_t *q, struct block_device *bdev,
        if (!bt->dropped_file)
                goto err;
 
-       bt->rchan = relay_open("trace", dir, buts.buf_size, buts.buf_nr, &blk_relay_callbacks);
+       bt->rchan = relay_open("trace", dir, buts.buf_size, buts.buf_nr, &blk_relay_callbacks, bt);
        if (!bt->rchan)
                goto err;
-       bt->rchan->private_data = bt;
 
        bt->act_mask = buts.act_mask;
        if (!bt->act_mask)
@@ -394,8 +393,7 @@ err:
        if (bt) {
                if (bt->dropped_file)
                        debugfs_remove(bt->dropped_file);
-               if (bt->sequence)
-                       free_percpu(bt->sequence);
+               free_percpu(bt->sequence);
                if (bt->rchan)
                        relay_close(bt->rchan);
                kfree(bt);