Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/cddl/osnet/dist/uts/common/fs/zfs Implement zfsctl_...
details: https://anonhg.NetBSD.org/src/rev/4c7aa27e4891
branches: trunk
changeset: 997662:4c7aa27e4891
user: hannken <hannken%NetBSD.org@localhost>
date: Mon Mar 18 09:21:31 2019 +0000
description:
Implement zfsctl_lookup_objset() to look up "zfsvfs" of an mounted snapshot.
diffstat:
external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ctldir.c | 17 ++++++++++++++++-
1 files changed, 16 insertions(+), 1 deletions(-)
diffs (28 lines):
diff -r 050541758e45 -r 4c7aa27e4891 external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ctldir.c
--- a/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ctldir.c Mon Mar 18 09:20:58 2019 +0000
+++ b/external/cddl/osnet/dist/uts/common/fs/zfs/zfs_ctldir.c Mon Mar 18 09:21:31 2019 +0000
@@ -1946,8 +1946,23 @@
int
zfsctl_lookup_objset(vfs_t *vfsp, uint64_t objsetid, zfsvfs_t **zfsvfsp)
{
+ struct sfs_node_key key = {
+ .parent_id = ZFSCTL_INO_SNAPDIR,
+ .id = objsetid
+ };
+ vnode_t *vp;
+ int error;
- return EINVAL;
+ *zfsvfsp = NULL;
+ error = vcache_get(vfsp, &key, sizeof(key), &vp);
+ if (error == 0) {
+ if (vp->v_mountedhere)
+ *zfsvfsp = vp->v_mountedhere->mnt_data;
+ vrele(vp);
+ }
+ if (*zfsvfsp == NULL)
+ return SET_ERROR(EINVAL);
+ return 0;
}
int
Home |
Main Index |
Thread Index |
Old Index