From patchwork Thu Jan 2 20:28:26 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chuck Lever X-Patchwork-Id: 306273 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from userp1040.oracle.com (userp1040.oracle.com [156.151.31.81]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id EDD752C00A4 for ; Fri, 3 Jan 2014 07:28:38 +1100 (EST) Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by userp1040.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id s02KSZlY011684 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 2 Jan 2014 20:28:36 GMT Received: from oss.oracle.com (oss-external.oracle.com [137.254.96.51]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s02KSYSt014739 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 2 Jan 2014 20:28:35 GMT Received: from localhost ([127.0.0.1] helo=oss.oracle.com) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1Vyosc-0006mf-Th; Thu, 02 Jan 2014 12:28:34 -0800 Received: from acsinet22.oracle.com ([141.146.126.238]) by oss.oracle.com with esmtp (Exim 4.63) (envelope-from ) id 1VyosX-0006mH-Az for fedfs-utils-devel@oss.oracle.com; Thu, 02 Jan 2014 12:28:29 -0800 Received: from aserp1030.oracle.com (aserp1030.oracle.com [141.146.126.68]) by acsinet22.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s02KSSKe020280 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 2 Jan 2014 20:28:29 GMT Received: from mail-yh0-f43.google.com (mail-yh0-f43.google.com [209.85.213.43]) by aserp1030.oracle.com (Sentrion-MTA-4.3.1/Sentrion-MTA-4.3.1) with ESMTP id s02KSSta026552 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Thu, 2 Jan 2014 20:28:28 GMT Received: by mail-yh0-f43.google.com with SMTP id a41so2963915yho.30 for ; Thu, 02 Jan 2014 12:28:28 -0800 (PST) X-Received: by 10.236.83.238 with SMTP id q74mr59548120yhe.9.1388694508032; Thu, 02 Jan 2014 12:28:28 -0800 (PST) Received: from seurat.1015granger.net ([2604:8800:100:81fc:20c:29ff:fe44:ec31]) by mx.google.com with ESMTPSA id s6sm35179260yhp.15.2014.01.02.12.28.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 02 Jan 2014 12:28:27 -0800 (PST) To: fedfs-utils-devel@oss.oracle.com From: Chuck Lever Date: Thu, 02 Jan 2014 15:28:26 -0500 Message-ID: <20140102202826.2964.49420.stgit@seurat.1015granger.net> In-Reply-To: <20140102202359.2964.95143.stgit@seurat.1015granger.net> References: <20140102202359.2964.95143.stgit@seurat.1015granger.net> User-Agent: StGit/0.16 MIME-Version: 1.0 X-Flow-Control-Info: class=Pass-to-MM reputation=ipRisk-All ip=209.85.213.43 ct-class=R5 ct-vol1=-94 ct-vol2=7 ct-vol3=7 ct-risk=56 ct-spam1=92 ct-spam2=7 ct-bulk=2 rcpts=1 size=16861 X-Sendmail-CM-Score: 0.00% X-Sendmail-CM-Analysis: v=2.1 cv=YtI2GeoX c=1 sm=1 tr=0 a=zYMgIhnm3SFD2cZuKUfJjw==:117 a=dzsqy3y4QnMA:10 a=UPN3btnd4CMA:10 a=dPGociXpb70A:10 a=IkcTkHD0fZMA:10 a=xqWC_Br6kY4A:10 a=yPCof4ZbAAAA:8 a=Lb1rMZzfAAAA:8 a=1XWaLZrsAAAA:8 a=8hqhQK9QjScA:10 a=s6mHzk9upbi-n jfz6WEA:9 a=QEXdDO2ut3YA:10 a=7DSvI1NPTFQA:10 X-Sendmail-CT-Classification: not spam X-Sendmail-CT-RefID: str=0001.0A090205.52C5CBEC.00F5, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 Subject: [fedfs-utils] [PATCH 11/17] libnsdb: Remove *ldaperr argument from NSDB 5.2.2 API X-BeenThere: fedfs-utils-devel@oss.oracle.com X-Mailman-Version: 2.1.9 Precedence: list Reply-To: fedfs-utils Developers List-Id: fedfs-utils Developers List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: fedfs-utils-devel-bounces@oss.oracle.com Errors-To: fedfs-utils-devel-bounces@oss.oracle.com X-Source-IP: acsinet21.oracle.com [141.146.126.237] Simplify the FSN resolution API by removing the *ldaperr argument. When it is needed, the ldaperr value can be extracted with the new nsdb_ldaperr() function. Signed-off-by: Chuck Lever --- src/fedfsd/svc.c | 9 +++--- src/include/nsdb.h | 6 +--- src/libnsdb/fileserver.c | 62 ++++++++++++++++++------------------------ src/nfsref/lookup.c | 11 +++---- src/nsdbc/nsdb-list.c | 5 +-- src/nsdbc/nsdb-resolve-fsn.c | 13 ++++----- src/plug-ins/nfs-plugin.c | 11 +++---- 7 files changed, 50 insertions(+), 67 deletions(-) diff --git a/src/fedfsd/svc.c b/src/fedfsd/svc.c index e531f3f..c02daad 100644 --- a/src/fedfsd/svc.c +++ b/src/fedfsd/svc.c @@ -849,7 +849,6 @@ fedfsd_prepare_fedfsfsl_array(const struct fedfs_fsl *fsls, static void fedfsd_svc_lookup_junction_1(SVCXPRT *xprt) { - unsigned int ldap_err = 0; FedFsLookupRes result; FedFsLookupResOk *resok = &result.FedFsLookupRes_u.resok; FedFsLookupArgs args; @@ -922,11 +921,11 @@ again: if (result.status != FEDFS_OK) break; - result.status = nsdb_resolve_fsn_s(host, NULL, fsn_uuid, - &fsls, &ldap_err); + result.status = nsdb_resolve_fsn_s(host, NULL, fsn_uuid, &fsls); if (result.status == FEDFS_ERR_NSDB_LDAP_VAL) { - if (ldap_err != LDAP_REFERRAL) { - result.FedFsLookupRes_u.ldapResultCode = ldap_err; + if (nsdb_ldaperr(host) != LDAP_REFERRAL) { + result.FedFsLookupRes_u.ldapResultCode = + nsdb_ldaperr(host); nsdb_close_nsdb(host); break; } diff --git a/src/include/nsdb.h b/src/include/nsdb.h index 2aafcb5..ea765f7 100644 --- a/src/include/nsdb.h +++ b/src/include/nsdb.h @@ -387,11 +387,9 @@ FedFsStatus nsdb_find_naming_context_s(nsdb_t host, const char *entry, * Resolve an FSN (5.2.2) */ FedFsStatus nsdb_resolve_fsn_s(nsdb_t host, const char *nce, - const char *fsn_uuid, struct fedfs_fsl **fsls, - unsigned int *ldap_err); + const char *fsn_uuid, struct fedfs_fsl **fsls); FedFsStatus nsdb_get_fsn_s(nsdb_t host, const char *nce, - const char *fsn_uuid, struct fedfs_fsn **fsn, - unsigned int *ldap_err); + const char *fsn_uuid, struct fedfs_fsn **fsn); /** ** NSDB fileserver operations defined by this implementation diff --git a/src/libnsdb/fileserver.c b/src/libnsdb/fileserver.c index 222b47a..db443a6 100644 --- a/src/libnsdb/fileserver.c +++ b/src/libnsdb/fileserver.c @@ -1165,7 +1165,6 @@ nsdb_resolve_fsn_parse_entry(LDAP *ld, LDAPMessage *entry, * @param nce a NUL-terminated C string containing DN of NSDB container entry * @param fsn_uuid a NUL-terminated C string containing FSN UUID * @param fsls OUT: a list of fedfs_fsl structures - * @param ldap_err OUT: possibly an LDAP error code * @return a FedFsStatus code * * ldapsearch equivalent: @@ -1177,13 +1176,13 @@ nsdb_resolve_fsn_parse_entry(LDAP *ld, LDAPMessage *entry, */ static FedFsStatus nsdb_resolve_fsn_find_entry_s(nsdb_t host, const char *nce, const char *fsn_uuid, - struct fedfs_fsl **fsls, unsigned int *ldap_err) + struct fedfs_fsl **fsls) { LDAPMessage *response, *message; LDAP *ld = host->fn_ldap; struct fedfs_fsl *tmp; - int len, rc, entries; FedFsStatus retval; + int len, entries; char *filter; filter = malloc(128); @@ -1200,10 +1199,11 @@ nsdb_resolve_fsn_find_entry_s(nsdb_t host, const char *nce, const char *fsn_uuid return FEDFS_ERR_INVAL; } - rc = nsdb_search_nsdb_all_s(ld, nce, LDAP_SCOPE_SUBTREE, - filter, &response); + host->fn_ldaperr = nsdb_search_nsdb_all_s(ld, nce, + LDAP_SCOPE_SUBTREE, + filter, &response); free(filter); - switch (rc) { + switch (host->fn_ldaperr) { case LDAP_SUCCESS: case LDAP_REFERRAL: break; @@ -1213,8 +1213,7 @@ nsdb_resolve_fsn_find_entry_s(nsdb_t host, const char *nce, const char *fsn_uuid return FEDFS_ERR_NSDB_NOFSN; default: xlog(D_GENERAL, "%s: LDAP search failed: %s", - __func__, ldap_err2string(rc)); - *ldap_err = rc; + __func__, ldap_err2string(host->fn_ldaperr)); return FEDFS_ERR_NSDB_LDAP_VAL; } if (response == NULL) { @@ -1243,7 +1242,7 @@ nsdb_resolve_fsn_find_entry_s(nsdb_t host, const char *nce, const char *fsn_uuid case LDAP_RES_SEARCH_RESULT: retval = nsdb_parse_result(ld, message, &host->fn_referrals, - ldap_err); + &host->fn_ldaperr); break; default: xlog(L_ERROR, "%s: Unrecognized LDAP message type", @@ -1274,7 +1273,6 @@ nsdb_resolve_fsn_find_entry_s(nsdb_t host, const char *nce, const char *fsn_uuid * @param nce a NUL-terminated C string containing DN of NSDB container entry * @param fsn_uuid a NUL-terminated C string containing FSN UUID * @param fsls OUT: a list of fedfs_fsl structures - * @param ldap_err OUT: possibly an LDAP error code * @return a FedFsStatus code * * If caller did not provide an NCE, discover one by querying the NSDB. @@ -1283,7 +1281,7 @@ nsdb_resolve_fsn_find_entry_s(nsdb_t host, const char *nce, const char *fsn_uuid */ FedFsStatus nsdb_resolve_fsn_s(nsdb_t host, const char *nce, const char *fsn_uuid, - struct fedfs_fsl **fsls, unsigned int *ldap_err) + struct fedfs_fsl **fsls) { char **contexts, **nce_list; FedFsStatus retval; @@ -1299,24 +1297,22 @@ nsdb_resolve_fsn_s(nsdb_t host, const char *nce, const char *fsn_uuid, return FEDFS_ERR_INVAL; } - if (fsls == NULL || ldap_err == NULL) { + if (fsls == NULL) { xlog(L_ERROR, "%s: Invalid parameter", __func__); return FEDFS_ERR_INVAL; } if (nce != NULL) return nsdb_resolve_fsn_find_entry_s(host, nce, - fsn_uuid, fsls, ldap_err); + fsn_uuid, fsls); /* * Caller did not provide an nce. Generate a list * of the server's NSDB container entries. */ retval = nsdb_get_naming_contexts_s(host, &contexts); - if (retval != FEDFS_OK) { - *ldap_err = (unsigned int)nsdb_ldaperr(host); + if (retval != FEDFS_OK) return retval; - } for (i = 0; contexts[i] != NULL; i++); nce_list = calloc(i + 1, sizeof(char *)); @@ -1338,8 +1334,7 @@ nsdb_resolve_fsn_s(nsdb_t host, const char *nce, const char *fsn_uuid, for (j = 0; nce_list[j] != NULL; j++) { retval = nsdb_resolve_fsn_find_entry_s(host, nce_list[j], - fsn_uuid, fsls, - ldap_err); + fsn_uuid, fsls); if (retval == FEDFS_OK) break; } @@ -1488,7 +1483,6 @@ nsdb_get_fsn_parse_entry(LDAP *ld, LDAPMessage *entry, * @param nce a NUL-terminated C string containing DN of NSDB container entry * @param fsn_uuid a NUL-terminated C string containing FSN UUID * @param fsn OUT: a fedfs_fsn structures - * @param ldap_err OUT: possibly an LDAP error code * @return a FedFsStatus code * * Caller must free the returned "fsn" using nsdb_free_fedfs_fsn(). @@ -1502,13 +1496,13 @@ nsdb_get_fsn_parse_entry(LDAP *ld, LDAPMessage *entry, */ static FedFsStatus nsdb_get_fsn_find_entry_s(nsdb_t host, const char *nce, const char *fsn_uuid, - struct fedfs_fsn **fsn, unsigned int *ldap_err) + struct fedfs_fsn **fsn) { LDAPMessage *response, *message; LDAP *ld = host->fn_ldap; struct fedfs_fsn *tmp; - int len, rc, entries; FedFsStatus retval; + int len, entries; char *filter; filter = malloc(128); @@ -1525,9 +1519,10 @@ nsdb_get_fsn_find_entry_s(nsdb_t host, const char *nce, const char *fsn_uuid, return FEDFS_ERR_INVAL; } - rc = nsdb_search_nsdb_all_s(ld, nce, LDAP_SCOPE_ONE, filter, &response); + host->fn_ldaperr = nsdb_search_nsdb_all_s(ld, nce, LDAP_SCOPE_ONE, + filter, &response); free(filter); - switch (rc) { + switch (host->fn_ldaperr) { case LDAP_SUCCESS: case LDAP_REFERRAL: break; @@ -1537,8 +1532,7 @@ nsdb_get_fsn_find_entry_s(nsdb_t host, const char *nce, const char *fsn_uuid, return FEDFS_ERR_NSDB_NOFSN; default: xlog(D_GENERAL, "%s: LDAP search failed: %s", - __func__, ldap_err2string(rc)); - *ldap_err = rc; + __func__, ldap_err2string(host->fn_ldaperr)); return FEDFS_ERR_NSDB_LDAP_VAL; } if (response == NULL) { @@ -1566,7 +1560,7 @@ nsdb_get_fsn_find_entry_s(nsdb_t host, const char *nce, const char *fsn_uuid, case LDAP_RES_SEARCH_RESULT: retval = nsdb_parse_result(ld, message, &host->fn_referrals, - ldap_err); + &host->fn_ldaperr); break; default: xlog(L_ERROR, "%s: Unrecognized LDAP message type", @@ -1591,7 +1585,6 @@ nsdb_get_fsn_find_entry_s(nsdb_t host, const char *nce, const char *fsn_uuid, * @param nce a NUL-terminated C string containing DN of NSDB container entry * @param fsn_uuid a NUL-terminated C string containing FSN UUID * @param fsn OUT: a fedfs_fsn structures - * @param ldap_err OUT: possibly an LDAP error code * @return a FedFsStatus code * * If caller did not provide an NCE, discover one by querying the NSDB. @@ -1600,7 +1593,7 @@ nsdb_get_fsn_find_entry_s(nsdb_t host, const char *nce, const char *fsn_uuid, */ FedFsStatus nsdb_get_fsn_s(nsdb_t host, const char *nce, const char *fsn_uuid, - struct fedfs_fsn **fsn, unsigned int *ldap_err) + struct fedfs_fsn **fsn) { char **contexts, **nce_list; FedFsStatus retval; @@ -1616,24 +1609,21 @@ nsdb_get_fsn_s(nsdb_t host, const char *nce, const char *fsn_uuid, return FEDFS_ERR_INVAL; } - if (fsn == NULL || ldap_err == NULL) { + if (fsn == NULL) { xlog(L_ERROR, "%s: Invalid parameter", __func__); return FEDFS_ERR_INVAL; } if (nce != NULL) - return nsdb_get_fsn_find_entry_s(host, nce, fsn_uuid, - fsn, ldap_err); + return nsdb_get_fsn_find_entry_s(host, nce, fsn_uuid, fsn); /* * Caller did not provide an nce. Generate a list * of the server's NSDB container entries. */ retval = nsdb_get_naming_contexts_s(host, &contexts); - if (retval != FEDFS_OK) { - *ldap_err = (unsigned int)nsdb_ldaperr(host); + if (retval != FEDFS_OK) return retval; - } for (i = 0; contexts[i] != NULL; i++); nce_list = calloc(i + 1, sizeof(char *)); @@ -1654,8 +1644,8 @@ nsdb_get_fsn_s(nsdb_t host, const char *nce, const char *fsn_uuid, goto out; for (j = 0; nce_list[j] != NULL; j++) { - retval = nsdb_get_fsn_find_entry_s(host, nce_list[j], fsn_uuid, - fsn, ldap_err); + retval = nsdb_get_fsn_find_entry_s(host, nce_list[j], + fsn_uuid, fsn); if (retval == FEDFS_OK) break; } diff --git a/src/nfsref/lookup.c b/src/nfsref/lookup.c index 273663b..5f1442e 100644 --- a/src/nfsref/lookup.c +++ b/src/nfsref/lookup.c @@ -345,7 +345,6 @@ nfsref_lookup_resolve_fsn(const char *fsn_uuid, nsdb_t host) int status = EXIT_FAILURE; struct fedfs_fsl *fsls; struct fedfs_fsn *fsn; - unsigned int ldap_err; FedFsStatus retval; int fsn_ttl; @@ -378,7 +377,7 @@ again: } - retval = nsdb_get_fsn_s(host, NULL, fsn_uuid, &fsn, &ldap_err); + retval = nsdb_get_fsn_s(host, NULL, fsn_uuid, &fsn); switch (retval) { case FEDFS_OK: fsn_ttl = fsn->fn_fsnttl; @@ -390,7 +389,7 @@ again: goto out_close; case FEDFS_ERR_NSDB_LDAP_VAL: xlog(L_ERROR, "%s: NSDB operation failed with %s", - __func__, ldap_err2string(ldap_err)); + __func__, nsdb_ldaperr2string(host)); goto out_close; default: xlog(L_ERROR, "%s: Failed to retrieve FSN %s: %s", @@ -398,7 +397,7 @@ again: goto out_close; } - retval = nsdb_resolve_fsn_s(host, NULL, fsn_uuid, &fsls, &ldap_err); + retval = nsdb_resolve_fsn_s(host, NULL, fsn_uuid, &fsls); switch (retval) { case FEDFS_OK: printf("fedfsFsnUuid:\t%s\n", fsn_uuid); @@ -419,7 +418,7 @@ again: __func__, fsn_uuid); break; case FEDFS_ERR_NSDB_LDAP_VAL: - switch (ldap_err) { + switch (nsdb_ldaperr(host)) { case LDAP_REFERRAL: retval = nfsref_lookup_follow_ldap_referral(&host); if (retval == FEDFS_OK) @@ -431,7 +430,7 @@ again: break; default: xlog(L_ERROR, "%s: NSDB operation failed with %s", - __func__, ldap_err2string(ldap_err)); + __func__, nsdb_ldaperr2string(host)); } break; default: diff --git a/src/nsdbc/nsdb-list.c b/src/nsdbc/nsdb-list.c index 43f3410..a24d133 100644 --- a/src/nsdbc/nsdb-list.c +++ b/src/nsdbc/nsdb-list.c @@ -114,12 +114,11 @@ static void nsdb_list_resolve_and_display_fsn(nsdb_t host, const char *nce, const char *fsn_uuid) { struct fedfs_fsl *fsls; - unsigned int ldap_err; FedFsStatus retval; printf(" FSN UUID: %s\n", fsn_uuid); - retval = nsdb_resolve_fsn_s(host, nce, fsn_uuid, &fsls, &ldap_err); + retval = nsdb_resolve_fsn_s(host, nce, fsn_uuid, &fsls); switch (retval) { case FEDFS_OK: nsdb_list_display_fsls(fsls); @@ -130,7 +129,7 @@ nsdb_list_resolve_and_display_fsn(nsdb_t host, const char *nce, const char *fsn_ break; case FEDFS_ERR_NSDB_LDAP_VAL: fprintf(stderr, "NSDB LDAP error: %s\n", - ldap_err2string(ldap_err)); + nsdb_ldaperr2string(host)); break; default: fprintf(stderr, "Failed to resolve FSN UUID %s: %s\n", diff --git a/src/nsdbc/nsdb-resolve-fsn.c b/src/nsdbc/nsdb-resolve-fsn.c index 6baac28..ed8549d 100644 --- a/src/nsdbc/nsdb-resolve-fsn.c +++ b/src/nsdbc/nsdb-resolve-fsn.c @@ -250,7 +250,6 @@ main(int argc, char **argv) unsigned short nsdbport; struct fedfs_fsl *fsls; struct fedfs_fsn *fsn; - unsigned int ldap_err; char *nce, *fsn_uuid; FedFsStatus retval; int fsn_ttl, arg; @@ -358,7 +357,7 @@ again: goto out_free; } - retval = nsdb_get_fsn_s(host, nce, fsn_uuid, &fsn, &ldap_err); + retval = nsdb_get_fsn_s(host, nce, fsn_uuid, &fsn); switch (retval) { case FEDFS_OK: fsn_ttl = fsn->fn_fsnttl; @@ -375,7 +374,7 @@ again: fprintf(stderr, "Failed to find FSN %s\n", fsn_uuid); goto out_close; case FEDFS_ERR_NSDB_LDAP_VAL: - switch (ldap_err) { + switch (nsdb_ldaperr(host)) { case LDAP_REFERRAL: retval = nsdb_resolve_fsn_follow_ldap_referral(&host); if (retval == FEDFS_OK) @@ -387,7 +386,7 @@ again: break; default: fprintf(stderr, "NSDB LDAP error: %s\n", - ldap_err2string(ldap_err)); + nsdb_ldaperr2string(host)); } goto out_close; default: @@ -397,7 +396,7 @@ again: goto out_close; } - retval = nsdb_resolve_fsn_s(host, nce, fsn_uuid, &fsls, &ldap_err); + retval = nsdb_resolve_fsn_s(host, nce, fsn_uuid, &fsls); switch (retval) { case FEDFS_OK: printf("For FSN UUID: %s\n", fsn_uuid); @@ -421,14 +420,14 @@ again: fprintf(stderr, "Failed to find FSN %s\n", fsn_uuid); break; case FEDFS_ERR_NSDB_LDAP_VAL: - if (ldap_err == LDAP_REFERRAL) { + if (nsdb_ldaperr(host) == LDAP_REFERRAL) { retval = nsdb_resolve_fsn_follow_ldap_referral(&host); if (retval != FEDFS_OK) break; goto again; } fprintf(stderr, "NSDB LDAP error: %s\n", - ldap_err2string(ldap_err)); + nsdb_ldaperr2string(host)); break; default: fprintf(stderr, "FedFsStatus code " diff --git a/src/plug-ins/nfs-plugin.c b/src/plug-ins/nfs-plugin.c index 25e97e2..f214c09 100644 --- a/src/plug-ins/nfs-plugin.c +++ b/src/plug-ins/nfs-plugin.c @@ -390,7 +390,6 @@ nfs_jp_resolve_fsn(const char *fsn_uuid, nsdb_t host, enum jp_status status = JP_NSDBREMOTE; struct fedfs_fsl *fsls; struct fedfs_fsn *fsn; - unsigned int ldap_err; FedFsStatus retval; int fsn_ttl; @@ -419,7 +418,7 @@ again: return JP_NSDBLOCAL; } - retval = nsdb_get_fsn_s(host, NULL, fsn_uuid, &fsn, &ldap_err); + retval = nsdb_get_fsn_s(host, NULL, fsn_uuid, &fsn); switch (retval) { case FEDFS_OK: fsn_ttl = fsn->fn_fsnttl; @@ -434,7 +433,7 @@ again: __func__, fsn_uuid); goto out_close; case FEDFS_ERR_NSDB_LDAP_VAL: - switch (ldap_err) { + switch (nsdb_ldaperr(host)) { case LDAP_REFERRAL: retval = nfs_jp_follow_ldap_referral(&host); if (retval == FEDFS_OK) @@ -446,7 +445,7 @@ again: break; default: nfs_jp_debug("%s: NSDB operation failed with %s\n", - __func__, ldap_err2string(ldap_err)); + __func__, nsdb_ldaperr2string(host)); } goto out_close; default: @@ -455,7 +454,7 @@ again: goto out_close; } - retval = nsdb_resolve_fsn_s(host, NULL, fsn_uuid, &fsls, &ldap_err); + retval = nsdb_resolve_fsn_s(host, NULL, fsn_uuid, &fsls); switch (retval) { case FEDFS_OK: status = nfs_jp_convert_fedfs_fsls(fsls, new); @@ -475,7 +474,7 @@ again: break; case FEDFS_ERR_NSDB_LDAP_VAL: nfs_jp_debug("%s: NSDB operation failed with %s\n", - __func__, ldap_err2string(ldap_err)); + __func__, nsdb_ldaperr2string(host)); break; default: nfs_jp_debug("%s: Failed to resolve FSN %s: %s\n",