forked from fuse4x/kext
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fuse_kludges.c
37 lines (31 loc) · 1.31 KB
/
fuse_kludges.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
* Copyright (C) 2006-2008 Google. All Rights Reserved.
* Amit Singh <singh@>
*/
#include "fuse_kludges.h"
#include <libkern/version.h>
#if M_FUSE4X_ENABLE_EXCHANGE
extern void
fuse_kludge_exchange(vnode_t v1, vnode_t v2)
{
if (version_major > 9) {
char *tmp_v_name = ((struct fuse_kludge_vnode_10 *)v1)->v_name;
((struct fuse_kludge_vnode_10 *)v1)->v_name =
((struct fuse_kludge_vnode_10 *)v2)->v_name;
((struct fuse_kludge_vnode_10 *)v2)->v_name = tmp_v_name;
vnode_t tmp_v_parent = ((struct fuse_kludge_vnode_10 *)v1)->v_parent;
((struct fuse_kludge_vnode_10 *)v1)->v_parent =
((struct fuse_kludge_vnode_10 *)v2)->v_parent;
((struct fuse_kludge_vnode_10 *)v2)->v_parent = tmp_v_parent;
} else {
char *tmp_v_name = ((struct fuse_kludge_vnode_9 *)v1)->v_name;
((struct fuse_kludge_vnode_9 *)v1)->v_name =
((struct fuse_kludge_vnode_9 *)v2)->v_name;
((struct fuse_kludge_vnode_9 *)v2)->v_name = tmp_v_name;
vnode_t tmp_v_parent = ((struct fuse_kludge_vnode_9 *)v1)->v_parent;
((struct fuse_kludge_vnode_9 *)v1)->v_parent =
((struct fuse_kludge_vnode_9 *)v2)->v_parent;
((struct fuse_kludge_vnode_9 *)v2)->v_parent = tmp_v_parent;
}
}
#endif /* M_FUSE4X_ENABLE_EXCHANGE */