#include <libcfs/util/string.h>
#include <lnet/lnetctl.h>
#include <lustre/lustreapi.h>
+#include <lustre/lustre_ostid.h>
#include <lustre_ioctl.h>
#include "lustreapi_internal.h"
static int llapi_msg_level = LLAPI_MSG_MAX;
+char *mdt_hash_name[] = { "none",
+ LMV_HASH_NAME_ALL_CHARS,
+ LMV_HASH_NAME_FNV_1A_64 };
+
void llapi_msg_set_level(int level)
{
/* ensure level is in the good range */
/* show all information default */
if (!verbose) {
if (lum->lum_magic == LMV_USER_MAGIC)
- verbose = VERBOSE_POOL | VERBOSE_COUNT | VERBOSE_OFFSET;
+ verbose = VERBOSE_POOL | VERBOSE_COUNT |
+ VERBOSE_OFFSET | VERBOSE_HASH_TYPE;
else
verbose = VERBOSE_OBJID;
}
llapi_printf(LLAPI_MSG_NORMAL, "lmv_stripe_offset: ");
llapi_printf(LLAPI_MSG_NORMAL, "%d",
(int)lum->lum_stripe_offset);
+ if (verbose & VERBOSE_HASH_TYPE)
+ separator = " ";
+ else
+ separator = "\n";
+ }
+
+ if (verbose & VERBOSE_HASH_TYPE) {
+ unsigned int type = lum->lum_hash_type;
+
+ llapi_printf(LLAPI_MSG_NORMAL, "%s", separator);
+ if (verbose & ~VERBOSE_HASH_TYPE)
+ llapi_printf(LLAPI_MSG_NORMAL, "lmv_hash_type: ");
+ if (type < LMV_HASH_TYPE_MAX)
+ llapi_printf(LLAPI_MSG_NORMAL, "%s",
+ mdt_hash_name[type]);
+ else
+ llapi_printf(LLAPI_MSG_NORMAL, "%d",
+ (int)type);
separator = "\n";
}
{
struct obd_statfs stat_buf;
struct obd_uuid uuid_buf;
- int ret;
+ int ret;
- LASSERT(type == LL_STATFS_LOV || type == LL_STATFS_LMV);
+ if (type != LL_STATFS_LOV && type != LL_STATFS_LMV)
+ return -EINVAL;
memset(&stat_buf, 0, sizeof(struct obd_statfs));
memset(&uuid_buf, 0, sizeof(struct obd_uuid));
int checked_type = 0;
int ret = 0;
- LASSERT(parent != NULL || dir != NULL);
+ if (parent == NULL && dir == NULL)
+ return -EINVAL;
param->fp_lmd->lmd_lmm.lmm_stripe_count = 0;
char *filename;
bool retry = false;
- LASSERT(parent != NULL || dirp != NULL);
+ if (parent == NULL && dirp == NULL)
+ return -EINVAL;
+
if (dirp != NULL)
closedir(*dirp);
int llapi_mv(char *path, struct find_param *param)
{
-#if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(2, 9, 53, 0)
+#if LUSTRE_VERSION_CODE > OBD_OCD_VERSION(2, 9, 59, 0)
static bool printed;
if (!printed) {
int ret;
int mdtidx;
- LASSERT(parent != NULL || d != NULL);
+ if (parent == NULL && d == NULL)
+ return -EINVAL;
if (d != NULL) {
ret = llapi_file_fget_mdtidx(dirfd(d), &mdtidx);
DIR *d = dirp == NULL ? NULL : *dirp;
int ret = 0;
- LASSERT(parent != NULL || d != NULL);
+ if (parent == NULL && d == NULL)
+ return -EINVAL;
if (param->fp_obd_uuid) {
param->fp_quiet = 1;