summaryrefslogtreecommitdiffstats
path: root/fs/fscache
diff options
context:
space:
mode:
authorRob Jones <rob.jones@codethink.co.uk>2014-09-17 09:56:40 +0100
committerDavid Howells <dhowells@redhat.com>2014-10-13 17:52:21 +0100
commitd5d962265d99088ce96480db3e61358d7170e24c (patch)
tree5ab036cc2afff086743f3432191c1edafcdfd5a2 /fs/fscache
parenta30efe261b5a8fb2e3cf8ea9c3aca51e0619c2cc (diff)
downloadlinux-d5d962265d99088ce96480db3e61358d7170e24c.tar.gz
linux-d5d962265d99088ce96480db3e61358d7170e24c.tar.bz2
linux-d5d962265d99088ce96480db3e61358d7170e24c.zip
fs/fscache/object-list.c: use __seq_open_private()
Reduce boilerplate code by using __seq_open_private() instead of seq_open() in fscache_objlist_open(). Signed-off-by: Rob Jones <rob.jones@codethink.co.uk> Signed-off-by: David Howells <dhowells@redhat.com> Acked-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'fs/fscache')
-rw-r--r--fs/fscache/object-list.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/fs/fscache/object-list.c b/fs/fscache/object-list.c
index b8179ca6bf9d..51dde817e1f2 100644
--- a/fs/fscache/object-list.c
+++ b/fs/fscache/object-list.c
@@ -380,26 +380,14 @@ no_config:
static int fscache_objlist_open(struct inode *inode, struct file *file)
{
struct fscache_objlist_data *data;
- struct seq_file *m;
- int ret;
- ret = seq_open(file, &fscache_objlist_ops);
- if (ret < 0)
- return ret;
-
- m = file->private_data;
-
- /* buffer for key extraction */
- data = kmalloc(sizeof(struct fscache_objlist_data), GFP_KERNEL);
- if (!data) {
- seq_release(inode, file);
+ data = __seq_open_private(file, &fscache_objlist_ops, sizeof(*data));
+ if (!data)
return -ENOMEM;
- }
/* get the configuration key */
fscache_objlist_config(data);
- m->private = data;
return 0;
}