Skip to content

Commit

Permalink
[SUNRPC]: Make the sunrpc use the seq_open_private()
Browse files Browse the repository at this point in the history
Just switch to the consolidated code.

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Pavel Emelyanov authored and David S. Miller committed Oct 10, 2007
1 parent a662d4c commit ec93103
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions net/sunrpc/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -1218,23 +1218,15 @@ static const struct seq_operations cache_content_op = {

static int content_open(struct inode *inode, struct file *file)
{
int res;
struct handle *han;
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)
return -ENOMEM;

han->cd = cd;

res = seq_open(file, &cache_content_op);
if (res)
kfree(han);
else
((struct seq_file *)file->private_data)->private = han;

return res;
return 0;
}

static const struct file_operations content_file_operations = {
Expand Down

0 comments on commit ec93103

Please sign in to comment.