mdadm: Do not reimplment offsetof
Proper implementations have offsetof in stddef.h Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
parent
06e293d097
commit
04f903b21a
5
Grow.c
5
Grow.c
|
@ -24,6 +24,7 @@
|
||||||
#include "mdadm.h"
|
#include "mdadm.h"
|
||||||
#include "dlink.h"
|
#include "dlink.h"
|
||||||
#include <sys/mman.h>
|
#include <sys/mman.h>
|
||||||
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
|
@ -34,10 +35,6 @@
|
||||||
#include "md_u.h"
|
#include "md_u.h"
|
||||||
#include "md_p.h"
|
#include "md_p.h"
|
||||||
|
|
||||||
#ifndef offsetof
|
|
||||||
#define offsetof(t,f) ((size_t)&(((t*)0)->f))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int restore_backup(struct supertype *st,
|
int restore_backup(struct supertype *st,
|
||||||
struct mdinfo *content,
|
struct mdinfo *content,
|
||||||
int working_disks,
|
int working_disks,
|
||||||
|
|
|
@ -30,6 +30,7 @@
|
||||||
#include "mdmon.h"
|
#include "mdmon.h"
|
||||||
#include "sha1.h"
|
#include "sha1.h"
|
||||||
#include <values.h>
|
#include <values.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
/* a non-official T10 name for creation GUIDs */
|
/* a non-official T10 name for creation GUIDs */
|
||||||
static char T10[] = "Linux-MD";
|
static char T10[] = "Linux-MD";
|
||||||
|
@ -536,10 +537,6 @@ static int init_super_ddf_bvd(struct supertype *st,
|
||||||
char *name, char *homehost,
|
char *name, char *homehost,
|
||||||
int *uuid, unsigned long long data_offset);
|
int *uuid, unsigned long long data_offset);
|
||||||
|
|
||||||
#ifndef offsetof
|
|
||||||
#define offsetof(t,f) ((size_t)&(((t*)0)->f))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
static void pr_state(struct ddf_super *ddf, const char *msg)
|
static void pr_state(struct ddf_super *ddf, const char *msg)
|
||||||
{
|
{
|
||||||
|
|
4
super1.c
4
super1.c
|
@ -22,6 +22,7 @@
|
||||||
* Email: <neilb@suse.de>
|
* Email: <neilb@suse.de>
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <stddef.h>
|
||||||
#include "mdadm.h"
|
#include "mdadm.h"
|
||||||
/*
|
/*
|
||||||
* The version-1 superblock :
|
* The version-1 superblock :
|
||||||
|
@ -133,9 +134,6 @@ struct misc_dev_info {
|
||||||
|MD_FEATURE_NEW_OFFSET \
|
|MD_FEATURE_NEW_OFFSET \
|
||||||
)
|
)
|
||||||
|
|
||||||
#ifndef offsetof
|
|
||||||
#define offsetof(t,f) ((size_t)&(((t*)0)->f))
|
|
||||||
#endif
|
|
||||||
static unsigned int calc_sb_1_csum(struct mdp_superblock_1 * sb)
|
static unsigned int calc_sb_1_csum(struct mdp_superblock_1 * sb)
|
||||||
{
|
{
|
||||||
unsigned int disk_csum, csum;
|
unsigned int disk_csum, csum;
|
||||||
|
|
Loading…
Reference in New Issue