2 * Copyright (c) 2007-2008 The DragonFly Project. All rights reserved.
4 * This code is derived from software contributed to The DragonFly Project
5 * by Matthew Dillon <dillon@backplane.com>
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
11 * 1. Redistributions of source code must retain the above copyright
12 * notice, this list of conditions and the following disclaimer.
13 * 2. Redistributions in binary form must reproduce the above copyright
14 * notice, this list of conditions and the following disclaimer in
15 * the documentation and/or other materials provided with the
17 * 3. Neither the name of The DragonFly Project nor the names of its
18 * contributors may be used to endorse or promote products derived
19 * from this software without specific, prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25 * COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26 * INCIDENTAL, SPECIAL, EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING,
27 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
29 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
30 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
31 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * $DragonFly: src/sys/vfs/hammer/hammer_vfsops.c,v 1.38 2008/06/03 18:47:25 dillon Exp $
37 #include <sys/param.h>
38 #include <sys/systm.h>
39 #include <sys/kernel.h>
40 #include <sys/vnode.h>
41 #include <sys/mount.h>
42 #include <sys/malloc.h>
43 #include <sys/nlookup.h>
44 #include <sys/fcntl.h>
45 #include <sys/sysctl.h>
51 int hammer_debug_general;
52 int hammer_debug_debug;
53 int hammer_debug_inode;
54 int hammer_debug_locks;
55 int hammer_debug_btree;
57 int hammer_debug_recover; /* -1 will disable, +1 will force */
58 int hammer_debug_recover_faults;
59 int hammer_count_inodes;
60 int hammer_count_records;
61 int hammer_count_record_datas;
62 int hammer_count_volumes;
63 int hammer_count_buffers;
64 int hammer_count_nodes;
65 int hammer_count_dirtybufs; /* global */
66 int hammer_limit_dirtybufs = 100; /* per-mount */
68 int64_t hammer_contention_count;
69 int64_t hammer_zone_limit;
71 SYSCTL_NODE(_vfs, OID_AUTO, hammer, CTLFLAG_RW, 0, "HAMMER filesystem");
72 SYSCTL_INT(_vfs_hammer, OID_AUTO, debug_general, CTLFLAG_RW,
73 &hammer_debug_general, 0, "");
74 SYSCTL_INT(_vfs_hammer, OID_AUTO, debug_io, CTLFLAG_RW,
75 &hammer_debug_io, 0, "");
76 SYSCTL_INT(_vfs_hammer, OID_AUTO, debug_debug, CTLFLAG_RW,
77 &hammer_debug_debug, 0, "");
78 SYSCTL_INT(_vfs_hammer, OID_AUTO, debug_inode, CTLFLAG_RW,
79 &hammer_debug_inode, 0, "");
80 SYSCTL_INT(_vfs_hammer, OID_AUTO, debug_locks, CTLFLAG_RW,
81 &hammer_debug_locks, 0, "");
82 SYSCTL_INT(_vfs_hammer, OID_AUTO, debug_btree, CTLFLAG_RW,
83 &hammer_debug_btree, 0, "");
84 SYSCTL_INT(_vfs_hammer, OID_AUTO, debug_tid, CTLFLAG_RW,
85 &hammer_debug_tid, 0, "");
86 SYSCTL_INT(_vfs_hammer, OID_AUTO, debug_recover, CTLFLAG_RW,
87 &hammer_debug_recover, 0, "");
88 SYSCTL_INT(_vfs_hammer, OID_AUTO, debug_recover_faults, CTLFLAG_RW,
89 &hammer_debug_recover_faults, 0, "");
91 SYSCTL_INT(_vfs_hammer, OID_AUTO, limit_dirtybufs, CTLFLAG_RW,
92 &hammer_limit_dirtybufs, 0, "");
94 SYSCTL_INT(_vfs_hammer, OID_AUTO, count_inodes, CTLFLAG_RD,
95 &hammer_count_inodes, 0, "");
96 SYSCTL_INT(_vfs_hammer, OID_AUTO, count_records, CTLFLAG_RD,
97 &hammer_count_records, 0, "");
98 SYSCTL_INT(_vfs_hammer, OID_AUTO, count_record_datas, CTLFLAG_RD,
99 &hammer_count_record_datas, 0, "");
100 SYSCTL_INT(_vfs_hammer, OID_AUTO, count_volumes, CTLFLAG_RD,
101 &hammer_count_volumes, 0, "");
102 SYSCTL_INT(_vfs_hammer, OID_AUTO, count_buffers, CTLFLAG_RD,
103 &hammer_count_buffers, 0, "");
104 SYSCTL_INT(_vfs_hammer, OID_AUTO, count_nodes, CTLFLAG_RD,
105 &hammer_count_nodes, 0, "");
106 SYSCTL_INT(_vfs_hammer, OID_AUTO, count_dirtybufs, CTLFLAG_RD,
107 &hammer_count_dirtybufs, 0, "");
108 SYSCTL_QUAD(_vfs_hammer, OID_AUTO, zone_limit, CTLFLAG_RW,
109 &hammer_zone_limit, 0, "");
110 SYSCTL_QUAD(_vfs_hammer, OID_AUTO, contention_count, CTLFLAG_RW,
111 &hammer_contention_count, 0, "");
116 static void hammer_free_hmp(struct mount *mp);
118 static int hammer_vfs_mount(struct mount *mp, char *path, caddr_t data,
120 static int hammer_vfs_unmount(struct mount *mp, int mntflags);
121 static int hammer_vfs_root(struct mount *mp, struct vnode **vpp);
122 static int hammer_vfs_statfs(struct mount *mp, struct statfs *sbp,
124 static int hammer_vfs_statvfs(struct mount *mp, struct statvfs *sbp,
126 static int hammer_vfs_sync(struct mount *mp, int waitfor);
127 static int hammer_vfs_vget(struct mount *mp, ino_t ino,
129 static int hammer_vfs_init(struct vfsconf *conf);
130 static int hammer_vfs_fhtovp(struct mount *mp, struct fid *fhp,
132 static int hammer_vfs_vptofh(struct vnode *vp, struct fid *fhp);
133 static int hammer_vfs_checkexp(struct mount *mp, struct sockaddr *nam,
134 int *exflagsp, struct ucred **credanonp);
137 static struct vfsops hammer_vfsops = {
138 .vfs_mount = hammer_vfs_mount,
139 .vfs_unmount = hammer_vfs_unmount,
140 .vfs_root = hammer_vfs_root,
141 .vfs_statfs = hammer_vfs_statfs,
142 .vfs_statvfs = hammer_vfs_statvfs,
143 .vfs_sync = hammer_vfs_sync,
144 .vfs_vget = hammer_vfs_vget,
145 .vfs_init = hammer_vfs_init,
146 .vfs_vptofh = hammer_vfs_vptofh,
147 .vfs_fhtovp = hammer_vfs_fhtovp,
148 .vfs_checkexp = hammer_vfs_checkexp
151 MALLOC_DEFINE(M_HAMMER, "hammer-mount", "hammer mount");
153 VFS_SET(hammer_vfsops, hammer, 0);
154 MODULE_VERSION(hammer, 1);
157 hammer_vfs_init(struct vfsconf *conf)
159 /*hammer_init_alist_config();*/
164 hammer_vfs_mount(struct mount *mp, char *mntpt, caddr_t data,
167 struct hammer_mount_info info;
169 hammer_volume_t rootvol;
170 struct vnode *rootvp;
171 const char *upath; /* volume name in userspace */
172 char *path; /* volume name in system space */
176 if ((error = copyin(data, &info, sizeof(info))) != 0)
178 if ((mp->mnt_flag & MNT_UPDATE) == 0) {
179 if (info.nvolumes <= 0 || info.nvolumes >= 32768)
184 * Interal mount data structure
186 if (mp->mnt_flag & MNT_UPDATE) {
187 hmp = (void *)mp->mnt_data;
188 KKASSERT(hmp != NULL);
190 hmp = kmalloc(sizeof(*hmp), M_HAMMER, M_WAITOK | M_ZERO);
191 mp->mnt_data = (qaddr_t)hmp;
193 hmp->zbuf = kmalloc(HAMMER_BUFSIZE, M_HAMMER, M_WAITOK|M_ZERO);
194 hmp->namekey_iterator = mycpu->gd_time_seconds;
195 /*TAILQ_INIT(&hmp->recycle_list);*/
197 hmp->root_btree_beg.localization = HAMMER_MIN_LOCALIZATION;
198 hmp->root_btree_beg.obj_id = -0x8000000000000000LL;
199 hmp->root_btree_beg.key = -0x8000000000000000LL;
200 hmp->root_btree_beg.create_tid = 1;
201 hmp->root_btree_beg.delete_tid = 1;
202 hmp->root_btree_beg.rec_type = 0;
203 hmp->root_btree_beg.obj_type = 0;
205 hmp->root_btree_end.localization = HAMMER_MAX_LOCALIZATION;
206 hmp->root_btree_end.obj_id = 0x7FFFFFFFFFFFFFFFLL;
207 hmp->root_btree_end.key = 0x7FFFFFFFFFFFFFFFLL;
208 hmp->root_btree_end.create_tid = 0xFFFFFFFFFFFFFFFFULL;
209 hmp->root_btree_end.delete_tid = 0; /* special case */
210 hmp->root_btree_end.rec_type = 0xFFFFU;
211 hmp->root_btree_end.obj_type = 0;
212 lockinit(&hmp->blockmap_lock, "blkmap", 0, 0);
214 hmp->sync_lock.refs = 1;
215 hmp->free_lock.refs = 1;
217 TAILQ_INIT(&hmp->flush_list);
218 TAILQ_INIT(&hmp->objid_cache_list);
219 TAILQ_INIT(&hmp->undo_lru_list);
222 * Set default zone limits. This value can be reduced
223 * further by the zone limit specified in the root volume.
225 * The sysctl can force a small zone limit for debugging
228 for (i = 0; i < HAMMER_MAX_ZONES; ++i) {
229 hmp->zone_limits[i] =
230 HAMMER_ZONE_ENCODE(i, HAMMER_ZONE_LIMIT);
232 if (hammer_zone_limit) {
233 hmp->zone_limits[i] =
234 HAMMER_ZONE_ENCODE(i, hammer_zone_limit);
236 hammer_init_holes(hmp, &hmp->holes[i]);
239 hmp->hflags &= ~HMNT_USERFLAGS;
240 hmp->hflags |= info.hflags & HMNT_USERFLAGS;
243 mp->mnt_flag |= MNT_RDONLY;
244 hmp->asof = info.asof;
246 hmp->asof = HAMMER_MAX_TID;
250 * Re-open read-write if originally read-only, or vise-versa.
252 if (mp->mnt_flag & MNT_UPDATE) {
254 if (hmp->ronly && (mp->mnt_kern_flag & MNTK_WANTRDWR)) {
255 kprintf("HAMMER read-only -> read-write\n");
257 RB_SCAN(hammer_vol_rb_tree, &hmp->rb_vols_root, NULL,
258 hammer_adjust_volume_mode, NULL);
259 rootvol = hammer_get_root_volume(hmp, &error);
261 hammer_recover_flush_buffers(hmp, rootvol);
262 hammer_rel_volume(rootvol, 0);
264 RB_SCAN(hammer_ino_rb_tree, &hmp->rb_inos_root, NULL,
265 hammer_reload_inode, NULL);
266 /* kernel clears MNT_RDONLY */
267 } else if (hmp->ronly == 0 && (mp->mnt_flag & MNT_RDONLY)) {
268 kprintf("HAMMER read-write -> read-only\n");
269 hmp->ronly = 1; /* messy */
270 RB_SCAN(hammer_ino_rb_tree, &hmp->rb_inos_root, NULL,
271 hammer_reload_inode, NULL);
273 hammer_flusher_sync(hmp);
274 hammer_flusher_sync(hmp);
275 hammer_flusher_sync(hmp);
277 RB_SCAN(hammer_vol_rb_tree, &hmp->rb_vols_root, NULL,
278 hammer_adjust_volume_mode, NULL);
283 RB_INIT(&hmp->rb_vols_root);
284 RB_INIT(&hmp->rb_inos_root);
285 RB_INIT(&hmp->rb_nods_root);
286 RB_INIT(&hmp->rb_undo_root);
287 hmp->ronly = ((mp->mnt_flag & MNT_RDONLY) != 0);
289 TAILQ_INIT(&hmp->volu_list);
290 TAILQ_INIT(&hmp->undo_list);
291 TAILQ_INIT(&hmp->data_list);
292 TAILQ_INIT(&hmp->meta_list);
293 TAILQ_INIT(&hmp->lose_list);
298 path = objcache_get(namei_oc, M_WAITOK);
299 hmp->nvolumes = info.nvolumes;
300 for (i = 0; i < info.nvolumes; ++i) {
301 error = copyin(&info.volumes[i], &upath, sizeof(char *));
303 error = copyinstr(upath, path, MAXPATHLEN, NULL);
305 error = hammer_install_volume(hmp, path);
309 objcache_put(namei_oc, path);
312 * Make sure we found a root volume
314 if (error == 0 && hmp->rootvol == NULL) {
315 kprintf("hammer_mount: No root volume found!\n");
324 * No errors, setup enough of the mount point so we can lookup the
327 mp->mnt_iosize_max = MAXPHYS;
328 mp->mnt_kern_flag |= MNTK_FSMID;
331 * note: f_iosize is used by vnode_pager_haspage() when constructing
334 mp->mnt_stat.f_iosize = HAMMER_BUFSIZE;
335 mp->mnt_stat.f_bsize = HAMMER_BUFSIZE;
337 mp->mnt_vstat.f_frsize = HAMMER_BUFSIZE;
338 mp->mnt_vstat.f_bsize = HAMMER_BUFSIZE;
340 mp->mnt_maxsymlinklen = 255;
341 mp->mnt_flag |= MNT_LOCAL;
343 vfs_add_vnodeops(mp, &hammer_vnode_vops, &mp->mnt_vn_norm_ops);
344 vfs_add_vnodeops(mp, &hammer_spec_vops, &mp->mnt_vn_spec_ops);
345 vfs_add_vnodeops(mp, &hammer_fifo_vops, &mp->mnt_vn_fifo_ops);
348 * The root volume's ondisk pointer is only valid if we hold a
351 rootvol = hammer_get_root_volume(hmp, &error);
356 * Perform any necessary UNDO operations. The recover code does
357 * call hammer_undo_lookup() so we have to pre-cache the blockmap,
358 * and then re-copy it again after recovery is complete.
360 * The recovery code will load hmp->flusher_undo_start.
362 * If this is a read-only mount the UNDO information is retained
363 * in memory in the form of dirty buffer cache buffers, and not
364 * written back to the media.
366 bcopy(rootvol->ondisk->vol0_blockmap, hmp->blockmap,
367 sizeof(hmp->blockmap));
369 error = hammer_recover(hmp, rootvol);
371 kprintf("Failed to recover HAMMER filesystem on mount\n");
376 * Finish setup now that we have a good root volume
378 ksnprintf(mp->mnt_stat.f_mntfromname,
379 sizeof(mp->mnt_stat.f_mntfromname), "%s",
380 rootvol->ondisk->vol_name);
381 mp->mnt_stat.f_fsid.val[0] =
382 crc32((char *)&rootvol->ondisk->vol_fsid + 0, 8);
383 mp->mnt_stat.f_fsid.val[1] =
384 crc32((char *)&rootvol->ondisk->vol_fsid + 8, 8);
386 mp->mnt_vstat.f_fsid_uuid = rootvol->ondisk->vol_fsid;
387 mp->mnt_vstat.f_fsid = crc32(&mp->mnt_vstat.f_fsid_uuid,
388 sizeof(mp->mnt_vstat.f_fsid_uuid));
391 * Certain often-modified fields in the root volume are cached in
392 * the hammer_mount structure so we do not have to generate lots
393 * of little UNDO structures for them.
395 * Recopy after recovery.
397 hmp->next_tid = rootvol->ondisk->vol0_next_tid;
398 bcopy(rootvol->ondisk->vol0_blockmap, hmp->blockmap,
399 sizeof(hmp->blockmap));
400 hmp->copy_stat_freebigblocks = rootvol->ondisk->vol0_stat_freebigblocks;
403 * Use the zone limit set by newfs_hammer, or the zone limit set by
404 * sysctl (for debugging), whichever is smaller.
406 if (rootvol->ondisk->vol0_zone_limit) {
407 hammer_off_t vol0_zone_limit;
409 vol0_zone_limit = rootvol->ondisk->vol0_zone_limit;
410 for (i = 0; i < HAMMER_MAX_ZONES; ++i) {
411 if (hmp->zone_limits[i] > vol0_zone_limit)
412 hmp->zone_limits[i] = vol0_zone_limit;
416 hammer_flusher_create(hmp);
419 * Locate the root directory using the root cluster's B-Tree as a
420 * starting point. The root directory uses an obj_id of 1.
422 * FUTURE: Leave the root directory cached referenced but unlocked
423 * in hmp->rootvp (need to flush it on unmount).
425 error = hammer_vfs_vget(mp, 1, &rootvp);
429 /*vn_unlock(hmp->rootvp);*/
432 hammer_rel_volume(rootvol, 0);
435 * Cleanup and return.
443 hammer_vfs_unmount(struct mount *mp, int mntflags)
446 struct hammer_mount *hmp = (void *)mp->mnt_data;
452 * Clean out the vnodes
455 if (mntflags & MNT_FORCE)
457 if ((error = vflush(mp, 0, flags)) != 0)
461 * Clean up the internal mount structure and related entities. This
469 * Clean up the internal mount structure and disassociate it from the mount.
470 * This may issue I/O.
473 hammer_free_hmp(struct mount *mp)
475 struct hammer_mount *hmp = (void *)mp->mnt_data;
480 * Clean up the root vnode
487 hammer_flusher_sync(hmp);
488 hammer_flusher_sync(hmp);
489 hammer_flusher_destroy(hmp);
491 KKASSERT(RB_EMPTY(&hmp->rb_inos_root));
495 * Unload & flush inodes
497 * XXX illegal to call this from here, it can only be done from
500 RB_SCAN(hammer_ino_rb_tree, &hmp->rb_inos_root, NULL,
501 hammer_unload_inode, (void *)MNT_WAIT);
504 * Unload & flush volumes
510 RB_SCAN(hammer_vol_rb_tree, &hmp->rb_vols_root, NULL,
511 hammer_unload_volume, NULL);
514 mp->mnt_flag &= ~MNT_LOCAL;
516 hammer_destroy_objid_cache(hmp);
517 kfree(hmp->zbuf, M_HAMMER);
518 lockuninit(&hmp->blockmap_lock);
520 for (i = 0; i < HAMMER_MAX_ZONES; ++i)
521 hammer_free_holes(hmp, &hmp->holes[i]);
523 kfree(hmp, M_HAMMER);
527 * Obtain a vnode for the specified inode number. An exclusively locked
531 hammer_vfs_vget(struct mount *mp, ino_t ino, struct vnode **vpp)
533 struct hammer_transaction trans;
534 struct hammer_mount *hmp = (void *)mp->mnt_data;
535 struct hammer_inode *ip;
538 hammer_simple_transaction(&trans, hmp);
541 * Lookup the requested HAMMER inode. The structure must be
542 * left unlocked while we manipulate the related vnode to avoid
545 ip = hammer_get_inode(&trans, NULL, ino, hmp->asof, 0, &error);
550 error = hammer_get_vnode(ip, vpp);
551 hammer_rel_inode(ip, 0);
552 hammer_done_transaction(&trans);
557 * Return the root vnode for the filesystem.
559 * HAMMER stores the root vnode in the hammer_mount structure so
560 * getting it is easy.
563 hammer_vfs_root(struct mount *mp, struct vnode **vpp)
566 struct hammer_mount *hmp = (void *)mp->mnt_data;
570 error = hammer_vfs_vget(mp, 1, vpp);
575 hammer_vfs_statfs(struct mount *mp, struct statfs *sbp, struct ucred *cred)
577 struct hammer_mount *hmp = (void *)mp->mnt_data;
578 hammer_volume_t volume;
579 hammer_volume_ondisk_t ondisk;
583 volume = hammer_get_root_volume(hmp, &error);
586 ondisk = volume->ondisk;
591 mp->mnt_stat.f_files = ondisk->vol0_stat_inodes;
592 bfree = ondisk->vol0_stat_freebigblocks * HAMMER_LARGEBLOCK_SIZE;
593 hammer_rel_volume(volume, 0);
595 mp->mnt_stat.f_bfree = bfree / HAMMER_BUFSIZE;
596 mp->mnt_stat.f_bavail = mp->mnt_stat.f_bfree;
597 if (mp->mnt_stat.f_files < 0)
598 mp->mnt_stat.f_files = 0;
605 hammer_vfs_statvfs(struct mount *mp, struct statvfs *sbp, struct ucred *cred)
607 struct hammer_mount *hmp = (void *)mp->mnt_data;
608 hammer_volume_t volume;
609 hammer_volume_ondisk_t ondisk;
613 volume = hammer_get_root_volume(hmp, &error);
616 ondisk = volume->ondisk;
621 mp->mnt_vstat.f_files = ondisk->vol0_stat_inodes;
622 bfree = ondisk->vol0_stat_freebigblocks * HAMMER_LARGEBLOCK_SIZE;
623 hammer_rel_volume(volume, 0);
625 mp->mnt_vstat.f_bfree = bfree / HAMMER_BUFSIZE;
626 mp->mnt_vstat.f_bavail = mp->mnt_stat.f_bfree;
627 if (mp->mnt_vstat.f_files < 0)
628 mp->mnt_vstat.f_files = 0;
629 *sbp = mp->mnt_vstat;
634 * Sync the filesystem. Currently we have to run it twice, the second
635 * one will advance the undo start index to the end index, so if a crash
636 * occurs no undos will be run on mount.
638 * We do not sync the filesystem if we are called from a panic. If we did
639 * we might end up blowing up a sync that was already in progress.
642 hammer_vfs_sync(struct mount *mp, int waitfor)
644 struct hammer_mount *hmp = (void *)mp->mnt_data;
647 if (panicstr == NULL) {
648 error = hammer_sync_hmp(hmp, waitfor);
650 error = hammer_sync_hmp(hmp, waitfor);
659 * Convert a vnode to a file handle.
662 hammer_vfs_vptofh(struct vnode *vp, struct fid *fhp)
666 KKASSERT(MAXFIDSZ >= 16);
668 fhp->fid_len = offsetof(struct fid, fid_data[16]);
669 fhp->fid_reserved = 0;
670 bcopy(&ip->obj_id, fhp->fid_data + 0, sizeof(ip->obj_id));
671 bcopy(&ip->obj_asof, fhp->fid_data + 8, sizeof(ip->obj_asof));
677 * Convert a file handle back to a vnode.
680 hammer_vfs_fhtovp(struct mount *mp, struct fid *fhp, struct vnode **vpp)
682 struct hammer_transaction trans;
683 struct hammer_inode *ip;
684 struct hammer_inode_info info;
687 bcopy(fhp->fid_data + 0, &info.obj_id, sizeof(info.obj_id));
688 bcopy(fhp->fid_data + 8, &info.obj_asof, sizeof(info.obj_asof));
690 hammer_simple_transaction(&trans, (void *)mp->mnt_data);
693 * Get/allocate the hammer_inode structure. The structure must be
694 * unlocked while we manipulate the related vnode to avoid a
697 ip = hammer_get_inode(&trans, NULL, info.obj_id, info.obj_asof,
703 error = hammer_get_vnode(ip, vpp);
704 hammer_rel_inode(ip, 0);
705 hammer_done_transaction(&trans);
710 hammer_vfs_checkexp(struct mount *mp, struct sockaddr *nam,
711 int *exflagsp, struct ucred **credanonp)
713 hammer_mount_t hmp = (void *)mp->mnt_data;
717 np = vfs_export_lookup(mp, &hmp->export, nam);
719 *exflagsp = np->netc_exflags;
720 *credanonp = &np->netc_anon;
730 hammer_vfs_export(struct mount *mp, int op, const struct export_args *export)
732 hammer_mount_t hmp = (void *)mp->mnt_data;
736 case MOUNTCTL_SET_EXPORT:
737 error = vfs_export(mp, &hmp->export, export);