X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Fobdclass%2Flustre_peer.c;h=8298fc32d5f83cd7e23dbff1ae660b4774fe4072;hp=1e227e12b5bcb801586fe6e949cba60d7315a81e;hb=944a01f5d1adb1ab5f7721d5c2d1cafcd3b2c915;hpb=d79fc607ddc94e1b5bfcee6c0ebe4ad6045f2823;ds=sidebyside diff --git a/lustre/obdclass/lustre_peer.c b/lustre/obdclass/lustre_peer.c index 1e227e1..8298fc3 100644 --- a/lustre/obdclass/lustre_peer.c +++ b/lustre/obdclass/lustre_peer.c @@ -42,7 +42,6 @@ struct uuid_nid_data { ptl_nid_t nid; char *uuid; __u32 nal; - ptl_handle_ni_t ni; }; /* FIXME: This should probably become more elegant than a global linked list */ @@ -61,8 +60,7 @@ void class_exit_uuidlist(void) class_del_uuid(NULL); } -int lustre_uuid_to_peer(char *uuid, - ptl_handle_ni_t *peer_ni, ptl_nid_t *peer_nid) +int lustre_uuid_to_peer(char *uuid, __u32 *peer_nal, ptl_nid_t *peer_nid) { struct list_head *tmp; @@ -74,7 +72,7 @@ int lustre_uuid_to_peer(char *uuid, if (strcmp(data->uuid, uuid) == 0) { *peer_nid = data->nid; - *peer_ni = data->ni; + *peer_nal = data->nal; spin_unlock (&g_uuid_lock); return 0; @@ -87,7 +85,6 @@ int lustre_uuid_to_peer(char *uuid, int class_add_uuid(char *uuid, __u64 nid, __u32 nal) { - const ptl_handle_ni_t *nip; struct uuid_nid_data *data; int rc; int nob = strnlen (uuid, PAGE_SIZE) + 1; @@ -95,26 +92,21 @@ int class_add_uuid(char *uuid, __u64 nid, __u32 nal) if (nob > PAGE_SIZE) return -EINVAL; - nip = kportal_get_ni (nal); - if (nip == NULL) { - CERROR("get_ni failed: is the NAL module loaded?\n"); - return -EIO; - } - rc = -ENOMEM; OBD_ALLOC(data, sizeof(*data)); if (data == NULL) - goto fail_0; + return -ENOMEM; OBD_ALLOC(data->uuid, nob); - if (data == NULL) - goto fail_1; + if (data == NULL) { + OBD_FREE(data, sizeof(*data)); + return -ENOMEM; + } CDEBUG(D_INFO, "add uuid %s "LPX64" %u\n", uuid, nid, nal); memcpy(data->uuid, uuid, nob); data->nid = nid; data->nal = nal; - data->ni = *nip; spin_lock (&g_uuid_lock); @@ -123,12 +115,6 @@ int class_add_uuid(char *uuid, __u64 nid, __u32 nal) spin_unlock (&g_uuid_lock); return 0; - - fail_1: - OBD_FREE (data, sizeof (*data)); - fail_0: - kportal_put_ni (nal); - return (rc); } /* delete only one entry if uuid is specified, otherwise delete all */ @@ -164,7 +150,6 @@ int class_del_uuid (char *uuid) list_del (&data->head); - kportal_put_ni (data->nal); OBD_FREE(data->uuid, strlen(data->uuid) + 1); OBD_FREE(data, sizeof(*data)); } while (!list_empty (&deathrow));