1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-02-02 11:09:29 +00:00

make sure the removal of cache does not fail if it has not been created.

add a patch from upstream that uses the 4.4 vflush semantics
This commit is contained in:
Assar Westerlund 2001-09-12 03:42:42 +00:00
parent 05cc4a8fd1
commit d42bfaff9a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=47730
3 changed files with 75 additions and 2 deletions

View File

@ -7,7 +7,7 @@
PORTNAME= arla
PORTVERSION= 0.35.5
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= net
MASTER_SITES= ftp://ftp.stacken.kth.se/pub/arla/

73
net/arla/files/patch-ab Normal file
View File

@ -0,0 +1,73 @@
Index: xfs/bsd/xfs_node-bsd.c
===================================================================
RCS file: /afs/stacken.kth.se/src/SourceRepository/arla/xfs/bsd/xfs_node-bsd.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -w -u -w -r1.54 -r1.55
--- xfs/bsd/xfs_node-bsd.c 2001/03/14 23:04:43 1.54
+++ xfs/bsd/xfs_node-bsd.c 2001/09/03 21:16:50 1.55
@@ -171,6 +171,20 @@
XFSDEB(XDEBNODE, ("free_xfs_node done\n"));
}
+/*
+ * FreeBSD 4.4 and newer changed to API to vflush around June 2001
+ */
+
+static int
+xfs_vflush(struct mount *mp, int flags)
+{
+#if __FreeBSD__ && __FreeBSD_version > 430000
+ return vflush(mp, 0, flags);
+#else
+ return vflush(mp, NULL, flags);
+#endif
+}
+
int
free_all_xfs_nodes(struct xfs *xfsp, int flags, int unmountp)
{
@@ -190,21 +204,36 @@
XFSDEB(XDEBNODE, ("free_all_xfs_nodes now removing root\n"));
vgone(XNODE_TO_VNODE(xfsp->root));
- xfsp->root = 0;
+ xfsp->root = NULL;
}
XFSDEB(XDEBNODE, ("free_all_xfs_nodes root removed\n"));
XFSDEB(XDEBNODE, ("free_all_xfs_nodes now killing all remaining nodes\n"));
+ /*
+ * If we have a syncer vnode, release it (to emulate dounmount)
+ * and the create it again when if we are going to need it.
+ */
+
#ifdef HAVE_STRUCT_MOUNT_MNT_SYNCER
if (!unmountp) {
- XFSDEB(XDEBNODE, ("free_all_xfs_nodes not flushing syncer vnode\n"));
- error = vflush(mp, mp->mnt_syncer, flags);
- } else
+ if (mp->mnt_syncer != NULL) {
+ vrele(mp->mnt_syncer);
+ mp->mnt_syncer = NULL;
+ }
+ }
#endif
- {
- error = vflush(mp, NULL, flags);
+ error = xfs_vflush(mp, flags);
+#ifdef HAVE_STRUCT_MOUNT_MNT_SYNCER
+ if (!unmountp) {
+ XFSDEB(XDEBNODE, ("free_all_xfs_nodes not flushing syncer vnode\n"));
+ if (mp->mnt_syncer == NULL)
+ if (vfs_allocate_syncvnode(mp)) {
+ panic("failed to allocate syncer node when xfs daemon died");
+
}
+ }
+#endif
if (error) {
XFSDEB(XDEBNODE, ("xfree_all_xfs_nodes: vflush() error == %d\n",

View File

@ -103,4 +103,4 @@ sbin/xfs_makedev
@dirrm include/afs
@dirrm include/rx
@dirrm include/ss
@dirrm cache
@unexec rmdir cache 2>/dev/null || true