/* Shared key */
enum sk_crypt_alg {
- SK_CRYPT_INVALID = -1,
SK_CRYPT_EMPTY = 0,
SK_CRYPT_AES256_CTR = 1,
+ SK_CRYPT_INVALID = __UINT16_MAX__
};
enum sk_hmac_alg {
- SK_HMAC_INVALID = -1,
SK_HMAC_EMPTY = 0,
SK_HMAC_SHA256 = 1,
SK_HMAC_SHA512 = 2,
+ SK_HMAC_INVALID = __UINT16_MAX__
};
struct sk_crypt_type {
}
if (config->skc_type & SK_TYPE_SERVER) {
/* Server keys need to have the file system name in the key */
- if (!config->skc_fsname) {
+ if (config->skc_fsname[0] == '\0') {
printerr(0, "Key configuration has no file system "
"attribute. Can't load as server type\n");
goto out;
}
if (config->skc_type & SK_TYPE_CLIENT) {
/* Load client file system key */
- if (config->skc_fsname) {
+ if (config->skc_fsname[0] != '\0') {
rc = snprintf(description, SK_DESCRIPTION_SIZE,
"lustre:%s", config->skc_fsname);
if (rc >= SK_DESCRIPTION_SIZE)
}
#define FP_DEFAULT_TIME_MARGIN (24 * 60 * 60)
-static time_t set_time(struct find_param *param, time_t *time, time_t *set,
- char *str)
+static int set_time(struct find_param *param, time_t *time, time_t *set,
+ char *str)
{
long long t = 0;
int sign = 0;
fprintf(stderr,
"%s find: bad time string '%s': %s\n",
progname, timebuf, strerror(EINVAL));
- return LONG_MAX;
+ return INT_MAX;
}
if (param->fp_time_margin == 0 ||
str--;
fprintf(stderr, "%s find: bad time '%s': too large\n",
progname, str);
- return LONG_MAX;
+ return INT_MAX;
}
*set = *time - t;
param.fp_exclude_mtime = !!neg_opt;
}
rc = set_time(¶m, &t, xtime, optarg);
- if (rc == LONG_MAX) {
+ if (rc == INT_MAX) {
ret = -1;
goto err;
}
else
printf(" %7s %7s %7s %7s", "-", "-", "-", "-");
printf("\n");
- } else if (qctl->qc_cmd == LUSTRE_Q_GETINFO || LUSTRE_Q_GETINFOPOOL ||
+ } else if (qctl->qc_cmd == LUSTRE_Q_GETINFO ||
+ qctl->qc_cmd == LUSTRE_Q_GETINFOPOOL ||
qctl->qc_cmd == Q_GETOINFO) {
char bgtimebuf[40];
char igtimebuf[40];
(__s16)lum->lmm_stripe_count);
}
} else {
- llapi_printf(LLAPI_MSG_NORMAL, "%hd",
+ llapi_printf(LLAPI_MSG_NORMAL, "%i",
extension ? 0 :
(__s16)lum->lmm_stripe_count);
}
* belonging to these mirror will be collected.
* \param[in] ids_nr number of mirror ids array.
*
- * \retval number of component info collected on sucess or
+ * \retval number of component info collected on success or
* an error code on failure.
*/
int llapi_mirror_find_stale(struct llapi_layout *layout,
return -rc;
while (pos < end) {
- uint64_t mirror_end;
+ uint64_t mirror_end = LUSTRE_EOF;
ssize_t bytes_read;
size_t to_read;
size_t to_write;
/* This check validates if the last argument is really a device name
* and does not start with char '-'.
*/
- if ((argv[argc - 1][0] == '-'))
+ if (argv[argc - 1][0] == '-')
return 1;
else
return 0;
*/
if (strstr(record, add_pool))
lpd->lpd_ost_num++;
- } else if (lpd->lpd_ostname && lpd->lpd_ostname[0]) {
+ } else if (lpd->lpd_ostname[0] != '\0') {
if (strstr(record, lpd->lpd_ostname)) {
lpd->lpd_pool_exists = true;
if (strstr(record, add_pool)) {