aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJeffrey Hsu <hsu@FreeBSD.org>2003-07-09 22:23:10 +0000
committerJeffrey Hsu <hsu@FreeBSD.org>2003-07-09 22:23:10 +0000
commitb6f5d1d60349935a5749dd35390a41350418b99a (patch)
tree1a07527cca4200bfb3edf12437c566c174f73535 /sys
parentff56f15e26675d4286c0b9e6123060a8639b2cca (diff)
downloadsrc-b6f5d1d60349935a5749dd35390a41350418b99a.tar.gz
src-b6f5d1d60349935a5749dd35390a41350418b99a.zip
Replace custom field offset macro with the system __offsetof() macro.
Reviewed by: bde
Notes
Notes: svn path=/head/; revision=117365
Diffstat (limited to 'sys')
-rw-r--r--sys/sys/vnode.h17
1 files changed, 3 insertions, 14 deletions
diff --git a/sys/sys/vnode.h b/sys/sys/vnode.h
index 230d4d365746..2efaa38b0e9c 100644
--- a/sys/sys/vnode.h
+++ b/sys/sys/vnode.h
@@ -460,20 +460,9 @@ extern struct vnodeop_desc *vnodeop_descs[];
*/
extern struct mtx mntvnode_mtx;
-/*
- * This macro is very helpful in defining those offsets in the vdesc struct.
- *
- * This is stolen from X11R4. I ignored all the fancy stuff for
- * Crays, so if you decide to port this to such a serious machine,
- * you might want to consult Intrinsic.h's XtOffset{,Of,To}.
- */
-#define VOPARG_OFFSET(p_type,field) \
- ((int) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))
-#define VOPARG_OFFSETOF(s_type,field) \
- VOPARG_OFFSET(s_type*,field)
-#define VOPARG_OFFSETTO(S_TYPE,S_OFFSET,STRUCT_P) \
- ((S_TYPE)(((char*)(STRUCT_P))+(S_OFFSET)))
-
+#define VOPARG_OFFSETOF(s_type, field) __offsetof(s_type, field)
+#define VOPARG_OFFSETTO(s_type, s_offset, struct_p) \
+ ((s_type)(((char*)(struct_p)) + (s_offset)))
/*
* This structure is used to configure the new vnodeops vector.