}
/* free all sub vectors */
for (i = 0 ; i <= crp->crp_max / NODE_VECTOR_SZ ; i++)
- OBD_FREE(crp->crp_node[i],
- NODE_VECTOR_SZ * sizeof(crp->crp_node[i][0]));
+ OBD_FREE_PTR_ARRAY(crp->crp_node[i], NODE_VECTOR_SZ);
/* free main vector */
- OBD_FREE(crp->crp_node,
- sizeof(crp->crp_node[0]) *
- (crp->crp_max / NODE_VECTOR_SZ + 1));
+ OBD_FREE_PTR_ARRAY(crp->crp_node,
+ (crp->crp_max / NODE_VECTOR_SZ + 1));
crp->crp_cnt = 0;
crp->crp_max = 0;
if (crp->crp_cnt >= crp->crp_max) {
/* no more room */
/* allocate a new vector */
- OBD_ALLOC(v, NODE_VECTOR_SZ * sizeof(v[0]));
+ OBD_ALLOC_PTR_ARRAY(v, NODE_VECTOR_SZ);
if (v == NULL)
GOTO(out, rc = -ENOMEM);
/* increase main vector size */
OBD_ALLOC(new_vv, nsz);
if (new_vv == NULL) {
- OBD_FREE(v, NODE_VECTOR_SZ * sizeof(v[0]));
+ OBD_FREE_PTR_ARRAY(v, NODE_VECTOR_SZ);
GOTO(out, rc = -ENOMEM);
}
* public function called at open of /proc file to get
* list of agents
*/
-static int lprocfs_open_hsm_active_requests(struct inode *inode,
- struct file *file)
+static int ldebugfs_open_hsm_active_requests(struct inode *inode,
+ struct file *file)
{
struct seq_file *s;
int rc;
RETURN(rc);
}
s = file->private_data;
- s->private = PDE_DATA(inode);
+ s->private = inode->i_private;
RETURN(rc);
}
/* methods to access hsm request list */
const struct file_operations mdt_hsm_active_requests_fops = {
.owner = THIS_MODULE,
- .open = lprocfs_open_hsm_active_requests,
+ .open = ldebugfs_open_hsm_active_requests,
.read = seq_read,
.llseek = seq_lseek,
- .release = lprocfs_seq_release,
+ .release = seq_release,
};