aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/taskstats.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-08-28 12:52:22 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-09-26 22:20:08 -0400
commit2903ff019b346ab8d36ebbf54853c3aaf6590608 (patch)
tree962d94054765bb37bc00e977c3036e65c5fd91fe /kernel/taskstats.c
parenta5b470ba06aa3f96999ede5feba178df6bdb134a (diff)
switch simple cases of fget_light to fdget
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'kernel/taskstats.c')
-rw-r--r--kernel/taskstats.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/kernel/taskstats.c b/kernel/taskstats.c
index d0a32796550f..5116b7e5962e 100644
--- a/kernel/taskstats.c
+++ b/kernel/taskstats.c
@@ -415,16 +415,15 @@ static int cgroupstats_user_cmd(struct sk_buff *skb, struct genl_info *info)
415 struct nlattr *na; 415 struct nlattr *na;
416 size_t size; 416 size_t size;
417 u32 fd; 417 u32 fd;
418 struct file *file; 418 struct fd f;
419 int fput_needed;
420 419
421 na = info->attrs[CGROUPSTATS_CMD_ATTR_FD]; 420 na = info->attrs[CGROUPSTATS_CMD_ATTR_FD];
422 if (!na) 421 if (!na)
423 return -EINVAL; 422 return -EINVAL;
424 423
425 fd = nla_get_u32(info->attrs[CGROUPSTATS_CMD_ATTR_FD]); 424 fd = nla_get_u32(info->attrs[CGROUPSTATS_CMD_ATTR_FD]);
426 file = fget_light(fd, &fput_needed); 425 f = fdget(fd);
427 if (!file) 426 if (!f.file)
428 return 0; 427 return 0;
429 428
430 size = nla_total_size(sizeof(struct cgroupstats)); 429 size = nla_total_size(sizeof(struct cgroupstats));
@@ -444,7 +443,7 @@ static int cgroupstats_user_cmd(struct sk_buff *skb, struct genl_info *info)
444 stats = nla_data(na); 443 stats = nla_data(na);
445 memset(stats, 0, sizeof(*stats)); 444 memset(stats, 0, sizeof(*stats));
446 445
447 rc = cgroupstats_build(stats, file->f_dentry); 446 rc = cgroupstats_build(stats, f.file->f_dentry);
448 if (rc < 0) { 447 if (rc < 0) {
449 nlmsg_free(rep_skb); 448 nlmsg_free(rep_skb);
450 goto err; 449 goto err;
@@ -453,7 +452,7 @@ static int cgroupstats_user_cmd(struct sk_buff *skb, struct genl_info *info)
453 rc = send_reply(rep_skb, info); 452 rc = send_reply(rep_skb, info);
454 453
455err: 454err:
456 fput_light(file, fput_needed); 455 fdput(f);
457 return rc; 456 return rc;
458} 457}
459 458