repositories
/
deb_libnfs.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add function to get root filehandle from a nfs context
[deb_libnfs.git]
/
lib
/
libnfs.c
diff --git
a/lib/libnfs.c
b/lib/libnfs.c
index 1f78ca8b8fe9dacc3cc108556271e1ed9f2ad933..8c7ad4e4476ca8ec2148ec9983079e89699cb455 100644
(file)
--- a/
lib/libnfs.c
+++ b/
lib/libnfs.c
@@
-459,7
+459,7
@@
static void nfs_mount_2_cb(struct rpc_context *rpc, int status, void *command_da
return;
}
return;
}
- if (rpc_pmap_getport_async(rpc, MOUNT_PROGRAM, MOUNT_V3, nfs_mount_3_cb, private_data) != 0) {
+ if (rpc_pmap_getport_async(rpc, MOUNT_PROGRAM, MOUNT_V3,
IPPROTO_TCP,
nfs_mount_3_cb, private_data) != 0) {
data->cb(-ENOMEM, nfs, command_data, data->private_data);
free_nfs_cb_data(data);
return;
data->cb(-ENOMEM, nfs, command_data, data->private_data);
free_nfs_cb_data(data);
return;
@@
-686,6
+686,9
@@
static void nfs_stat_1_cb(struct rpc_context *rpc _U_, int status, void *command
if (res->GETATTR3res_u.resok.obj_attributes.type == NF3DIR) {
st.st_mode |= S_IFDIR ;
}
if (res->GETATTR3res_u.resok.obj_attributes.type == NF3DIR) {
st.st_mode |= S_IFDIR ;
}
+ if (res->GETATTR3res_u.resok.obj_attributes.type == NF3REG) {
+ st.st_mode |= S_IFREG ;
+ }
st.st_nlink = res->GETATTR3res_u.resok.obj_attributes.nlink;
st.st_uid = res->GETATTR3res_u.resok.obj_attributes.uid;
st.st_gid = res->GETATTR3res_u.resok.obj_attributes.gid;
st.st_nlink = res->GETATTR3res_u.resok.obj_attributes.nlink;
st.st_uid = res->GETATTR3res_u.resok.obj_attributes.uid;
st.st_gid = res->GETATTR3res_u.resok.obj_attributes.gid;
@@
-3440,7
+3443,7
@@
static void mount_export_2_cb(struct rpc_context *rpc, int status, void *command
return;
}
return;
}
- if (rpc_pmap_getport_async(rpc, MOUNT_PROGRAM, MOUNT_V3, mount_export_3_cb, private_data) != 0) {
+ if (rpc_pmap_getport_async(rpc, MOUNT_PROGRAM, MOUNT_V3,
IPPROTO_TCP,
mount_export_3_cb, private_data) != 0) {
data->cb(rpc, -ENOMEM, command_data, data->private_data);
free_mount_cb_data(data);
return;
data->cb(rpc, -ENOMEM, command_data, data->private_data);
free_mount_cb_data(data);
return;
@@
-3509,3
+3512,6
@@
const char *nfs_get_export(struct nfs_context *nfs) {
return nfs->export;
}
return nfs->export;
}
+const struct nfs_fh3 *nfs_get_rootfh(struct nfs_context *nfs) {
+ return &nfs->rootfh;
+}