From: nikita Date: Wed, 29 Mar 2006 18:47:04 +0000 (+0000) Subject: add lfid_eq() function X-Git-Tag: v1_8_0_110~486^2~2131 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=20f6a782963630b238bfbe87ac2b0c52d345df15;p=fs%2Flustre-release.git add lfid_eq() function --- diff --git a/lustre/include/linux/lustre_idl.h b/lustre/include/linux/lustre_idl.h index 9d3a476..91e1ee7 100644 --- a/lustre/include/linux/lustre_idl.h +++ b/lustre/include/linux/lustre_idl.h @@ -58,6 +58,11 @@ #include /* + * CLASSERT() + */ +#include + +/* * this file contains all data structures used in Lustre interfaces: * - obdo and obd_request records * - mds_request records @@ -627,6 +632,15 @@ struct ll_fid { extern void lustre_swab_ll_fid (struct ll_fid *fid); +static inline int lfid_eq(const struct ll_fid *f0, const struct ll_fid *f1) +{ + /* check that there is no alignment padding */ + CLASSERT(sizeof *f0 == + sizeof f0->id + sizeof f0->generation + sizeof f0->f_type); + return memcmp(f0, f1, sizeof *f0) == 0; +} + + #define MDS_STATUS_CONN 1 #define MDS_STATUS_LOV 2 @@ -653,7 +667,7 @@ struct mds_body { __u64 ino; __u32 fsuid; __u32 fsgid; - __u32 capability; + __u32 capability; __u32 mode; __u32 uid; __u32 gid;