OSDN Git Service

btrfs: set trans->drity in btrfs_commit_transaction
[sagit-ice-cold/kernel_xiaomi_msm8998.git] / fs / seq_file.c
index e85664b..6dc4296 100644 (file)
@@ -72,9 +72,10 @@ int seq_open(struct file *file, const struct seq_operations *op)
 
        mutex_init(&p->lock);
        p->op = op;
-#ifdef CONFIG_USER_NS
-       p->user_ns = file->f_cred->user_ns;
-#endif
+
+       // No refcounting: the lifetime of 'p' is constrained
+       // to the lifetime of the file.
+       p->file = file;
 
        /*
         * Wrappers around seq_open(e.g. swaps_open) need to be
@@ -222,8 +223,10 @@ ssize_t seq_read(struct file *file, char __user *buf, size_t size, loff_t *ppos)
                size -= n;
                buf += n;
                copied += n;
-               if (!m->count)
+               if (!m->count) {
+                       m->from = 0;
                        m->index++;
+               }
                if (!size)
                        goto Done;
        }