X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Finclude%2Flinux%2Flustre_user.h;h=bc67a187df9293840516bfba231eedc0b7103e35;hb=4813fd9021a11e24521e76b708ce322c224df586;hp=2eba4859f942de4f1ce4c52380b48a6c7fcd93be;hpb=30c3a18963d1d6d70175fbbbdd9554e1eb2fa40d;p=fs%2Flustre-release.git diff --git a/lustre/include/linux/lustre_user.h b/lustre/include/linux/lustre_user.h index 2eba485..bc67a18 100644 --- a/lustre/include/linux/lustre_user.h +++ b/lustre/include/linux/lustre_user.h @@ -1,68 +1,88 @@ /* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*- * vim:expandtab:shiftwidth=8:tabstop=8: * - * Copyright (C) 2001 Cluster File Systems, Inc. - * - * This file is part of Lustre, http://www.lustre.org. - * - * Lustre is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. - * - * Lustre is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Lustre; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * This file is part of Lustre, http://www.lustre.org * * Lustre public user-space interface definitions. */ -#ifndef _LUSTRE_USER_H -#define _LUSTRE_USER_H +#ifndef _LINUX_LUSTRE_USER_H +#define _LINUX_LUSTRE_USER_H + +#ifdef HAVE_ASM_TYPES_H #include +#else +#include +#endif + -#define LL_IOC_GETFLAGS _IOR ('f', 151, long) -#define LL_IOC_SETFLAGS _IOW ('f', 152, long) -#define LL_IOC_CLRFLAGS _IOW ('f', 153, long) -#define LL_IOC_LOV_SETSTRIPE _IOW ('f', 154, long) -#define LL_IOC_LOV_GETSTRIPE _IOW ('f', 155, long) -#define LL_IOC_LOV_SETEA _IOW ('f', 156, long) -#define LL_IOC_RECREATE_OBJ _IOW ('f', 157, long) +#ifndef __KERNEL__ +# define NEED_QUOTA_DEFS +# ifdef HAVE_QUOTA_SUPPORT +# include +# endif +#else +# include +# ifdef HAVE_QUOTA_SUPPORT +# include +# endif +#endif -#define O_LOV_DELAY_CREATE 0100000000 /* hopefully this does not conflict */ +/* + * asm-x86_64/processor.h on some SLES 9 distros seems to use + * kernel-only typedefs. fortunately skipping it altogether is ok + * (for now). + */ +#define __ASM_X86_64_PROCESSOR_H -#define LL_FILE_IGNORE_LOCK 0x00000001 +#ifdef __KERNEL__ +#include +#else +#include +#include +#endif -#define LOV_USER_MAGIC_V1 0x0BD10BD0 -#define LOV_USER_MAGIC LOV_USER_MAGIC_V1 +#if defined(__x86_64__) || defined(__ia64__) || defined(__ppc64__) || \ + defined(__craynv) || defined (__mips64__) +typedef struct stat lstat_t; +#define lstat_f lstat +#define HAVE_LOV_USER_MDS_DATA +#elif defined(__USE_LARGEFILE64) || defined(__KERNEL__) +typedef struct stat64 lstat_t; +#define lstat_f lstat64 +#define HAVE_LOV_USER_MDS_DATA +#endif -#define LOV_PATTERN_RAID0 0x001 -#define LOV_PATTERN_RAID1 0x002 -#define LOV_PATTERN_FIRST 0x100 +#ifndef LPU64 +/* this is a bit chunky */ +#if defined(__KERNEL__) + #define _LWORDSIZE BITS_PER_LONG +#else + #define _LWORDSIZE __WORDSIZE +#endif +/* x86_64 defines __u64 as "long" in userspace, but "long long" in the kernel */ +#if (defined(__x86_64__) && (defined(__KERNEL__) || defined(CRAY_XT3))) +# define LPU64 "%Lu" +# define LPD64 "%Ld" +# define LPX64 "%#Lx" +# define LPSZ "%lu" +# define LPSSZ "%ld" +#elif (_LWORDSIZE == 32) +# define LPU64 "%Lu" +# define LPD64 "%Ld" +# define LPX64 "%#Lx" +# define LPSZ "%u" +# define LPSSZ "%d" +#elif (_LWORDSIZE == 64) +# define LPU64 "%lu" +# define LPD64 "%ld" +# define LPX64 "%#lx" +# define LPSZ "%lu" +# define LPSSZ "%ld" +#endif -#define lov_user_ost_data lov_user_ost_data_v1 -struct lov_user_ost_data_v1 { /* per-stripe data structure */ - __u64 l_object_id; /* OST object ID */ - __u64 l_object_gr; /* OST object group (creating MDS number) */ - __u32 l_ost_generation; /* generation of this OST index */ - __u16 l_ost_idx; /* OST index in LOV */ - __u16 l_reserved2; -} __attribute__((packed)); +#undef _LWORDSIZE -#define lov_user_md lov_user_md_v1 -struct lov_user_md_v1 { /* LOV EA user data (host-endian) */ - __u32 lmm_magic; /* magic number = LOV_USER_MAGIC_V1 */ - __u32 lmm_pattern; /* LOV_PATTERN_RAID0, LOV_PATTERN_RAID1 */ - __u64 lmm_object_id; /* LOV object ID */ - __u64 lmm_object_gr; /* LOV object group */ - __u32 lmm_stripe_size; /* size of stripe in bytes */ - __u16 lmm_stripe_count; /* num stripes in use for this object */ - __u16 lmm_stripe_offset; /* starting stripe offset in lmm_objects */ - struct lov_user_ost_data_v1 lmm_objects[0]; /* per-stripe data */ -} __attribute__((packed)); +#endif /* !LPU64 */ #endif /* _LUSTRE_USER_H */