* Author: Fan Yong <fanyong@clusterfs.com>
*/
-/*
- * lustre/libiam.h
- */
-
+/* lustre/libiam.h */
#ifndef __IAM_ULIB_H__
#define __IAM_ULIB_H__
-/** \defgroup libiam libiam
- *
- * @{
- */
-
-
#define DX_FMT_NAME_LEN 16
#define IAM_LFIX_ROOT_MAGIC 0xbedabb1edULL
};
enum iam_fmt_t {
- FMT_LFIX = 0,
- FMT_LVAR = 1
+ FMT_LFIX = 0,
+ FMT_LVAR = 1,
};
struct dx_countlimit {
}
struct iam_uapi_info {
- __u16 iui_keysize;
- __u16 iui_recsize;
- __u16 iui_ptrsize;
- __u16 iui_height;
- char iui_fmt_name[DX_FMT_NAME_LEN];
+ __u16 iui_keysize;
+ __u16 iui_recsize;
+ __u16 iui_ptrsize;
+ __u16 iui_height;
+ char iui_fmt_name[DX_FMT_NAME_LEN];
};
/*
* Return 0 if success, else -1.
*/
int iam_creat(char *filename, enum iam_fmt_t fmt,
- int blocksize, int keysize, int recsize, int ptrsize);
+ int blocksize, int keysize, int recsize, int ptrsize);
/*
* Open an iam file, but do NOT creat it if the file doesn't exist.
int iam_open(char *filename, struct iam_uapi_info *ua);
/*
- * Close file opened by iam_open.
+ * Close file opened by iam_open.
*/
int iam_close(int fd);
/*
* Please use iam_open before use this function.
*/
-int iam_insert(int fd, struct iam_uapi_info *ua,
- int key_need_convert, char *keybuf,
- int rec_need_convert, char *recbuf);
+int iam_insert(int fd, struct iam_uapi_info *ua, int key_need_convert,
+ char *keybuf, int rec_need_convert, char *recbuf);
/*
* Please use iam_open before use this function.
*/
int iam_lookup(int fd, struct iam_uapi_info *ua,
- int key_need_convert, char *key_buf,
- int *keysize, char *save_key,
- int rec_need_convert, char *rec_buf,
- int *recsize, char *save_rec);
+ int key_need_convert, char *key_buf, int *keysize,
+ char *save_key, int rec_need_convert, char *rec_buf,
+ int *recsize, char *save_rec);
/*
* Please use iam_open before use this function.
*/
-int iam_delete(int fd, struct iam_uapi_info *ua,
- int key_need_convert, char *keybuf,
- int rec_need_convert, char *recbuf);
+int iam_delete(int fd, struct iam_uapi_info *ua, int key_need_convert,
+ char *keybuf, int rec_need_convert, char *recbuf);
/*
* Please use iam_open before use this function.
*/
-int iam_it_start(int fd, struct iam_uapi_info *ua,
- int key_need_convert, char *key_buf,
- int *keysize, char *save_key,
- int rec_need_convert, char *rec_buf,
- int *recsize, char *save_rec);
+int iam_it_start(int fd, struct iam_uapi_info *ua, int key_need_convert,
+ char *key_buf, int *keysize, char *save_key,
+ int rec_need_convert, char *rec_buf, int *recsize,
+ char *save_rec);
/*
* Please use iam_open before use this function.
*/
-int iam_it_next(int fd, struct iam_uapi_info *ua,
- int key_need_convert, char *key_buf,
- int *keysize, char *save_key,
- int rec_need_convert, char *rec_buf,
- int *recsize, char *save_rec);
+int iam_it_next(int fd, struct iam_uapi_info *ua, int key_need_convert,
+ char *key_buf, int *keysize, char *save_key,
+ int rec_need_convert, char *rec_buf, int *recsize,
+ char *save_rec);
/*
* Please use iam_open before use this function.
*/
-int iam_it_stop(int fd, struct iam_uapi_info *ua,
- int key_need_convert, char *keybuf,
- int rec_need_convert, char *recbuf);
+int iam_it_stop(int fd, struct iam_uapi_info *ua, int key_need_convert,
+ char *keybuf, int rec_need_convert, char *recbuf);
/*
* Change iam file mode.
*/
int iam_polymorph(char *filename, unsigned long mode);
-/** @} libiam */
-
#endif
* BUILD_BUG_ON() is Compile-time check which verifies correctness at
* compile-time rather than runtime. If "cond" is true, (1 - 2*!!(cond))
* will be a negative value, which will cause the compiler to complain.
- *
*/
#ifndef BUILD_BUG_ON
#define BUILD_BUG_ON(cond) ((void)sizeof(char[1 - 2*!!(cond)]))
/* Currently external applications can access this but in the
* future this will no longer be exposed for the user. Instead
* if you want to know if the library is initialized just call
- * llapi_liblustreapi_initialized() which is now available. */
+ * llapi_liblustreapi_initialized() which is now available.
+ */
extern bool liblustreapi_initialized;
typedef void (*llapi_cb_t)(char *obd_type_name, char *obd_name, char *obd_uuid,
/* lustreapi message severity level */
enum llapi_message_level {
- LLAPI_MSG_OFF = 0,
- LLAPI_MSG_FATAL = 1,
- LLAPI_MSG_ERROR = 2,
- LLAPI_MSG_WARN = 3,
- LLAPI_MSG_NORMAL = 4,
- LLAPI_MSG_INFO = 5,
- LLAPI_MSG_DEBUG = 6,
- LLAPI_MSG_MAX
+ LLAPI_MSG_OFF = 0,
+ LLAPI_MSG_FATAL = 1,
+ LLAPI_MSG_ERROR = 2,
+ LLAPI_MSG_WARN = 3,
+ LLAPI_MSG_NORMAL = 4,
+ LLAPI_MSG_INFO = 5,
+ LLAPI_MSG_DEBUG = 6,
+ LLAPI_MSG_MAX
};
typedef void (*llapi_log_callback_t)(enum llapi_message_level level, int err,
time_t fp_mtime;
time_t fp_ctime;
/* {a,m,c,b}sign cannot be bitfields due to using pointers to
- * access them during argument parsing. */
+ * access them during argument parsing.
+ */
int fp_asign;
int fp_msign;
int fp_csign;
fp_newerxy:1,
fp_exclude_btime:1,
fp_exclude_perm:1,
- fp_stop_on_error:1, /* stop iteration on error */
+ fp_stop_on_error:1, /* stop iteration on err */
fp_exclude_nlink:1, /* Once used, we must add*/
fp_exclude_attrs:1, /* a separate flag field */
fp_unused_bit7:1; /* at end of struct. */
int llapi_swap_layouts(const char *path1, const char *path2, __u64 dv1,
__u64 dv2, __u64 flags);
-/* Changelog interface. priv is private state, managed internally by these
- * functions */
+/* Changelog interface. priv is private connection state, managed internally */
/* Records received are in extended format now, though most of them are still
* written in disk in changelog_rec format (to save space and time), it's