rpc_cb cb;
void *private_data;
-};
+};
void free_rpc_cb_data(struct rpc_cb_data *data)
{
nfs->writemax = res->FSINFO3res_u.resok.wtmax;
memset(&args, 0, sizeof(GETATTR3args));
- args.object.data.data_len = nfs->rootfh.data.data_len;
- args.object.data.data_val = nfs->rootfh.data.data_val;
+ args.object = nfs->rootfh;
if (rpc_nfs3_getattr_async(rpc, nfs_mount_10_cb, &args, data) != 0) {
data->cb(-ENOMEM, nfs, command_data, data->private_data);
memset(&args, 0, sizeof(LOOKUP3args));
- args.what.dir.data.data_len = fh->data.data_len;
- args.what.dir.data.data_val = fh->data.data_val;
- args.what.name = path;
+ args.what.dir = *fh;
+ args.what.name = path;
if (rpc_nfs3_lookup_async(nfs->rpc, nfs_lookup_path_1_cb, &args, data) != 0) {
rpc_set_error(nfs->rpc, "RPC error: Failed to send lookup call for %s", data->path);
struct GETATTR3args args;
memset(&args, 0, sizeof(GETATTR3args));
- args.object.data.data_len = data->fh.data.data_len;
- args.object.data.data_val = data->fh.data.data_val;
+ args.object = data->fh;
if (rpc_nfs3_getattr_async(nfs->rpc, nfs_stat_1_cb, &args, data) != 0) {
rpc_set_error(nfs->rpc, "RPC error: Failed to send STAT GETATTR call for %s", data->path);
}
/* steal the filehandle */
- nfsfh->fh.data.data_len = data->fh.data.data_len;
- nfsfh->fh.data.data_val = data->fh.data.data_val;
+ nfsfh->fh = data->fh;
data->fh.data.data_val = NULL;
data->cb(0, nfs, nfsfh, data->private_data);
}
memset(&args, 0, sizeof(ACCESS3args));
- args.object.data.data_len = data->fh.data.data_len;
- args.object.data.data_val = data->fh.data.data_val;
+ args.object = data->fh;
args.access = nfsmode;
if (rpc_nfs3_access_async(nfs->rpc, nfs_open_cb, &args, data) != 0) {
READ3args args;
memset(&args, 0, sizeof(READ3args));
- args.file.data.data_len = nfsfh->fh.data.data_len;
- args.file.data.data_val = nfsfh->fh.data.data_val;
+ args.file = nfsfh->fh;
args.offset = offset;
args.count = count;
mdata->count = readcount;
memset(&args, 0, sizeof(READ3args));
- args.file.data.data_len = nfsfh->fh.data.data_len;
- args.file.data.data_val = nfsfh->fh.data.data_val;
+ args.file = nfsfh->fh;
args.offset = offset;
args.count = readcount;
WRITE3args args;
memset(&args, 0, sizeof(WRITE3args));
- args.file.data.data_len = nfsfh->fh.data.data_len;
- args.file.data.data_val = nfsfh->fh.data.data_val;
+ args.file = nfsfh->fh;
args.offset = offset;
args.count = count;
args.stable = nfsfh->is_sync?FILE_SYNC:UNSTABLE;
mdata->count = writecount;
memset(&args, 0, sizeof(WRITE3args));
- args.file.data.data_len = nfsfh->fh.data.data_len;
- args.file.data.data_val = nfsfh->fh.data.data_val;
+ args.file = nfsfh->fh;
args.offset = offset;
args.count = writecount;
args.stable = nfsfh->is_sync?FILE_SYNC:UNSTABLE;
data->private_data = private_data;
memset(&args, 0, sizeof(GETATTR3args));
- args.object.data.data_len = nfsfh->fh.data.data_len;
- args.object.data.data_val = nfsfh->fh.data.data_val;
+ args.object = nfsfh->fh;
if (rpc_nfs3_getattr_async(nfs->rpc, nfs_stat_1_cb, &args, data) != 0) {
rpc_set_error(nfs->rpc, "RPC error: Failed to send STAT GETATTR call for %s", data->path);
data->private_data = private_data;
memset(&args, 0, sizeof(SETATTR3args));
- args.object.data.data_len = nfsfh->fh.data.data_len;
- args.object.data.data_val = nfsfh->fh.data.data_val;
+ args.object = nfsfh->fh;
args.new_attributes.size.set_it = 1;
args.new_attributes.size.set_size3_u.size = length;
uint64_t offset = data->continue_int;
struct nfsfh nfsfh;
- nfsfh.fh.data.data_val = data->fh.data.data_val;
- nfsfh.fh.data.data_len = data->fh.data.data_len;
+ nfsfh.fh = data->fh;
if (nfs_ftruncate_async(nfs, &nfsfh, offset, data->cb, data->private_data) != 0) {
rpc_set_error(nfs->rpc, "RPC error: Failed to send SETATTR call for %s", data->path);
str = &str[strlen(str) + 1];
memset(&args, 0, sizeof(MKDIR3args));
- args.where.dir.data.data_len = data->fh.data.data_len;
- args.where.dir.data.data_val = data->fh.data.data_val;
+ args.where.dir = data->fh;
args.where.name = str;
args.attributes.mode.set_it = 1;
args.attributes.mode.set_mode3_u.mode = 0755;
}
memset(&args, 0, sizeof(LOOKUP3args));
- args.what.dir.data.data_len = data->fh.data.data_len;
- args.what.dir.data.data_val = data->fh.data.data_val;
- args.what.name = str;
+ args.what.dir = data->fh;
+ args.what.name = str;
if (rpc_nfs3_lookup_async(nfs->rpc, nfs_create_2_cb, &args, data) != 0) {
rpc_set_error(nfs->rpc, "RPC error: Failed to send lookup call for %s/%s", data->saved_path, str);
str = &str[strlen(str) + 1];
memset(&args, 0, sizeof(CREATE3args));
- args.where.dir.data.data_len = data->fh.data.data_len;
- args.where.dir.data.data_val = data->fh.data.data_val;
+ args.where.dir = data->fh;
args.where.name = str;
args.how.mode = UNCHECKED;
args.how.createhow3_u.obj_attributes.mode.set_it = 1;
args.dir = data->fh;
args.cookie = cookie;
- memcpy(&args.cookieverf, res->READDIR3res_u.resok.cookieverf, sizeof(cookieverf3));
+ memcpy(&args.cookieverf, res->READDIR3res_u.resok.cookieverf, sizeof(cookieverf3));
args.count = 8192;
if (rpc_nfs3_readdir_async(nfs->rpc, nfs_opendir2_cb, &args, data) != 0) {
rdpe_lookup_cb_data->nfsdirent = nfsdirent;
memset(&args, 0, sizeof(LOOKUP3args));
- args.what.dir.data.data_len = data->fh.data.data_len;
- args.what.dir.data.data_val = data->fh.data.data_val;
- args.what.name = nfsdirent->name;
+ args.what.dir = data->fh;
+ args.what.name = nfsdirent->name;
if (rpc_nfs3_lookup_async(nfs->rpc, nfs_opendir3_cb, &args, rdpe_lookup_cb_data) != 0) {
rpc_set_error(nfs->rpc, "RPC error: Failed to send READDIR LOOKUP call");
args.dir = data->fh;
args.cookie = cookie;
- memset(&args.cookieverf, 0, sizeof(cookieverf3));
+ memset(&args.cookieverf, 0, sizeof(cookieverf3));
args.count = 8192;
if (rpc_nfs3_readdir_async(nfs->rpc, nfs_opendir2_cb, &args, data) != 0) {
data->private_data = private_data;
memset(&args, 0, sizeof(GETATTR3args));
- args.object = nfsfh->fh;
+ args.object = nfsfh->fh;
if (rpc_nfs3_getattr_async(nfs->rpc, nfs_lseek_1_cb, &args, data) != 0) {
rpc_set_error(nfs->rpc, "RPC error: Failed to send LSEEK GETATTR call");
{
READLINK3args args;
- args.symlink.data.data_len = data->fh.data.data_len;
- args.symlink.data.data_val = data->fh.data.data_val;
+ args.symlink = data->fh;
if (rpc_nfs3_readlink_async(nfs->rpc, nfs_readlink_1_cb, &args, data) != 0) {
rpc_set_error(nfs->rpc, "RPC error: Failed to send READLINK call for %s", data->path);
SETATTR3args args;
memset(&args, 0, sizeof(SETATTR3args));
- args.object.data.data_len = data->fh.data.data_len;
- args.object.data.data_val = data->fh.data.data_val;
+ args.object = data->fh;
args.new_attributes.mode.set_it = 1;
args.new_attributes.mode.set_mode3_u.mode = data->continue_int;
struct nfs_chown_data *chown_data = data->continue_data;
memset(&args, 0, sizeof(SETATTR3args));
- args.object.data.data_len = data->fh.data.data_len;
- args.object.data.data_val = data->fh.data.data_val;
+ args.object = data->fh;
if (chown_data->uid != (uid_t)-1) {
args.new_attributes.uid.set_it = 1;
args.new_attributes.uid.set_uid3_u.uid = chown_data->uid;
struct timeval *utimes_data = data->continue_data;
memset(&args, 0, sizeof(SETATTR3args));
- args.object.data.data_len = data->fh.data.data_len;
- args.object.data.data_val = data->fh.data.data_val;
+ args.object = data->fh;
if (utimes_data != NULL) {
args.new_attributes.atime.set_it = SET_TO_CLIENT_TIME;
args.new_attributes.atime.set_atime_u.atime.seconds = utimes_data[0].tv_sec;
}
memset(&args, 0, sizeof(ACCESS3args));
- args.object.data.data_len = data->fh.data.data_len;
- args.object.data.data_val = data->fh.data.data_val;
+ args.object = data->fh;
args.access = nfsmode;
if (rpc_nfs3_access_async(nfs->rpc, nfs_access_cb, &args, data) != 0) {
SYMLINK3args args;
memset(&args, 0, sizeof(SYMLINK3args));
- args.where.dir.data.data_len = data->fh.data.data_len;
- args.where.dir.data.data_val = data->fh.data.data_val;
+ args.where.dir = data->fh;
args.where.name = symlink_data->newpathobject;
args.symlink.symlink_attributes.mode.set_it = 1;
args.symlink.symlink_attributes.mode.set_mode3_u.mode = S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IWGRP|S_IXGRP|S_IROTH|S_IWOTH|S_IXOTH;
RENAME3args args;
/* steal the filehandle */
- rename_data->newdir.data.data_len = data->fh.data.data_len;
- rename_data->newdir.data.data_val = data->fh.data.data_val;
+ rename_data->newdir = data->fh;
data->fh.data.data_val = NULL;
args.from.dir = rename_data->olddir;
struct nfs_rename_data *rename_data = data->continue_data;
/* steal the filehandle */
- rename_data->olddir.data.data_len = data->fh.data.data_len;
- rename_data->olddir.data.data_val = data->fh.data.data_val;
+ rename_data->olddir = data->fh;
data->fh.data.data_val = NULL;
if (nfs_lookuppath_async(nfs, rename_data->newpath, data->cb, data->private_data, nfs_rename_continue_2_internal, rename_data, free_nfs_rename_data, 0) != 0) {
LINK3args args;
/* steal the filehandle */
- link_data->newdir.data.data_len = data->fh.data.data_len;
- link_data->newdir.data.data_val = data->fh.data.data_val;
+ link_data->newdir = data->fh;
data->fh.data.data_val = NULL;
memset(&args, 0, sizeof(LINK3args));
struct nfs_link_data *link_data = data->continue_data;
/* steal the filehandle */
- link_data->oldfh.data.data_len = data->fh.data.data_len;
- link_data->oldfh.data.data_val = data->fh.data.data_val;
+ link_data->oldfh = data->fh;
data->fh.data.data_val = NULL;
if (nfs_lookuppath_async(nfs, link_data->newpath, data->cb, data->private_data, nfs_link_continue_2_internal, link_data, free_nfs_link_data, 0) != 0) {