| Issue 119: | Doubt in code : userspace/ohsm.c ohsm_enable() | |
| 1 person starred this issue and may be notified of changes. | Back to list |
Hello Vineet, RKS, These are some lines of code from userspace/ohsm.c fun: ohsm_enable () dev_info = > (struct ohsm_tier_dev_info *) malloc(sizeof(struct ohsm_tier_dev_info)); > allocpol = > (struct ohsm_allocation_policy *) > malloc(sizeof(struct ohsm_allocation_policy)); > relocpol = > (struct ohsm_reloc_policy *)malloc(sizeof(struct ohsm_reloc_policy)); Here we are dynamically allocating memory to pointers. Can you please explain the need of dynamically allocating the memory here
Aug 2, 2009
Project Member
#1
imreckless@gmail.com
Aug 2, 2009
Charles, If I have it right, they had a static policy array, but at this point it is simply unknown how many policies will suffice. Thus a dynamic approach was selected to allow for future tuning of the max policies. This has the biggest effect in user space because comparing newly created files will be in the hot path of file creation. The team can correct me if I'm wrong, but I don't think this has been analyzed in detail yet. |