X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fobdclass%2Fgenops.c;h=081b55e3d748caf2f92498a38db1e57ecae56959;hp=9839fcd88da5fecffc7decbbe21a6a202813c8ca;hb=1069f0832fe33a6944bcba0773ae4241949f970c;hpb=dd1a1955ecaaa17d4bcba822023d4c78bb10ce6c diff --git a/lustre/obdclass/genops.c b/lustre/obdclass/genops.c index 9839fcd..081b55e 100644 --- a/lustre/obdclass/genops.c +++ b/lustre/obdclass/genops.c @@ -798,6 +798,11 @@ static void export_handle_addref(void *export) class_export_get(export); } +static struct portals_handle_ops export_handle_ops = { + .hop_addref = export_handle_addref, + .hop_free = NULL, +}; + struct obd_export *class_export_get(struct obd_export *exp) { cfs_atomic_inc(&exp->exp_refcount); @@ -863,8 +868,8 @@ struct obd_export *class_new_export(struct obd_device *obd, CFS_INIT_LIST_HEAD(&export->exp_req_replay_queue); CFS_INIT_LIST_HEAD(&export->exp_handle.h_link); CFS_INIT_LIST_HEAD(&export->exp_hp_rpcs); - class_handle_hash(&export->exp_handle, export_handle_addref); - export->exp_last_request_time = cfs_time_current_sec(); + class_handle_hash(&export->exp_handle, &export_handle_ops); + export->exp_last_request_time = cfs_time_current_sec(); cfs_spin_lock_init(&export->exp_lock); cfs_spin_lock_init(&export->exp_rpc_lock); CFS_INIT_HLIST_NODE(&export->exp_uuid_hash); @@ -976,6 +981,11 @@ static void import_handle_addref(void *import) class_import_get(import); } +static struct portals_handle_ops import_handle_ops = { + .hop_addref = import_handle_addref, + .hop_free = NULL, +}; + struct obd_import *class_import_get(struct obd_import *import) { cfs_atomic_inc(&import->imp_refcount); @@ -1044,7 +1054,7 @@ struct obd_import *class_new_import(struct obd_device *obd) cfs_atomic_set(&imp->imp_inval_count, 0); CFS_INIT_LIST_HEAD(&imp->imp_conn_list); CFS_INIT_LIST_HEAD(&imp->imp_handle.h_link); - class_handle_hash(&imp->imp_handle, import_handle_addref); + class_handle_hash(&imp->imp_handle, &import_handle_ops); init_imp_at(&imp->imp_at); /* the default magic is V2, will be used in connect RPC, and