Commit c3f94b40 authored by Martin Peschke's avatar Martin Peschke Committed by Linus Torvalds

md: cleanup: use seq_release_private() where appropriate

We can save some lines of code by using seq_release_private().
Signed-off-by: default avatarMartin Peschke <mp3@de.ibm.com>
Acked-by: default avatarNeil Brown <neilb@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 50511da3
...@@ -4941,15 +4941,6 @@ static int md_seq_open(struct inode *inode, struct file *file) ...@@ -4941,15 +4941,6 @@ static int md_seq_open(struct inode *inode, struct file *file)
return error; return error;
} }
static int md_seq_release(struct inode *inode, struct file *file)
{
struct seq_file *m = file->private_data;
struct mdstat_info *mi = m->private;
m->private = NULL;
kfree(mi);
return seq_release(inode, file);
}
static unsigned int mdstat_poll(struct file *filp, poll_table *wait) static unsigned int mdstat_poll(struct file *filp, poll_table *wait)
{ {
struct seq_file *m = filp->private_data; struct seq_file *m = filp->private_data;
...@@ -4971,7 +4962,7 @@ static const struct file_operations md_seq_fops = { ...@@ -4971,7 +4962,7 @@ static const struct file_operations md_seq_fops = {
.open = md_seq_open, .open = md_seq_open,
.read = seq_read, .read = seq_read,
.llseek = seq_lseek, .llseek = seq_lseek,
.release = md_seq_release, .release = seq_release_private,
.poll = mdstat_poll, .poll = mdstat_poll,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment