diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2007-10-10 05:31:07 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-10-10 19:55:36 -0400 |
commit | ec931035194709d0cde647d1c347bbf9634eec25 (patch) | |
tree | d4194d3e63fa5db76afe23f4b64d2356cb4226b3 /net/sunrpc/cache.c | |
parent | a662d4cb50d3976d2c9c9bac34119d0036e31d21 (diff) |
[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 'net/sunrpc/cache.c')
-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 = { | |||
1218 | 1218 | ||
1219 | static int content_open(struct inode *inode, struct file *file) | 1219 | static int content_open(struct inode *inode, struct file *file) |
1220 | { | 1220 | { |
1221 | int res; | ||
1222 | struct handle *han; | 1221 | struct handle *han; |
1223 | struct cache_detail *cd = PDE(inode)->data; | 1222 | struct cache_detail *cd = PDE(inode)->data; |
1224 | 1223 | ||
1225 | han = kmalloc(sizeof(*han), GFP_KERNEL); | 1224 | han = __seq_open_private(file, &cache_content_op, sizeof(*han)); |
1226 | if (han == NULL) | 1225 | if (han == NULL) |
1227 | return -ENOMEM; | 1226 | return -ENOMEM; |
1228 | 1227 | ||
1229 | han->cd = cd; | 1228 | han->cd = cd; |
1230 | 1229 | return 0; | |
1231 | res = seq_open(file, &cache_content_op); | ||
1232 | if (res) | ||
1233 | kfree(han); | ||
1234 | else | ||
1235 | ((struct seq_file *)file->private_data)->private = han; | ||
1236 | |||
1237 | return res; | ||
1238 | } | 1230 | } |
1239 | 1231 | ||
1240 | static const struct file_operations content_file_operations = { | 1232 | static const struct file_operations content_file_operations = { |