diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2007-10-10 11:31:07 +0200 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-11 01:55:36 +0200 |
commit | ec931035194709d0cde647d1c347bbf9634eec25 (patch) | |
tree | d4194d3e63fa5db76afe23f4b64d2356cb4226b3 /net/sunrpc/cache.c | |
parent | [IRDA]: Make the IRDA use the seq_open_private() (diff) | |
download | linux-ec931035194709d0cde647d1c347bbf9634eec25.tar.xz linux-ec931035194709d0cde647d1c347bbf9634eec25.zip |
[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>
Diffstat (limited to '')
-rw-r--r-- | net/sunrpc/cache.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/net/sunrpc/cache.c b/net/sunrpc/cache.c index ebe344f34d1a..8e05557414ce 100644 --- a/net/sunrpc/cache.c +++ b/net/sunrpc/cache.c @@ -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 = { |