src/xcalls/x_rename.c File Reference

x_rename implementation More...

#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <stdlib.h>
#include <misc/debug.h>
#include <core/tx.h>
#include <core/config.h>
#include <core/koa.h>
#include <core/buffer.h>
#include <core/txdesc.h>
#include <core/stats.h>
#include <libc/syscalls.h>
#include <xcalls/xcalls.h>

Go to the source code of this file.

Classes

struct  x_rename_commit_undo_args_s

Typedefs

typedef x_rename_commit_undo_args_s x_rename_commit_undo_args_t

Functions

int XCALL_DEF() x_rename (const char *oldpath, const char *newpath, int *result)
 Changes the name or location of a file.


Detailed Description

x_rename implementation

Definition in file x_rename.c.


Function Documentation

int XCALL_DEF() x_rename ( const char *  oldpath,
const char *  newpath,
int *  result 
)

Changes the name or location of a file.

If a file at the new location exists, then it is renamed to a temporary file and removed only when the transaction commits. This allows restoring the file in case the transaction aborts.

Execution : in-place

Asynchronous failures : commit, abort

Parameters:
[in] oldpath The old location of the file.
[in] oldpath The new location of the file.
[out] result Where to store any asynchronous failures.
Returns:
0 on success, or -1 if a synchronous failure occurred (in which case, errno is set appropriately).

Definition at line 124 of file x_rename.c.

References x_rename_commit_undo_args_s::newpath, x_rename_commit_undo_args_s::newpath_koa, x_rename_commit_undo_args_s::newpath_koa_is_valid, x_rename_commit_undo_args_s::oldpath, x_rename_commit_undo_args_s::oldpath_koa, x_rename_commit_undo_args_s::temppath, txc_buffer_linear_malloc(), txc_g_koamgr, TXC_INTERNALERROR, txc_koa_alias_cache_lookup_inode(), txc_koa_attach(), txc_koa_create(), TXC_KOA_CREATE_COMMIT_ACTION_ORDER, TXC_KOA_CREATE_UNDO_ACTION_ORDER, txc_koa_detach(), txc_koa_get_sentinel(), TXC_KOA_IS_FILE, txc_koa_lock_alias_cache(), txc_koa_lock_fds_refby_koa(), txc_koa_path2inode(), txc_koa_unlock_alias_cache(), txc_koa_unlock_fds_refby_koa(), TXC_R_BUSYSENTINEL, TXC_R_SUCCESS, TXC_SENTINEL_ACQUIREONRETRY, txc_sentinel_tryacquire(), txc_stats_txstat_increment, txc_tx_abort_transaction(), txc_tx_get_txd(), txc_tx_get_xactstate(), txc_tx_register_commit_action(), txc_tx_register_undo_action(), and x_rename().


Generated on Wed Dec 9 20:32:41 2009 for xCalls by  doxygen 1.4.7