summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChuck Lever <chuck.lever@oracle.com>2010-06-22 12:51:42 -0400
committerSteve Dickson <steved@redhat.com>2010-06-22 16:04:53 -0400
commit22d6566d473f71e241c791a02435d414648c99e8 (patch)
tree80e0433dd106d63fe883fa1ffaced6b45060df3d
parent53928c0166dcc0acceaa995edb8551b48968b5dd (diff)
downloadnfs-utils-22d6566d473f71e241c791a02435d414648c99e8.tar.gz
nfs-utils-22d6566d473f71e241c791a02435d414648c99e8.tar.xz
nfs-utils-22d6566d473f71e241c791a02435d414648c99e8.zip
libexport.a: Add documenting comments
Clean up. Add a few additional documenting comments for globally visible functions. Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Steve Dickson <steved@redhat.com>
-rw-r--r--support/export/client.c25
-rw-r--r--support/export/export.c23
2 files changed, 39 insertions, 9 deletions
diff --git a/support/export/client.c b/support/export/client.c
index 9a0fc9d..dc01067 100644
--- a/support/export/client.c
+++ b/support/export/client.c
@@ -134,9 +134,13 @@ client_add(nfs_client *clp)
*cpp = clp;
}
-/* if canonical is set, then we *know* this is already a canonical name
- * so hostname lookup is avoided.
- * This is used when reading /proc/fs/nfs/exports
+/**
+ * client_lookup - look for @hname in our list of cached nfs_clients
+ * @hname: '\0'-terminated ASCII string containing hostname to look for
+ * @canonical: if set, @hname is known to be canonical DNS name
+ *
+ * Returns pointer to a matching or freshly created nfs_client. NULL
+ * is returned if some problem occurs.
*/
nfs_client *
client_lookup(char *hname, int canonical)
@@ -215,6 +219,10 @@ client_dup(const nfs_client *clp, const struct addrinfo *ai)
return new;
}
+/**
+ * client_release - drop a reference to an nfs_client record
+ *
+ */
void
client_release(nfs_client *clp)
{
@@ -223,6 +231,10 @@ client_release(nfs_client *clp)
clp->m_count--;
}
+/**
+ * client_freeall - deallocate all nfs_client records
+ *
+ */
void
client_freeall(void)
{
@@ -558,6 +570,13 @@ client_check(const nfs_client *clp, const struct addrinfo *ai)
return 0;
}
+/**
+ * client_gettype - determine type of nfs_client given an identifier
+ * @ident: '\0'-terminated ASCII string containing a client identifier
+ *
+ * Returns the type of nfs_client record that would be used for
+ * this client.
+ */
int
client_gettype(char *ident)
{
diff --git a/support/export/export.c b/support/export/export.c
index eca833c..f528603 100644
--- a/support/export/export.c
+++ b/support/export/export.c
@@ -81,8 +81,13 @@ export_read(char *fname)
endexportent();
}
-/*
- * Create an in-core export struct from an export entry.
+/**
+ * export_create - create an in-core nfs_export record from an export entry
+ * @xep: export entry to lookup
+ * @canonical: if set, e_hostname is known to be canonical DNS name
+ *
+ * Returns a freshly instantiated export record, or NULL if
+ * a problem occurred.
*/
nfs_export *
export_create(struct exportent *xep, int canonical)
@@ -260,11 +265,17 @@ export_allowed(const struct addrinfo *ai, const char *path)
return NULL;
}
-/*
- * Search hash table for export entry.
- */
+/**
+ * export_lookup - search hash table for export entry
+ * @hname: '\0'-terminated ASCII string containing client hostname to look for
+ * @path: '\0'-terminated ASCII string containing export path to look for
+ * @canonical: if set, @hname is known to be canonical DNS name
+ *
+ * Returns a pointer to nfs_export record matching @hname and @path,
+ * or NULL if the export was not found.
+ */
nfs_export *
-export_lookup(char *hname, char *path, int canonical)
+export_lookup(char *hname, char *path, int canonical)
{
nfs_client *clp;
nfs_export *exp;