# include <linux/version.h>
# include <uapi/linux/lustre/lustre_fiemap.h>
#else /* !__KERNEL__ */
-# define NEED_QUOTA_DEFS
# include <limits.h>
# include <stdbool.h>
# include <stdio.h> /* snprintf() */
# include <string.h>
-# include <sys/quota.h>
+# define NEED_QUOTA_DEFS
+/* # include <sys/quota.h> - this causes complaints about caddr_t */
# include <sys/stat.h>
# include <linux/lustre/lustre_fiemap.h>
#endif /* __KERNEL__ */
"project", /* PRJQUOTA */ \
"undefined", \
};
+#ifndef USRQUOTA
+#define USRQUOTA 0
+#endif
+#ifndef GRPQUOTA
+#define GRPQUOTA 1
+#endif
+#ifndef PRJQUOTA
#define PRJQUOTA 2
+#endif
/*
* We need to always use 64bit version because the structure
/* To be compatible with old statically linked binary we keep the check for
* the older 0100000000 flag. This is already removed upstream. LU-812. */
#define O_LOV_DELAY_CREATE_1_8 0100000000 /* FMODE_NONOTIFY masked in 2.6.36 */
+#ifndef FASYNC
+#define FASYNC 00020000 /* fcntl, for BSD compatibility */
+#endif
#define O_LOV_DELAY_CREATE_MASK (O_NOCTTY | FASYNC)
#define O_LOV_DELAY_CREATE (O_LOV_DELAY_CREATE_1_8 | \
O_LOV_DELAY_CREATE_MASK)
return NULL;
}
-/* per-record flags */
+/* 12 bits of per-record data can be stored in the bottom of the flags */
#define CLF_FLAGSHIFT 12
-#define CLF_FLAGMASK ((1U << CLF_FLAGSHIFT) - 1)
-#define CLF_VERMASK (~CLF_FLAGMASK)
enum changelog_rec_flags {
CLF_VERSION = 0x1000,
CLF_RENAME = 0x2000,
CLF_JOBID = 0x4000,
CLF_EXTRA_FLAGS = 0x8000,
- CLF_SUPPORTED = CLF_VERSION | CLF_RENAME | CLF_JOBID | CLF_EXTRA_FLAGS
+ CLF_SUPPORTED = CLF_VERSION | CLF_RENAME | CLF_JOBID |
+ CLF_EXTRA_FLAGS,
+ CLF_FLAGMASK = (1U << CLF_FLAGSHIFT) - 1,
+ CLF_VERMASK = ~CLF_FLAGMASK,
};
CLF_HSM_EVENT_L);
}
-static inline void hsm_set_cl_event(int *flags, enum hsm_event he)
+static inline void hsm_set_cl_event(enum changelog_rec_flags *clf_flags,
+ enum hsm_event he)
{
- *flags |= (he << CLF_HSM_EVENT_L);
+ *clf_flags |= (he << CLF_HSM_EVENT_L);
}
-static inline __u16 hsm_get_cl_flags(int flags)
+static inline __u16 hsm_get_cl_flags(enum changelog_rec_flags clf_flags)
{
- return CLF_GET_BITS(flags, CLF_HSM_FLAG_H, CLF_HSM_FLAG_L);
+ return CLF_GET_BITS(clf_flags, CLF_HSM_FLAG_H, CLF_HSM_FLAG_L);
}
-static inline void hsm_set_cl_flags(int *flags, int bits)
+static inline void hsm_set_cl_flags(enum changelog_rec_flags *clf_flags,
+ unsigned int bits)
{
- *flags |= (bits << CLF_HSM_FLAG_L);
+ *clf_flags |= (bits << CLF_HSM_FLAG_L);
}
-static inline int hsm_get_cl_error(int flags)
+static inline int hsm_get_cl_error(enum changelog_rec_flags clf_flags)
{
- return CLF_GET_BITS(flags, CLF_HSM_ERR_H, CLF_HSM_ERR_L);
+ return CLF_GET_BITS(clf_flags, CLF_HSM_ERR_H, CLF_HSM_ERR_L);
}
-static inline void hsm_set_cl_error(int *flags, int error)
+static inline void hsm_set_cl_error(enum changelog_rec_flags *clf_flags,
+ unsigned int error)
{
- *flags |= (error << CLF_HSM_ERR_L);
+ *clf_flags |= (error << CLF_HSM_ERR_L);
}
enum changelog_rec_extra_flags {
__u32 padding;
};
-/* Changelog extra extension to include OPEN mode. */
+/* Changelog extra extension to include low 32 bits of MDS_OPEN_* flags. */
struct changelog_ext_openmode {
__u32 cr_openflags;
};
SK_CRYPT_INVALID = -1,
SK_CRYPT_EMPTY = 0,
SK_CRYPT_AES256_CTR = 1,
- SK_CRYPT_MAX = 2,
};
enum sk_hmac_alg {
SK_HMAC_EMPTY = 0,
SK_HMAC_SHA256 = 1,
SK_HMAC_SHA512 = 2,
- SK_HMAC_MAX = 3,
};
struct sk_crypt_type {
- char *sct_name;
- size_t sct_bytes;
+ const char *sct_name;
+ int sct_type;
};
struct sk_hmac_type {
- char *sht_name;
- size_t sht_bytes;
+ const char *sht_name;
+ int sht_type;
};
enum lock_mode_user {