From 97cc223e64dd27da7f5c153874b18c1955b78976 Mon Sep 17 00:00:00 2001 From: hsu Date: Wed, 9 Jul 2003 22:23:10 +0000 Subject: [PATCH] Replace custom field offset macro with the system __offsetof() macro. Reviewed by: bde --- sys/sys/vnode.h | 17 +++-------------- 1 file 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.