X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fmdt%2Fmdt_hsm_cdt_requests.c;h=71353341dc00a23133523fe44e3b08d110da2a1d;hb=45c46c6effd8273dc4ca52f32447f9f7103057b1;hp=29a638de48efb7260da63e554e724210fe01c210;hpb=973759d1ff3bbcb217754bd9942fdf670dec2d96;p=fs%2Flustre-release.git diff --git a/lustre/mdt/mdt_hsm_cdt_requests.c b/lustre/mdt/mdt_hsm_cdt_requests.c index 29a638d..7135334 100644 --- a/lustre/mdt/mdt_hsm_cdt_requests.c +++ b/lustre/mdt/mdt_hsm_cdt_requests.c @@ -23,7 +23,7 @@ * (C) Copyright 2012 Commissariat a l'energie atomique et aux energies * alternatives * - * Copyright (c) 2014, Intel Corporation. + * Copyright (c) 2014, 2017, Intel Corporation. */ /* * lustre/mdt/mdt_hsm_cdt_requests.c @@ -103,13 +103,13 @@ void dump_requests(char *prefix, struct coordinator *cdt) down_read(&cdt->cdt_request_lock); list_for_each_entry(car, &cdt->cdt_request_list, car_request_list) { CDEBUG(D_HSM, "%s fid="DFID" dfid="DFID - " compound/cookie=%#llx/%#llx" + " cookie=%#llx" " action=%s archive#=%d flags=%#llx" " extent=%#llx-%#llx" " gid=%#llx refcount=%d canceled=%d\n", prefix, PFID(&car->car_hai->hai_fid), PFID(&car->car_hai->hai_dfid), - car->car_compound_id, car->car_hai->hai_cookie, + car->car_hai->hai_cookie, hsm_copytool_action2name(car->car_hai->hai_action), car->car_archive_id, car->car_flags, car->car_hai->hai_extent.offset, @@ -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); } @@ -280,7 +278,6 @@ static void mdt_cdt_init_request_tree(struct cdt_req_progress *crp) /** Allocate/init an agent request and its sub-structures. * - * \param compound_id [IN] * \param archive_id [IN] * \param flags [IN] * \param uuid [IN] @@ -288,8 +285,8 @@ static void mdt_cdt_init_request_tree(struct cdt_req_progress *crp) * \retval car [OUT] success valid structure * \retval car [OUT] */ -struct cdt_agent_req *mdt_cdt_alloc_request(__u64 compound_id, __u32 archive_id, - __u64 flags, struct obd_uuid *uuid, +struct cdt_agent_req *mdt_cdt_alloc_request(__u32 archive_id, __u64 flags, + struct obd_uuid *uuid, struct hsm_action_item *hai) { struct cdt_agent_req *car; @@ -300,7 +297,6 @@ struct cdt_agent_req *mdt_cdt_alloc_request(__u64 compound_id, __u32 archive_id, RETURN(ERR_PTR(-ENOMEM)); atomic_set(&car->car_refcount, 1); - car->car_compound_id = compound_id; car->car_archive_id = archive_id; car->car_flags = flags; car->car_canceled = 0; @@ -581,7 +577,7 @@ static int mdt_hsm_active_requests_proc_show(struct seq_file *s, void *v) " data=[%s] canceled=%d uuid=%s done=%llu\n", PFID(&car->car_hai->hai_fid), PFID(&car->car_hai->hai_dfid), - car->car_compound_id, car->car_hai->hai_cookie, + 0ULL /* compound_id */, car->car_hai->hai_cookie, hsm_copytool_action2name(car->car_hai->hai_action), car->car_archive_id, car->car_flags, car->car_hai->hai_extent.offset, @@ -619,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; @@ -631,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); } @@ -639,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, };