Whamcloud - gitweb
LU-14043 llite: allow DIO with unaligned IO count
[fs/lustre-release.git] / lustre / mdt / mdt_hsm_cdt_requests.c
index a68f4fe..7135334 100644 (file)
@@ -184,13 +184,11 @@ static void mdt_cdt_free_request_tree(struct cdt_req_progress *crp)
        }
        /* 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;
@@ -221,7 +219,7 @@ static int hsm_update_work(struct cdt_req_progress *crp,
        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);
 
@@ -235,7 +233,7 @@ static int hsm_update_work(struct cdt_req_progress *crp,
                /* 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);
                }
 
@@ -617,8 +615,8 @@ static const struct seq_operations mdt_hsm_active_requests_proc_ops = {
  * 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;
@@ -629,7 +627,7 @@ static int lprocfs_open_hsm_active_requests(struct inode *inode,
                RETURN(rc);
        }
        s = file->private_data;
-       s->private = PDE_DATA(inode);
+       s->private = inode->i_private;
 
        RETURN(rc);
 }
@@ -637,9 +635,9 @@ static int lprocfs_open_hsm_active_requests(struct inode *inode,
 /* 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,
 };