mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 11:46:19 +00:00
[SUNRPC]: Make the sunrpc use the seq_open_private()
Just switch to the consolidated code. Signed-off-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
a662d4cb50
commit
ec93103519
1 changed files with 2 additions and 10 deletions
|
@ -1218,23 +1218,15 @@ static const struct seq_operations cache_content_op = {
|
||||||
|
|
||||||
static int content_open(struct inode *inode, struct file *file)
|
static int content_open(struct inode *inode, struct file *file)
|
||||||
{
|
{
|
||||||
int res;
|
|
||||||
struct handle *han;
|
struct handle *han;
|
||||||
struct cache_detail *cd = PDE(inode)->data;
|
struct cache_detail *cd = PDE(inode)->data;
|
||||||
|
|
||||||
han = kmalloc(sizeof(*han), GFP_KERNEL);
|
han = __seq_open_private(file, &cache_content_op, sizeof(*han));
|
||||||
if (han == NULL)
|
if (han == NULL)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
han->cd = cd;
|
han->cd = cd;
|
||||||
|
return 0;
|
||||||
res = seq_open(file, &cache_content_op);
|
|
||||||
if (res)
|
|
||||||
kfree(han);
|
|
||||||
else
|
|
||||||
((struct seq_file *)file->private_data)->private = han;
|
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct file_operations content_file_operations = {
|
static const struct file_operations content_file_operations = {
|
||||||
|
|
Loading…
Reference in a new issue