Guest User

Untitled

a guest
Jun 18th, 2018
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. void handle_scheduler_pipe_show_remote_value(struct rpc_desc *desc, void *msgIn, size_t size)
  2. {
  3. struct config_item *item;
  4. struct scheduler_probe_source *source;
  5. char *page;
  6. ssize_t r;
  7.  
  8. printk(KERN_INFO "Entering handle_scheduler_pipe_show_remote_value\n");
  9. item = kmalloc(sizeof(struct config_item), GFP_KERNEL);
  10. if (!item)
  11. goto exit;
  12.  
  13. source = kmalloc(sizeof(struct scheduler_probe_source), GFP_KERNEL);
  14. if (!source)
  15. goto exit_source;
  16.  
  17. printk(KERN_INFO "Unpacking config_titem\n");
  18. item = global_config_unpack_get_item(desc);
  19. if (!item)
  20. goto exit_unpack_item;
  21.  
  22. source = to_scheduler_probe_source(item);
  23. if (!source)
  24. goto exit_to_source;
  25.  
  26. page = kmalloc(SCHEDULER_PROBE_SOURCE_ATTR_SIZE, GFP_KERNEL);
  27. if (!page)
  28. goto exit_page;
  29.  
  30. printk(KERN_INFO "About to make show_value\n");
  31. r = source->source.type->show_value(&source->source, page);
  32. rpc_pack_type(desc, r);
  33.  
  34. printk(KERN_INFO "Probe source returned %d bytes.\n", r);
  35. if (r > 0) {
  36. rpc_pack(desc, 0, page, r);
  37. }
  38.  
  39. printk(KERN_INFO "Exiting handle_scheduler_pipe_show_remote_value\n");
  40.  
  41. kfree(page);
  42. kfree(source);
  43. kfree(item);
  44.  
  45. exit_page:
  46. exit_to_source:
  47. exit_unpack_item:
  48. kfree(source);
  49. exit_source:
  50. kfree(item);
  51. exit:
  52. printk(KERN_ERR "not enough memory to handle remote pipe show value.\n");
  53. }
Add Comment
Please, Sign In to add comment