cfsd_logelem.cc revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* 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
*/
// -----------------------------------------------------------------
//
//
// Methods of the cfsd_logelem* classes.
#pragma ident "%Z%%M% %I% %E% SMI"
// Copyright 2004 Sun Microsystems, Inc. All rights reserved.
// Use is subject to license terms.
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <synch.h>
#include <unistd.h>
#include <stdarg.h>
#include <string.h>
#include <libintl.h>
#include <errno.h>
#include "cfsd_maptbl.h"
#include "cfsd_logfile.h"
#include "cfsd_kmod.h"
#include "cfsd_logelem.h"
#define TIMECHANGE(A, B) (memcmp(&A, &B, sizeof (A)) != 0)
#define X_OPTIMIZED -2
#define X_CONFLICT -3
// -----------------------------------------------------------------
//
// cfsd_logelem::cfsd_logelem
//
// Description:
// Constructor for the cfsd_logelem abstract base class.
// Arguments:
// Returns:
// Preconditions:
{
dbug_enter("cfsd_logelem::cfsd_logelem");
i_messagep = NULL;
}
// -----------------------------------------------------------------
//
// cfsd_logelem::~cfsd_logelem
//
// Description:
// Destructor for the cfsd_logelem abstract base class.
// Arguments:
// Returns:
// Preconditions:
{
dbug_enter("cfsd_logelem::~cfsd_logelem");
delete i_messagep;
}
// -----------------------------------------------------------------
//
// cfsd_logelem::logelem_message
//
// Description:
// Arguments:
// Returns:
// Returns the string describing the message or NULL if
// there is no message.
// Preconditions:
const char *
{
dbug_enter("cfsd_logelem::logelem_message");
if (i_messagep) {
return (i_messagep->data());
} else {
return (NULL);
}
}
// -----------------------------------------------------------------
//
// cfsd_logelem::i_print_cred
//
// Description:
// Arguments:
// credp
// Returns:
// Preconditions:
// precond(credp)
void
{
dbug_enter("cfsd_logelem::i_print_cred");
char buf[100];
buf[0] = '\0';
char format[10];
int xx;
}
}
// -----------------------------------------------------------------
//
// cfsd_logelem::i_print_attr
//
// Description:
// Arguments:
// vattrp
// Returns:
// Preconditions:
// precond(vattrp)
void
{
dbug_enter("cfsd_logelem::i_print_attr");
}
// -----------------------------------------------------------------
//
// cfsd_logelem::i_format_fid
//
// Description:
// Arguments:
// fidp
// Returns:
// Preconditions:
// precond(fidp)
void
{
int index;
char format[10];
i_fidbuf[0] = '\0';
}
}
// -----------------------------------------------------------------
//
// cfsd_logelem::i_lostfound
//
// Description:
// Called when there is a conflict on a file.
// Arguments:
// cidp cid of file to move to lost+found
// pcidp parent cid if known, else null
// namep name of file if known, else null
// Returns:
// Returns 0 for success, EIO if file could not be moved.
// Preconditions:
// precond(cidp)
int
{
dbug_enter("cfsd_logelem::i_lostfound");
int xx;
char namebuf[40];
// make an alternate name for the file
// get info about the file from the cache
if (xx) {
}
return (0);
}
// determine what we want to call this file
else
}
// if not a regular file or not modified
return (0);
}
// get the fid of the parent directory from the passed in cid
int gotdirfid = 0;
if (pcidp) {
// see if we have a valid mapping for the parent cid
if (xx == -1)
return (EIO);
if (xx)
return (EIO);
gotdirfid = 1;
}
}
// otherwise try to get the fid from the cache
if (gotdirfid == 0) {
if (xx == 0)
gotdirfid = 1;
}
}
// if not parent fid yet, try to get one from the dir in the cache
// see if we have a valid mapping for the cache parent cid
if (xx == -1)
return (EIO);
if (xx)
return (EIO);
gotdirfid = 1;
}
}
// otherwise try to get the fid from the cache
if (gotdirfid == 0) {
if (xx == 0)
gotdirfid = 1;
}
}
int wrotefile = 0;
// if we found a parent directory
if (gotdirfid) {
// get the host name
char *machnamep;
if (xx == -1)
machnamep = "client";
else
// find a name we can call this file
char *np;
int foundname = 0;
int index;
#define MAXTRIES 10
// construct the name
if (len > MAXNAMELEN)
else
// see if it exists
// timeout error, pass the error back up
return (ETIMEDOUT);
// file does not exist, so try to use it
foundname = 1;
break;
}
// any other error on the directory, give up
if (xx)
break;
}
// if we found a name
if (foundname) {
// set up attributes for the file
// create the file
if (xx == 0) {
// write the file
if (xx == 0) {
wrotefile = 1;
gettext("' renamed as '"),
}
}
}
}
// if we could not write the file to the server, move to lost+found
if (wrotefile == 0) {
char newname[MAXNAMELEN];
// move the file to lost+found
dbug_assert(0);
return (0);
} else if (xx) {
gettext("' to lost+found. "
"Run cachefs fsck on the file system."), NULL);
} else {
}
}
// set the mapping to indicate conflict
if (xx)
return (EIO);
return (xx);
}
// -----------------------------------------------------------------
//
// cfsd_logelem::i_problem
//
// Description:
// Specifies the problem string.
// Pass a variable number of strings.
// They are concatinated together to form the message.
// Terminate the argument list with NULL.
// Arguments:
// strp
// Returns:
// Preconditions:
// precond(strp)
void
{
dbug_enter("cfsd_logelem::i_problem");
}
// -----------------------------------------------------------------
//
// cfsd_logelem::i_resolution
//
// Description:
// Specifies the resolution string.
// Pass a variable number of strings.
// They are concatinated together to form the message.
// Terminate the argument list with NULL.
// Arguments:
// strp
// Returns:
// Preconditions:
// precond(strp)
void
{
dbug_enter("cfsd_logelem::i_resolution");
}
// -----------------------------------------------------------------
//
// cfsd_logelem::i_message
//
// Description:
// Arguments:
// prefix
// strp
// Returns:
// Preconditions:
// precond(prefix)
// precond(strp)
void
{
dbug_enter("cfsd_logelem::i_message");
char *fp;
if (i_messagep == NULL)
else
for (;;) {
break;
}
}
//
// cfsd_logelem_setattr::cfsd_logelem_setattr
//
// Description:
// Arguments:
// Returns:
// Preconditions:
{
dbug_enter("cfsd_logelem_setattr::cfsd_logelem_setattr");
}
//
// cfsd_logelem_setsecattr::cfsd_logelem_setsecattr
//
// Description:
// Arguments:
// Returns:
// Preconditions:
{
dbug_enter("cfsd_logelem_setsecattr::cfsd_logelem_setsecattr");
}
//
// cfsd_logelem_setattr::~cfsd_logelem_setattr
//
// Description:
// Arguments:
// Returns:
// Preconditions:
{
dbug_enter("cfsd_logelem_setattr::~cfsd_logelem_setattr");
}
//
// cfsd_logelem_setsecattr::~cfsd_logelem_setsecattr
//
// Description:
// Arguments:
// Returns:
// Preconditions:
{
dbug_enter("cfsd_logelem_setsecattr::~cfsd_logelem_setsecattr");
}
//
// cfsd_logelem_setattr::logelem_roll
//
// Description:
// Arguments:
// Returns:
// Preconditions:
int
{
dbug_enter("cfsd_logelem_setattr::logelem_roll");
int xx;
int time_log;
// get the mapping for this cid if it exists
if (xx == -1)
return (EIO);
// if a mapping was not found
if (xx) {
// dummy up mapping so we get values from the cache
}
// done if there was a conflict on the file
return (0);
// done if the file is optimized out
return (0);
// if we have a fid in the mapping
// get the fid
if (xx)
return (EIO);
}
// else get the fid from the cache
else {
return (0);
if (xx) {
gettext(" File is no longer in the cache."),
NULL);
return (xx);
}
}
// if we have timestamps in the mapping
// get the times
if (xx)
return (EIO);
time_log = 0;
}
// else get the timestamps from the log entry
else {
time_log = 1;
}
// get the attributes of the file from the back fs
return (ETIMEDOUT);
if (xx) {
return (xx);
}
int conflict = 0;
// conflict if mtime changed
gettext(" File modified "),
time_log ?
gettext("while disconnected.") :
gettext("while rolling log."),
NULL);
conflict = 1;
}
// conflict if ctime changed
gettext(" File changed "),
time_log ?
gettext("while disconnected.") :
gettext("while rolling log."),
NULL);
conflict = 1;
}
// if a conflict was detected
if (conflict) {
return (xx);
}
// now do the setattr, get the new times
return (ETIMEDOUT);
if (xx) {
gettext(" Error:"),
return (xx);
}
// update the mapping to point to the new times
if (xx)
return (EIO);
return (0);
}
//
// cfsd_logelem_setattr::logelem_dump
//
// Description:
// Arguments:
// Returns:
// Preconditions:
void
{
dbug_enter("cfsd_logelem_setattr::logelem_dump");
}
//
// cfsd_logelem_setsecattr::logelem_roll
//
// Description:
// Arguments:
// Returns:
// Preconditions:
int
{
dbug_enter("cfsd_logelem_setsecattr::logelem_roll");
int xx;
int time_log;
// get the mapping for this cid if it exists
if (xx == -1)
return (EIO);
// if a mapping was not found
if (xx) {
// dummy up mapping so we get values from the cache
}
// done if there was a conflict on the file
return (0);
// done if the file is optimized out
return (0);
// if we have a fid in the mapping
// get the fid
if (xx)
return (EIO);
}
// else get the fid from the cache
else {
return (0);
if (xx) {
gettext(" File is no longer in the cache."),
NULL);
return (xx);
}
}
// if we have timestamps in the mapping
// get the times
if (xx)
return (EIO);
time_log = 0;
}
// else get the timestamps from the log entry
else {
time_log = 1;
}
// get the attributes of the file from the back fs
return (ETIMEDOUT);
if (xx) {
return (xx);
}
int conflict = 0;
// conflict if mtime changed
gettext(" File modified "),
time_log ?
gettext("while disconnected.") :
gettext("while rolling log."),
NULL);
conflict = 1;
}
// conflict if ctime changed
gettext(" File changed "),
time_log ?
gettext("while disconnected.") :
gettext("while rolling log."),
NULL);
conflict = 1;
}
// if a conflict was detected
if (conflict) {
return (xx);
}
// now do the setsecattr, get the new times
return (ETIMEDOUT);
if (xx) {
gettext(" Error:"),
return (xx);
}
// update the mapping to point to the new times
if (xx)
return (EIO);
return (0);
}
//
// cfsd_logelem_setsecattr::logelem_dump
//
// Description:
// Arguments:
// Returns:
// Preconditions:
void
{
dbug_enter("cfsd_logelem_setsecattr::logelem_dump");
}
//
// cfsd_logelem_create::cfsd_logelem_create
//
// Description:
// Arguments:
// Returns:
// Preconditions:
{
dbug_enter("cfsd_logelem_create::cfsd_logelem_create");
}
//
// cfsd_logelem_create::~cfsd_logelem_create
//
// Description:
// Arguments:
// Returns:
// Preconditions:
{
dbug_enter("cfsd_logelem_create::~cfsd_logelem_create");
}
//
// cfsd_logelem_create::logelem_roll
//
// Description:
// Arguments:
// Returns:
// Preconditions:
int
{
dbug_enter("cfsd_logelem_create::logelem_roll");
int xx;
// if the file existed at the time of this operation
// see if the file no longer exists in the cache
#if 0
if (xx) {
// indicate ignore future operations on file
if (xx)
return (EIO);
return (0);
}
#endif
// get the fid of the parent directory
if (xx == -1)
return (EIO);
if (xx) {
gettext("'. Parent directory no longer exists."),
NULL);
return (xx);
}
} else {
if (xx)
return (EIO);
}
// if the file exists on the back fs
return (ETIMEDOUT);
// if the file exists on the back file system
if (xx == 0) {
return (xx);
}
// do the create
if (xx) {
return (ETIMEDOUT);
// create failed move to lost and found
return (xx);
}
// update the mapping to point to the new fid and times
if (xx)
return (EIO);
return (0);
}
//
// cfsd_logelem_create::logelem_dump
//
// Description:
// Arguments:
// Returns:
// Preconditions:
void
{
dbug_enter("cfsd_logelem_create::logelem_dump");
}
//
// cfsd_logelem_remove::cfsd_logelem_remove
//
// Description:
// Arguments:
// Returns:
// Preconditions:
{
dbug_enter("cfsd_logelem_remove::cfsd_logelem_remove");
}
//
// cfsd_logelem_remove::~cfsd_logelem_remove
//
// Description:
// Arguments:
// Returns:
// Preconditions:
{
dbug_enter("cfsd_logelem_remove::~cfsd_logelem_remove");
}
// -----------------------------------------------------------------
//
// cfsd_logelem_remove::logelem_roll
//
// Description:
// Arguments:
// Returns:
// Preconditions:
int
{
dbug_enter("cfsd_logelem_remove::logelem_roll");
int xx;
int time_log;
// get the mapping for this cid if it exists
if (xx == -1)
return (EIO);
// done if there was a conflict on the file
return (0);
// done if the file is optimized out
return (0);
// if a mapping was not found
if (xx) {
// dummy up mapping so we get values from the cache
}
// if we have timestamps in the mapping
// get the times
if (xx)
return (EIO);
time_log = 0;
}
// else get the timestamps from the log entry
else {
time_log = 1;
}
// get the fid of the parent directory
if (xx == -1)
return (EIO);
if (xx) {
gettext("'. Parent directory no longer exists"),
NULL);
return (0);
}
} else {
if (xx)
return (EIO);
}
// get file attributes
return (ETIMEDOUT);
// if the file no longer exists on the back fs
return (0);
} else if (xx) {
gettext("'. Cannot get file attributes from server. "),
NULL);
return (0);
}
// conflict if mtime changed
gettext("'. File modified "),
time_log ?
gettext("while disconnected.") :
gettext("while rolling log."),
NULL);
return (0);
}
// conflict if ctime changed
gettext("'. File changed "),
time_log ?
gettext("while disconnected.") :
gettext("while rolling log."),
NULL);
return (0);
}
// do the remove
if (xx) {
return (ETIMEDOUT);
// remove failed
return (0);
}
// record new ctime if multiple links to file
if (ctimep) {
if (xx)
return (EIO);
}
return (0);
}
// -----------------------------------------------------------------
//
// cfsd_logelem_remove::logelem_dump
//
// Description:
// Arguments:
// Returns:
// Preconditions:
void
{
dbug_enter("cfsd_logelem_remove::logelem_dump");
}
// -----------------------------------------------------------------
//
// cfsd_logelem_rmdir::cfsd_logelem_rmdir
//
// Description:
// Arguments:
// Returns:
// Preconditions:
{
dbug_enter("cfsd_logelem_rmdir::cfsd_logelem_rmdir");
}
// -----------------------------------------------------------------
//
// cfsd_logelem_rmdir::~cfsd_logelem_rmdir
//
// Description:
// Arguments:
// Returns:
// Preconditions:
{
dbug_enter("cfsd_logelem_rmdir::~cfsd_logelem_rmdir");
}
// -----------------------------------------------------------------
//
// cfsd_logelem_rmdir::logelem_roll
//
// Description:
// Arguments:
// Returns:
// Preconditions:
int
{
dbug_enter("cfsd_logelem_rmdir::logelem_roll");
int xx;
// get the fid of the parent directory
if (xx == -1)
return (EIO);
if (xx) {
gettext("'. Parent directory no longer exists"),
NULL);
return (0);
}
} else {
if (xx)
return (EIO);
}
// perform the rmdir
if (xx) {
return (ETIMEDOUT);
return (0);
}
return (0);
}
// -----------------------------------------------------------------
//
// cfsd_logelem_rmdir::logelem_dump
//
// Description:
// Arguments:
// Returns:
// Preconditions:
void
{
dbug_enter("cfsd_logelem_rmdir::logelem_dump");
}
// -----------------------------------------------------------------
//
// cfsd_logelem_mkdir::cfsd_logelem_mkdir
//
// Description:
// Arguments:
// Returns:
// Preconditions:
{
dbug_enter("cfsd_logelem_mkdir::cfsd_logelem_mkdir");
}
// -----------------------------------------------------------------
//
// cfsd_logelem_mkdir::~cfsd_logelem_mkdir
//
// Description:
// Arguments:
// Returns:
// Preconditions:
{
dbug_enter("cfsd_logelem_mkdir::~cfsd_logelem_mkdir");
}
// -----------------------------------------------------------------
//
// cfsd_logelem_mkdir::logelem_roll
//
// Description:
// Arguments:
// Returns:
// Preconditions:
int
{
dbug_enter("cfsd_logelem_mkdir::logelem_roll");
int xx;
// get the fid of the parent directory
if (xx == -1)
return (EIO);
if (xx) {
gettext("'. Parent directory no longer exists"),
NULL);
return (0);
}
} else {
if (xx)
return (EIO);
}
// perform the mkdir
if (xx) {
return (ETIMEDOUT);
return (0);
}
// update the mapping to point to the new fid
if (xx)
return (EIO);
return (0);
}
// -----------------------------------------------------------------
//
// cfsd_logelem_mkdir::logelem_dump
//
// Description:
// Arguments:
// Returns:
// Preconditions:
void
{
dbug_enter("cfsd_logelem_mkdir::logelem_dump");
}
// -----------------------------------------------------------------
//
// cfsd_logelem_link::cfsd_logelem_link
//
// Description:
// Arguments:
// Returns:
// Preconditions:
{
dbug_enter("cfsd_logelem_link::cfsd_logelem_link");
}
// -----------------------------------------------------------------
//
// cfsd_logelem_link::~cfsd_logelem_link
//
// Description:
// Arguments:
// Returns:
// Preconditions:
{
dbug_enter("cfsd_logelem_link::~cfsd_logelem_link");
}
// -----------------------------------------------------------------
//
// cfsd_logelem_link::logelem_roll
//
// Description:
// Arguments:
// Returns:
// Preconditions:
int
{
dbug_enter("cfsd_logelem_link::logelem_roll");
int xx;
// get the mapping for the child cid if it exists
if (xx == -1)
return (EIO);
// if a mapping was not found
if (xx) {
// dummy up mapping so we get values from the cache
}
// done if there was a conflict on the file
return (0);
// done if the file is optimized out
return (0);
// if we have a fid in the mapping
// get the fid
if (xx)
return (EIO);
}
// else get the fid from the cache
else {
return (0);
if (xx) {
gettext("'. File is no longer in the cache."),
NULL);
return (0);
}
}
// if we have timestamps in the mapping
int time_log;
// get the times
if (xx)
return (EIO);
time_log = 0;
}
// else get the timestamps from the log entry
else {
time_log = 1;
}
// get the attributes of the file from the back fs
return (ETIMEDOUT);
if (xx) {
return (0);
}
// conflict if mtime changed
gettext("'. File modified "),
time_log ?
gettext("while disconnected.") :
gettext("while rolling log."),
NULL);
return (0);
}
// conflict if ctime changed
gettext("'. File changed "),
time_log ?
gettext("while disconnected.") :
gettext("while rolling log."),
NULL);
return (0);
}
// get the fid of the parent directory
if (xx == -1)
return (EIO);
if (xx) {
gettext("'. Parent directory no longer exists."),
NULL);
return (0);
}
} else {
if (xx)
return (EIO);
}
// do the link
if (xx) {
return (ETIMEDOUT);
return (0);
}
// update the mapping with the new time
if (xx)
return (EIO);
return (0);
}
// -----------------------------------------------------------------
//
// cfsd_logelem_link::logelem_dump
//
// Description:
// Arguments:
// Returns:
// Preconditions:
void
{
dbug_enter("cfsd_logelem_link::logelem_dump");
}
// -----------------------------------------------------------------
//
// cfsd_logelem_symlink::cfsd_logelem_symlink
//
// Description:
// Arguments:
// Returns:
// Preconditions:
{
dbug_enter("cfsd_logelem_symlink::cfsd_logelem_symlink");
}
// -----------------------------------------------------------------
//
// cfsd_logelem_symlink::~cfsd_logelem_symlink
//
// Description:
// Arguments:
// Returns:
// Preconditions:
{
dbug_enter("cfsd_logelem_symlink::~cfsd_logelem_symlink");
}
// -----------------------------------------------------------------
//
// cfsd_logelem_symlink::logelem_roll
//
// Description:
// Arguments:
// Returns:
// Preconditions:
int
{
dbug_enter("cfsd_logelem_symlink::logelem_roll");
int xx;
// see if the symlink no longer exists in the cache
#if 0
if (xx) {
// indicate ignore future operations on symlink
if (xx)
return (EIO);
return (0);
}
#endif
// get the fid of the parent directory
if (xx == -1)
return (EIO);
if (xx) {
gettext("'. Parent directory no longer exists."),
NULL);
return (0);
}
} else {
if (xx)
return (EIO);
}
// if the file exists on the back fs
return (ETIMEDOUT);
// if the file exists on the back file system
if (xx == 0) {
return (0);
}
// do the symlink
if (xx) {
return (ETIMEDOUT);
return (0);
}
// update the mapping to point to the new fid and times
if (xx)
return (EIO);
return (0);
}
// -----------------------------------------------------------------
//
// cfsd_logelem_symlink::logelem_dump
//
// Description:
// Arguments:
// Returns:
// Preconditions:
void
{
dbug_enter("cfsd_logelem_symlink::logelem_dump");
}
// -----------------------------------------------------------------
//
// cfsd_logelem_rename::cfsd_logelem_rename
//
// Description:
// Arguments:
// Returns:
// Preconditions:
{
dbug_enter("cfsd_logelem_rename::cfsd_logelem_rename");
}
// -----------------------------------------------------------------
//
// cfsd_logelem_rename::~cfsd_logelem_rename
//
// Description:
// Arguments:
// Returns:
// Preconditions:
{
dbug_enter("cfsd_logelem_rename::~cfsd_logelem_rename");
}
// -----------------------------------------------------------------
//
// cfsd_logelem_rename::logelem_roll
//
// Description:
// Arguments:
// Returns:
// Preconditions:
int
{
dbug_enter("cfsd_logelem_rename::logelem_roll");
int xx;
// get the mapping for the child cid if it exists
if (xx == -1)
return (EIO);
// if a mapping was not found
if (xx) {
// dummy up mapping so we get values from the cache
}
// done if there was a conflict on the file
return (0);
// done if the file is optimized out
return (0);
// if we have timestamps in the mapping
int time_log;
// get the times
if (xx)
return (EIO);
time_log = 0;
}
// else get the timestamps from the log entry
else {
time_log = 1;
}
// get the fid of the old parent directory
if (xx == -1)
return (EIO);
if (xx) {
gettext("'. Original directory no longer exists."),
NULL);
return (0);
}
} else {
if (xx)
return (EIO);
}
// get the fid of the new parent directory
if (xx == -1)
return (EIO);
if (xx) {
gettext("'. Target directory no longer exists."),
NULL);
return (0);
}
} else {
if (xx)
return (EIO);
}
// get the attributes of the file from the back fs
return (ETIMEDOUT);
if (xx) {
return (0);
}
// conflict if mtime changed
gettext("'. File modified "),
time_log ?
gettext("while disconnected.") :
gettext("while rolling log."),
NULL);
return (0);
}
// conflict if ctime changed
gettext("'. File changed "),
time_log ?
gettext("while disconnected.") :
gettext("while rolling log."),
NULL);
return (0);
}
// if we are also deleting a file
// get the mapping for the deleted cid if it exists
if (xx == -1)
return (EIO);
// if a mapping was not found
if (xx) {
// dummy up mapping so we get values from the cache
}
// if we have timestamps in the mapping
int time_log;
// get the times
if (xx)
return (EIO);
time_log = 0;
}
// else get the timestamps from the log entry
else {
time_log = 1;
}
// get the attributes of the target file from the back fs
return (ETIMEDOUT);
if (xx) {
gettext("'. Cannot get attributes on target."),
NULL);
return (0);
}
// conflict if mtime changed
gettext("'. Target modified "),
time_log ?
gettext("while disconnected.") :
gettext("while rolling log."),
NULL);
return (0);
}
// conflict if ctime changed
gettext("'. Target changed "),
time_log ?
gettext("while disconnected.") :
gettext("while rolling log."),
NULL);
return (0);
}
NULL;
}
// perform the rename
&i_up->dl_child_cid,
if (xx) {
return (ETIMEDOUT);
return (0);
}
// update the mapping to point to the new times for the file
if (xx)
return (EIO);
// if we deleted a file with links left
if (delctimep) {
// update the mapping to the new times for the deleted file
if (xx)
return (EIO);
}
return (0);
}
// -----------------------------------------------------------------
//
// cfsd_logelem_rename::logelem_dump
//
// Description:
// Arguments:
// Returns:
// Preconditions:
void
{
dbug_enter("cfsd_logelem_rename::logelem_dump");
}
//
// cfsd_logelem_modified::cfsd_logelem_modified
//
// Description:
// Arguments:
// Returns:
// Preconditions:
{
dbug_enter("cfsd_logelem_modified::cfsd_logelem_modified");
}
//
// cfsd_logelem_modified::~cfsd_logelem_modified
//
// Description:
// Arguments:
// Returns:
// Preconditions:
{
dbug_enter("cfsd_logelem_modified::~cfsd_logelem_modified");
}
//
// cfsd_logelem_modified::logelem_roll
//
// Description:
// Arguments:
// Returns:
// Preconditions:
int
{
dbug_enter("cfsd_logelem_modified::logelem_roll");
int xx;
int time_log;
// get the mapping for this cid if it exists
if (xx == -1)
return (EIO);
// if a mapping was not found
if (xx) {
// dummy up mapping so we get values from the cache
}
// done if there was a conflict on the file
return (0);
// done if the file is optimized out
return (0);
// if we have a fid in the mapping
// get the fid
if (xx)
return (EIO);
}
// else get the fid from the cache
else {
return (0);
if (xx) {
gettext(" File is no longer in the cache."),
NULL);
return (xx);
}
}
// get info about the file from the cache
if (xx) {
gettext(" File is no longer in the cache."),
NULL);
return (xx);
}
// if we are not ready to process this write yet
"current seq %d, metadata seq %d",
return (EAGAIN);
} else {
"current seq %d, metadata seq %d",
}
// if we have timestamps in the mapping
// get the times
if (xx)
return (EIO);
time_log = 0;
}
// else get the timestamps from the log entry
else {
time_log = 1;
}
// get the attributes of the file from the back fs
return (ETIMEDOUT);
if (xx) {
return (xx);
}
int conflict = 0;
// conflict if mtime changed
gettext(" File modified "),
time_log ?
gettext("while disconnected.") :
gettext("while rolling log."),
NULL);
conflict = 1;
}
// conflict if ctime changed
gettext(" File changed "),
time_log ?
gettext("while disconnected.") :
gettext("while rolling log."),
NULL);
conflict = 1;
}
// if a conflict was detected
if (conflict) {
return (xx);
}
// now do the write, get the new times
return (ETIMEDOUT);
if (xx) {
gettext(" Error:"),
return (xx);
}
// update the mapping to point to the new times
if (xx)
return (EIO);
return (0);
return (0);
}
//
// cfsd_logelem_modified::logelem_dump
//
// Description:
// Arguments:
// Returns:
// Preconditions:
void
{
dbug_enter("cfsd_logelem_modified::logelem_dump");
}
//
// cfsd_logelem_mapfid::cfsd_logelem_mapfid
//
// Description:
// Arguments:
// Returns:
// Preconditions:
{
dbug_enter("cfsd_logelem_mapfid::cfsd_logelem_mapfid");
}
//
// cfsd_logelem_mapfid::~cfsd_logelem_mapfid
//
// Description:
// Arguments:
// Returns:
// Preconditions:
{
dbug_enter("cfsd_logelem_mapfid::~cfsd_logelem_mapfid");
}
//
// cfsd_logelem_mapfid::logelem_roll
//
// Description:
// Arguments:
// Returns:
// Preconditions:
int
{
dbug_enter("cfsd_logelem_mapfid::logelem_roll");
int xx;
// map the cid to the fid
if (xx)
return (EIO);
return (0);
}
//
// cfsd_logelem_mapfid::logelem_dump
//
// Description:
// Arguments:
// Returns:
// Preconditions:
void
{
dbug_enter("cfsd_logelem_mapfid::logelem_dump");
}