/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright (c) 1999 by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Code to maintain the runtime and on-disk filehandle mapping table for
* nfslog.
*/
#include <assert.h>
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include <strings.h>
#include <syslog.h>
#include <libintl.h>
#include <unistd.h>
#include "fhtab.h"
#include "nfslogd.h"
} \
/*
* export handle cache
*/
struct export_handle_cache {
char *name;
};
extern bool_t nfsl_prin_fh;
static char *get_export_path(fhandle_t *, char *);
int *errorp);
char **pathp);
static struct nfsl_fh_proc_disp *nfslog_find_fh_dispatch(
/*
* NFS VERSION 2
*/
/*
* Functions for updating the fhtable for fhtoppath and for returning
* the absolute pathname
*/
static void nfslog_GETATTR2_fhargs(fhandle_t *,
char *, char **, char **);
char *, char **, char **);
char *, char **, char **);
char *, char **, char **);
char *, char **, char **);
char *, char **, char **);
char *, char **, char **);
char *, char **, char **);
char *, char **, char **);
char *, char **, char **);
char *, char **, char **);
char *, char **, char **);
/*
* NFS VERSION 3
*
* Functions for updating the fhtable for fhtoppath
*/
char *, char **, char **);
char *, char **, char **);
char *, char **, char **);
char *, char **, char **);
char *, char **, char **);
char *, char **, char **);
char *, char **, char **);
char *, char **, char **);
char *, char **, char **);
char *, char **, char **);
char *, char **, char **);
char *, char **, char **);
char *, char **, char **);
char *, char **, char **);
char *, char **, char **);
char *, char **, char **);
static void nfslog_READDIRPLUS3_fhargs(nfslog_READDIRPLUS3args *,
char *, char **, char **);
char *, char **, char **);
char *, char **, char **);
char *, char **, char **);
char *, char **, char **);
/*
* NFSLOG VERSION 1
*
* Functions for updating the fhtable for fhtoppath
*/
char *, char **, char **);
char *, char **, char **);
char *, char **, char **);
/*
*
* In some cases, the nl types are the same as the nfs types and a simple
* bcopy should suffice. Rather that define tens of identical procedures,
* simply define these to bcopy. Similarly this takes care of different
* procs that use same parameter struct.
*/
/*
* NFS VERSION 2
*/
/* RFS_NULL = 0 */
/* RFS_GETATTR = 1 */
/* RFS_SETATTR = 2 */
sizeof (nfslog_setattrargs), sizeof (nfsstat)},
/* RFS_ROOT = 3 *** NO LONGER SUPPORTED *** */
/* RFS_LOOKUP = 4 */
sizeof (nfslog_diropargs), sizeof (nfslog_diropres)},
/* RFS_READLINK = 5 */
sizeof (fhandle_t), sizeof (nfslog_rdlnres)},
/* RFS_READ = 6 */
sizeof (nfslog_nfsreadargs), sizeof (nfslog_rdresult)},
/* RFS_WRITECACHE = 7 *** NO LONGER SUPPORTED *** */
/* RFS_WRITE = 8 */
sizeof (nfslog_writeargs), sizeof (nfslog_writeresult)},
/* RFS_CREATE = 9 */
sizeof (nfslog_createargs), sizeof (nfslog_diropres)},
/* RFS_REMOVE = 10 */
sizeof (nfslog_diropargs), sizeof (nfsstat)},
/* RFS_RENAME = 11 */
sizeof (nfslog_rnmargs), sizeof (nfsstat)},
/* RFS_LINK = 12 */
sizeof (nfslog_linkargs), sizeof (nfsstat)},
/* RFS_SYMLINK = 13 */
sizeof (nfslog_symlinkargs), sizeof (nfsstat)},
/* RFS_MKDIR = 14 */
sizeof (nfslog_createargs), sizeof (nfslog_diropres)},
/* RFS_RMDIR = 15 */
sizeof (nfslog_diropargs), sizeof (nfsstat)},
/* RFS_READDIR = 16 */
sizeof (nfslog_rddirargs), sizeof (nfslog_rddirres)},
/* RFS_STATFS = 17 */
};
/*
* NFS VERSION 3
*/
/* RFS_NULL = 0 */
/* RFS3_GETATTR = 1 */
/* RFS3_SETATTR = 2 */
sizeof (nfslog_SETATTR3args), sizeof (nfsstat3)},
/* RFS3_LOOKUP = 3 */
sizeof (nfslog_diropargs3), sizeof (nfslog_LOOKUP3res)},
/* RFS3_ACCESS = 4 */
/* RFS3_READLINK = 5 */
sizeof (nfs_fh3), sizeof (nfslog_READLINK3res)},
/* RFS3_READ = 6 */
sizeof (nfslog_READ3args), sizeof (nfslog_READ3res)},
/* RFS3_WRITE = 7 */
sizeof (nfslog_WRITE3args), sizeof (nfslog_WRITE3res)},
/* RFS3_CREATE = 8 */
sizeof (nfslog_CREATE3args), sizeof (nfslog_CREATE3res)},
/* RFS3_MKDIR = 9 */
sizeof (nfslog_MKDIR3args), sizeof (nfslog_MKDIR3res)},
/* RFS3_SYMLINK = 10 */
sizeof (nfslog_SYMLINK3args), sizeof (nfslog_SYMLINK3res)},
/* RFS3_MKNOD = 11 */
sizeof (nfslog_MKNOD3args), sizeof (nfslog_MKNOD3res)},
/* RFS3_REMOVE = 12 */
sizeof (nfslog_REMOVE3args), sizeof (nfsstat3)},
/* RFS3_RMDIR = 13 */
sizeof (nfslog_RMDIR3args), sizeof (nfsstat3)},
/* RFS3_RENAME = 14 */
sizeof (nfslog_RENAME3args), sizeof (nfsstat3)},
/* RFS3_LINK = 15 */
sizeof (nfslog_LINK3args), sizeof (nfsstat3)},
/* RFS3_READDIR = 16 */
/* RFS3_READDIRPLUS = 17 */
sizeof (nfslog_READDIRPLUS3args),
sizeof (nfslog_READDIRPLUS3res)},
/* RFS3_FSSTAT = 18 */
/* RFS3_FSINFO = 19 */
/* RFS3_PATHCONF = 20 */
/* RFS3_COMMIT = 21 */
sizeof (nfslog_COMMIT3args), sizeof (nfsstat3)},
};
/*
* NFSLOG VERSION 1
*/
/* NFSLOG_NULL = 0 */
/* NFSLOG_SHARE = 1 */
sizeof (nfslog_sharefsargs), sizeof (nfslog_sharefsres)},
/* NFSLOG_UNSHARE = 2 */
sizeof (nfslog_sharefsargs), sizeof (nfslog_sharefsres)},
/* NFSLOG_LOOKUP3 = 3 */
sizeof (nfslog_diropargs3), sizeof (nfslog_LOOKUP3res)},
/* NFSLOG_GETFH = 4 */
sizeof (nfslog_getfhargs), sizeof (nfsstat)},
};
{sizeof (nfsl_fh_proc_v2) / sizeof (nfsl_fh_proc_v2[0]),
{sizeof (nfsl_fh_proc_v3) / sizeof (nfsl_fh_proc_v3[0]),
};
{sizeof (nfsl_log_fh_proc_v1) / sizeof (nfsl_log_fh_proc_v1[0]),
};
sizeof (nfsl_fh_vers_disptable) /
sizeof (nfsl_fh_vers_disptable[0]),
sizeof (nfsl_log_fh_vers_disptable) /
sizeof (nfsl_log_fh_vers_disptable[0]),
};
static int nfsl_fh_dispatch_table_arglen =
sizeof (nfsl_fh_dispatch_table) /
sizeof (nfsl_fh_dispatch_table[0]);
extern int debug;
/*
* print the fid into the given string as a series of hex digits.
* XXX Ideally, we'd like to just convert the filehandle into an i-number,
* but the fid encoding is a little tricky (see nfs_fhtovp() and
* ufs_vget()) and may be private to UFS.
*/
static void
{
int i;
/*
* If the filehandle somehow got corrupted, only print the part
* that makes sense.
*/
else
for (i = 0; i < fhlen; i++) {
}
}
static void
{
return;
(void) printf("\nBegin all database keys\n");
(void) printf("\nEnd all database keys\n");
}
/*
* Add the filehandle "fh", which has the name "name" and lives in
* directory "dfh", to the table "fhlist". "fhlist" will be updated if the
* entry is added to the front of the list.
* Return 0 for success, error code otherwise.
*/
static int
{
int error;
if (IS_DOT_FILENAME(name)) {
/* we don't insert these to the database but not an error */
if (debug > 3) {
" - no dot files")
}
return (0);
}
flags |= EXPORT_POINT;
}
/* Add to database */
if (debug > 1) {
if (error != 0) {
(void) printf("db_add error %s:\n",
} else if (debug > 2) {
}
}
return (error);
}
/*
* fh_compare returns 0 if the file handles match, error code otherwise
*/
static int
{
return (errno);
else
return (0);
}
/*
* Try to find the filehandle "fh" in the table. Returns 0 and the
* corresponding table entry if found, error otherwise.
* If successfull and fhrecpp is non-null then *fhrecpp points to the
* returned record. If *fhrecpp was initially null, that record had
* been malloc'd and must be freed by caller.
*/
static fhlist_ent *
{
if (debug > 3) {
(void) printf("fh_lookup: fh ");
(void) printf("\n");
}
}
/*
* Remove the mc link if exists when removing a regular link.
* Return 0 for success, error code otherwise.
*/
static int
{
int error;
/* Delete the multi-component path if exists */
} else {
}
return (error);
}
/*
* Remove the link entry from the fh table.
* Return 0 for success, error code otherwise.
*/
static int
{
/*
* disconnect element from list
*
* Remove the link entry for the file. Remove fh entry if last link.
*/
if (IS_DOT_FILENAME(name)) {
/* we don't insert these to the database but not an error */
if (debug > 2) {
" - no dot files")
}
return (0);
}
if (debug > 2) {
}
/* Delete the multi-component path if exists */
}
/*
* fh_rename - renames a link in the database (adds the new one if from link
* did not exist).
* Return 0 for success, error code otherwise.
*/
static int
{
if (debug > 2) {
from_name, "")
to_name, "")
}
/*
* if any of these are dot files (should not happen), the rename
* becomes a "delete" or "add" operation because the dot files
* don't get in the database
*/
if (IS_DOT_FILENAME(to_name)) {
/* it is just a delete op */
if (debug > 2) {
(void) printf("to: no dot files\nDelete from: '%s'\n",
}
} else if (IS_DOT_FILENAME(from_name)) {
/* we don't insert these to the database */
if (debug > 2) {
(void) printf("rename - from: no dot files\n");
}
/* can't insert the target, because don't have a handle */
return (EINVAL);
}
/* Delete the multi-component path if exists */
}
/*
* fh_lookup_link - search the fhtable for the link defined by (dfh,name,fh).
* Return 0 and set *fhrecpp to the fhlist item corresponding to it if found,
* or error if not found.
* Possible configurations:
* 1. dfh, fh, name are all non-null: Only exact match accepted.
* 2. dfh,name non-null, fh null: return first match found.
* 3. fh,name non-null, dfh null: return first match found.
* 3. fh non-null, dfh, name null: return first match found.
* If successfull and fhrecpp is non-null then *fhrecpp points to the
* returned record. If *fhrecpp was initially null, that record had
* been malloc'd and must be freed by caller.
*/
static fhlist_ent *
{
/* we don't insert these to the database but not an error */
if (debug > 2) {
" - no dot files\n")
}
*errorp = 0;
return (NULL);
}
if (debug > 3) {
}
/* Add to database */
if (debug > 3)
(void) printf("fh_lookup_link: fh not found\n");
return (NULL);
}
/* Check if name and dfh match, if not search link */
/* found it */
goto exit;
}
/* Found the primary record, but it's a different link */
name, "")
}
if (debug > 2) {
}
/* can now free the record unless it was supplied by caller */
}
}
/* If here, we must search by link */
if (debug > 2)
(void) printf("fh_lookup_link: invalid params\n");
return (NULL);
}
if (debug > 3)
(void) printf("fh_lookup_link: link not found: %s\n",
return (NULL);
}
/* If all args supplied, check if an exact match */
if (debug > 2) {
name, "")
}
return (NULL);
}
exit:
if (debug > 3)
*errorp = 0;
return (fhrecp);
}
/*
* Export handle cache is maintained if we see an export handle that either
* cannot have the path for it determined, or we failed store it.
* Usually the path of an export handle can be identified in the NFSLOGTAB
* and since every path for that filesystem will be affected, it's worth
* caching the ones we had problem identifying.
*/
/*
* find_fh_in_export_cache - given an export fh, find it in the cache and
* return the handle
*/
static struct export_handle_cache *
{
struct export_handle_cache *p;
break;
}
return (p);
}
static void
{
"add_fh_to_export_cache: alloc new for '%s' Error %s\n"),
return;
}
"add_fh_to_export_cache: alloc '%s'"
return;
}
} else {
}
}
/*
* update_export_point - called when the path for fh cannot be determined.
* In the past it called get_export_path() to get the name of the
* export point given a filehandle. This was a hack, since there's no
* reason why the filehandle should be lost.
*
* If a match is found, insert the path to the database.
* Return the inserted fhrecp is found,
* and NULL if not. If it is an exported fs but not in the list, log a
* error.
* If input fhrecp is non-null, it is a valid address for result,
* otherwise malloc it.
*/
static char *
{
struct export_handle_cache *p;
/* either null fh or not the root of a shared directory */
return (NULL);
}
/* Did we already see (and fail) this one? */
/* Found it! */
if (debug > 2) {
}
return (NULL);
/*
* We should not normally be here - only add to cache if
* fh_add failed.
*/
"update_export_point: malloc '%s' Error %s"),
return (NULL);
}
return (path);
}
return (NULL);
}
/* Found it! */
if (debug > 2) {
}
/* cache this handle so we don't repeat the search */
}
return (path);
}
/*
* HACK!!! To get rid of get_export_path() use
*/
/* ARGSUSED */
static char *
{
return (NULL);
}
/*
* Return the absolute pathname for the filehandle "fh", using the mapping
* table "fhlist". The caller must free the return string.
* name is an optional dir component name, to be appended at the end
* (if name is non-null, the function assumes the fh is the parent directory)
*
* Note: The original code was recursive, which was much more elegant but
* ran out of stack...
*/
static char *
{
int namelen;
if (debug > 3)
(void) printf("fh_print_absolute: input name '%s'\n",
/* If name starts with '/' we are done */
"fh_print_absolute: strdup '%s' error %s\n"),
}
return (str);
}
parent[0] = '\0';
/* remember the last filehandle we've seen */
/* dump all names in reverse order */
if (debug > 3) {
(void) printf("fh_print_absolute: name '%s'%s\n",
}
/* dfh == prevfh but not an export point */
if (debug > 1) {
(void) printf(
"fh_print_absolute: fhrec loop:\n");
}
break;
}
/* remember the last filehandle we've seen */
}
} else {
/* Check if export point, just in case... */
/* There should be enough room in parent, leave the '\0' */
}
/* Now need to reverse the order */
} else {
}
"fh_print_absolute: malloc %d error %s\n"),
return (NULL);
}
/* first put the export point path in */
} else {
}
for (j = i; (j >= 0) && (parent[j] != '/'); j--);
if (j < 0)
break;
parent[j] = '\0';
}
str[k] = '/';
}
if (debug > 3)
return (str);
}
/*
* nfslog_find_fh_dispatch - get the dispatch struct for this request
*/
static struct nfsl_fh_proc_disp *
{
int i, vers;
/* Find prog element - search because can't use prog as array index */
for (i = 0; (i < nfsl_fh_dispatch_table_arglen) &&
i++);
if (i >= nfsl_fh_dispatch_table_arglen) { /* program not logged */
/* not an error */
return (NULL);
}
progtable = &nfsl_fh_dispatch_table[i];
/* Find vers element - no validity check - if here it's valid vers */
/* Find proc element - no validity check - if here it's valid proc */
}
/* ARGSUSED */
static void
{
}
/*
* nfslog_LOOKUP_calc - called by both lookup3 and lookup2. Handles the
* mclookup as well as normal lookups.
*/
/* ARGSUSED */
static void
{
int error;
/* a fake lookup to inform us of the public fs path */
"%s: Add Public fs '%s' failed: %s\n"),
}
}
return;
}
}
/* If public fh mclookup, then insert complete path */
} else {
}
}
/* link already in table */
return;
}
/* A new link so add it */
"%s: Add fh for '%s' failed: %s\n"), str,
}
}
/*
* NFS VERSION 2
*/
/* Functions for updating the fhtable for fhtoppath */
/*
* nfslog_GETATTR2_fhargs - updates path1 but no fhtable changes
*/
/* ARGSUSED */
static void
{
if (debug > 2) {
(void) printf("=============\nGETATTR2: fh ");
(void) printf("\n");
}
}
}
/*
* nfslog_SETATTR2_fhargs - updates path1 but no fhtable changes
*/
/* ARGSUSED */
static void
{
if (debug > 2) {
(void) printf("=============\nSETATTR2: fh ");
(void) printf("\n");
}
}
}
/*
* nfslog_LOOKUP2_fhargs - search the table to ensure we have not added this
* one already. Note that if the response status was anything but okay,
* there is no fh to check...
*/
/* ARGSUSED */
static void
{
char *name;
if (debug > 2) {
else
}
/* special mclookup */
}
}
return;
}
}
/*
* nfslog_READLINK2_fhargs - updates path1 but no fhtable changes
*/
/* ARGSUSED */
static void
{
if (debug > 2) {
(void) printf("=============\nREADLINK2: fh ");
(void) printf("\n");
}
}
}
/*
* nfslog_READ2_fhargs - updates path1 but no fhtable changes
*/
/* ARGSUSED */
static void
{
if (debug > 2) {
(void) printf("=============\nREAD2: fh ");
sizeof (args->ra_fhandle));
(void) printf("\n");
}
}
}
/*
* nfslog_WRITE2_fhargs - updates path1 but no fhtable changes
*/
/* ARGSUSED */
static void
{
if (debug > 2) {
(void) printf("=============\nWRITE2: fh ");
sizeof (args->waargs_fhandle));
(void) printf("\n");
}
}
}
/*
* nfslog_CREATE2_fhargs - if the operation succeeded, we are sure there can
* be no such link in the fhtable, so just add it.
*/
/* ARGSUSED */
static void
{
char *name;
int error;
if (debug > 2) {
else
}
}
/* no returned fh so nothing to add */
return;
/* A new file handle so add it */
"Create2: Add fh for '%s' failed: %s\n"),
}
}
/*
* nfslog_REMOVE2_fhargs - if the operation succeeded, remove the link from
* the fhtable.
*/
/* ARGSUSED */
static void
{
char *name;
int error;
if (debug > 2) {
}
}
/* remove failed so nothing to update */
return;
}
}
/*
* nfsl_RENAME2_fhargs - updates the dfh and name fields for the given fh
* to change them to the new name.
*/
/* ARGSUSED */
static void
{
int error;
if (debug > 2) {
to_name, "")
}
"rename2 from");
"rename2 to");
}
/* rename failed so nothing to update */
return;
/* Rename the link in the database */
"Rename2: Update from '%s' to '%s' failed: %s\n"),
}
}
/*
* nfslog_LINK2_fhargs - adds link name and fh to fhlist. Note that as a
* result we may have more than one name for an fh.
*/
/* ARGSUSED */
static void
{
char *name;
int error;
if (debug > 2) {
}
}
/* no returned fh so nothing to add */
return;
/* A new link so add it, have fh_add find the link count */
"Link2: Add fh for '%s' failed: %s\n"),
}
}
/*
* nfslog_SYMLINK2_fhargs - adds symlink name and fh to fhlist if fh returned.
*/
/* ARGSUSED */
static void
{
char *name;
if (debug > 2) {
}
}
}
/*
* nfslog_READDIR2_fhargs - updates path1 but no fhtable changes
*/
/* ARGSUSED */
static void
{
if (debug > 2) {
(void) printf("=============\nREADDIR2: fh ");
(void) printf("\n");
}
}
}
/*
* nfslog_STATFS2_fhargs - updates path1 but no fhtable changes
*/
/* ARGSUSED */
static void
{
if (debug > 2) {
(void) printf("=============\nSTATFS2: fh ");
(void) printf("\n");
}
}
}
/*
* NFS VERSION 3
*/
/* Functions for updating the fhtable for fhtoppath */
/*
* nfslog_GETATTR3_fhargs - updates path1 but no fhtable changes
*/
/* ARGSUSED */
static void
{
if (debug > 2) {
(void) printf("=============\nGETATTR3: fh ");
(void) printf("\n");
}
fhpath, "getattr3");
}
}
/*
* nfslog_SETATTR3_fhargs - updates path1 but no fhtable changes
*/
/* ARGSUSED */
static void
{
if (debug > 2) {
(void) printf("=============\nSETATTR3: fh ");
(void) printf("\n");
}
}
}
/*
* nfslog_LOOKUP3_fhargs - search the table to ensure we have not added this
* one already. Note that if the response status was anything but okay,
* there is no fh to check...
*/
/* ARGSUSED */
static void
{
char *name;
if (debug > 2) {
else
}
/* special mclookup */
}
}
return;
}
}
/*
* nfslog_ACCESS3_fhargs - updates path1 but no fhtable changes
*/
/* ARGSUSED */
static void
{
if (debug > 2) {
(void) printf("=============\nACCESS3: fh ");
sizeof (*args));
(void) printf("\n");
}
}
}
/*
* nfslog_READLINK3_fhargs - updates path1 but no fhtable changes
*/
/* ARGSUSED */
static void
{
if (debug > 2) {
(void) printf("=============\nREADLINK3: fh ");
(void) printf("\n");
}
fhpath, "readlink3");
}
}
/*
* nfslog_READ3_fhargs - updates path1 but no fhtable changes
*/
/* ARGSUSED */
static void
{
if (debug > 2) {
(void) printf("=============\nREAD3: fh ");
(void) printf("\n");
}
}
}
/*
* nfslog_WRITE3_fhargs - updates path1 but no fhtable changes
*/
/* ARGSUSED */
static void
{
if (debug > 2) {
(void) printf("=============\nWRITE3: fh ");
(void) printf("\n");
}
}
}
/*
* nfslog_CREATE3_fhargs - if the operation succeeded, we are sure there can
* be no such link in the fhtable, so just add it.
*/
/* ARGSUSED */
static void
{
char *name;
int error;
if (debug > 2) {
else
}
}
/* no returned fh so nothing to add */
return;
/* A new file handle so add it */
"Create3: Add fh for '%s' failed: %s\n"),
}
}
/*
* nfslog_MKDIR3_fhargs - if the operation succeeded, we are sure there can
* be no such link in the fhtable, so just add it.
*/
/* ARGSUSED */
static void
{
char *name;
int error;
if (debug > 2) {
else
}
}
/* no returned fh so nothing to add */
return;
/* A new file handle so add it */
"Mkdir3: Add fh for '%s' failed: %s\n"),
}
}
/*
* nfslog_REMOVE3_fhargs - if the operation succeeded, remove the link from
* the fhtable.
*/
/* ARGSUSED */
static void
{
char *name;
int error;
if (debug > 2) {
}
}
/* remove failed so nothing to update */
return;
}
}
/*
* nfslog_RMDIR3_fhargs - if the operation succeeded, remove the link from
* the fhtable.
*/
/* ARGSUSED */
static void
{
char *name;
int error;
if (debug > 2) {
}
}
/* rmdir failed so nothing to update */
return;
}
}
/*
* nfslog_RENAME3_fhargs - if the operation succeeded, update the existing
* fhtable entry to point to new dir and name.
*/
/* ARGSUSED */
static void
{
int error;
if (debug > 2) {
}
"rename3 from");
"rename3 to");
}
/* rename failed so nothing to update */
return;
"Rename3: Update from '%s' to '%s' failed: %s\n"),
}
}
/*
* nfslog_LINK3_fhargs - if the operation succeeded, we are sure there can
* be no such link in the fhtable, so just add it.
*/
/* ARGSUSED */
static void
{
char *name;
int error;
if (debug > 2) {
}
}
/* link failed so nothing to add */
return;
/* A new link so add it, have fh_add find link count */
"Link3: Add fh for '%s' failed: %s\n"),
}
}
/*
* nfslog_MKNOD3_fhargs - if the operation succeeded, we are sure there can
* be no such link in the fhtable, so just add it.
*/
/* ARGSUSED */
static void
{
char *name;
int error;
if (debug > 2) {
else
}
}
/* no returned fh so nothing to add */
return;
/* A new file handle so add it */
}
}
/*
* nfslog_SYMLINK3_fhargs - if the operation succeeded, we are sure there can
* be no such link in the fhtable, so just add it.
*/
/* ARGSUSED */
static void
{
char *name;
int error;
if (debug > 2) {
else
}
}
/* no returned fh so nothing to add */
return;
/* A new file handle so add it */
"Symlink3: Add fh for '%s' failed: %s\n"),
}
}
/*
* nfslog_READDIR3_fhargs - updates path1 but no fhtable changes
*/
/* ARGSUSED */
static void
{
if (debug > 2) {
(void) printf("=============\nREADDIR3: fh ");
sizeof (*args));
(void) printf("\n");
}
}
}
/*
* nfslog_READDIRPLUS3_fhargs - updates path1 but no fhtable changes
*/
/* ARGSUSED */
static void
{
char *name;
if (debug > 2) {
(void) printf("=============\nREADDIRPLUS3: fh ");
(void) printf("\n");
}
}
/*
* to the mappings.
*/
"ReaddirPlus3");
}
}
}
/*
* nfslog_FSSTAT3_fhargs - updates path1 but no fhtable changes
*/
/* ARGSUSED */
static void
{
if (debug > 2) {
(void) printf("=============\nFSSTAT3: fh ");
sizeof (*args));
(void) printf("\n");
}
fhpath, "fsstat3");
}
}
/*
* nfslog_FSINFO3_fhargs - updates path1 but no fhtable changes
*/
/* ARGSUSED */
static void
{
if (debug > 2) {
(void) printf("=============\nFSINFO3: fh ");
sizeof (*args));
(void) printf("\n");
}
fhpath, "fsinfo3");
}
}
/*
* nfslog_PATHCONF3_fhargs - updates path1 but no fhtable changes
*/
/* ARGSUSED */
static void
{
if (debug > 2) {
(void) printf("=============\nPATHCONF3: fh ");
sizeof (*args));
(void) printf("\n");
}
fhpath, "pathconf3");
}
}
/*
* nfslog_COMMIT3_fhargs - updates path1 but no fhtable changes
*/
/* ARGSUSED */
static void
{
if (debug > 2) {
(void) printf("=============\nCOMMIT3: fh ");
(void) printf("\n");
}
}
}
/*
* NFSLOG VERSION 1
*/
/*
* nfslog_SHARE_fhargs - adds export path and handle to fhlist
*/
/* ARGSUSED */
static void
{
int error;
if (debug > 2) {
(void) printf(
sizeof (fhandle_t));
(void) printf("\n");
}
/*
* is not meaningful with respect to the database keys. Therefore, we
* copy the export or fh_xdata fid to the fh_data so that a reasonable
* entry will be added in the data base.
*/
/* If debug print the database */
if (debug > 10) {
}
"Share: Add fh for '%s' failed: %s\n"),
}
}
}
}
/*
* nfslog_UNSHARE_fhargs - remove export path and handle from fhlist
*/
/* ARGSUSED */
static void
{
int error;
if (debug > 2) {
(void) printf("=============\nUNSHARE: name '%s', fh ",
sizeof (fhandle_t));
(void) printf("\n");
}
/*
* is not meaningful with respect to the database keys. Therefore, we
* copy the export or fh_xdata fid to the fh_data so that a reasonable
* entry will be added in the data base.
*/
/* If debug print the database */
if (debug > 10) {
}
}
"Unknown"));
}
}
/* ARGSUSED */
static void
{
int error;
if (debug > 2) {
(void) printf("=============\nGETFH3: name '%s', fh ",
sizeof (fhandle_t));
(void) printf("\n");
}
/* If debug print the database */
if (debug > 10) {
}
"Getfh: Add fh for '%s' failed: %s\n"),
}
}
}
}
/*
* Exported function
*/
/*
* nfslog_get_path - gets the path for this file. fh must be supplied,
* name may be null. If name is supplied, fh is assumed to be a directory
* filehandle, with name as its component. fhpath is the generic path for the
* fhtopath table and prtstr is the name of the caller (for debug purposes).
* Returns the malloc'd path. The caller must free it later.
*/
char *
{
if (debug > 3) {
(void) printf("\n");
}
return (pathp);
}
/*
* nfslog_process_fh_rec - updates the fh table based on the rpc req
* Return 0 for success, error otherwise. If success return the path
* for the input file handle(s) if so indicated.
*/
int
{
/*
* Allocate space for the args and results and decode
*/
return (FALSE);
}
/* used later for free of data structures */
return (FALSE);
}
/* used later for free of data structures */
/*
* Process the operation within the context of the file handle
* mapping process
*/
if (return_path) {
} else {
} else {
}
}
return (TRUE);
} else {
return (FALSE);
}
}