mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-30 19:15:14 +00:00
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>
This commit is contained in:
parent
a30efe261b
commit
d5d962265d
1 changed files with 2 additions and 14 deletions
|
@ -380,26 +380,14 @@ no_config:
|
||||||
static int fscache_objlist_open(struct inode *inode, struct file *file)
|
static int fscache_objlist_open(struct inode *inode, struct file *file)
|
||||||
{
|
{
|
||||||
struct fscache_objlist_data *data;
|
struct fscache_objlist_data *data;
|
||||||
struct seq_file *m;
|
|
||||||
int ret;
|
|
||||||
|
|
||||||
ret = seq_open(file, &fscache_objlist_ops);
|
data = __seq_open_private(file, &fscache_objlist_ops, sizeof(*data));
|
||||||
if (ret < 0)
|
if (!data)
|
||||||
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);
|
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
|
||||||
|
|
||||||
/* get the configuration key */
|
/* get the configuration key */
|
||||||
fscache_objlist_config(data);
|
fscache_objlist_config(data);
|
||||||
|
|
||||||
m->private = data;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue