int col = col_start;
int char_max;
int len;
- char fmt[6];
int count = 0;
int rc;
/* Add trailing spaces to pad the entry to the column size */
if (len < char_max) {
- snprintf(fmt, 6, "%%-%2ds", char_max - len);
snprintf(&buffer[col * char_max] + len,
- char_max - len + 1, fmt, " ");
+ char_max - len + 1, "%*s", char_max - len,
+ " ");
} else {
buffer[(col + 1) * char_max - 1] = ' ';
}
.mode = 0644,
.proc_handler = &proc_lnet_portal_rotor,
},
- { 0 }
+ { .procname = NULL }
};
void lnet_router_debugfs_init(void)
struct dt_device *lsi_dt_dev; /* dt device to access disk fs*/
atomic_t lsi_mounts; /* references to the srv_mnt */
char lsi_svname[MTI_NAME_MAXLEN];
- char lsi_osd_obdname[64];
- char lsi_osd_uuid[64];
+ /* lsi_osd_obdname format = 'lsi->ls_svname'-osd */
+ char lsi_osd_obdname[MTI_NAME_MAXLEN + 4];
+ /* lsi_osd_uuid format = 'lsi->ls_osd_obdname'_UUID */
+ char lsi_osd_uuid[MTI_NAME_MAXLEN + 9];
struct obd_export *lsi_osd_exp;
char lsi_osd_type[16];
char lsi_fstype[16];
data->ioc_inllen3 == sizeof(__u64) &&
data->ioc_inlbuf4 != NULL &&
data->ioc_inllen4 == sizeof(__u64)) {
- struct ost_id ostid;
+ struct ost_id ostid = { };
ostid_set_seq(&ostid, *(__u64 *)data->ioc_inlbuf4);
rc = ostid_set_id(&ostid, *(__u64 *)data->ioc_inlbuf3);
struct osd_oi **oi_table, unsigned oi_count, bool create)
{
struct scrub_file *sf = &osd->od_scrub.os_scrub.os_file;
- int count = 0;
- int rc = 0;
- int i;
+ int count = 0;
+ int rc = 0;
+ int i;
ENTRY;
/* NB: oi_count != 0 means that we have already created/known all OIs
LASSERT(oi_count <= OSD_OI_FID_NR_MAX);
for (i = 0; i < (oi_count != 0 ? oi_count : OSD_OI_FID_NR_MAX); i++) {
- char name[12];
+ char name[sizeof(OSD_OI_NAME_BASE) + 3 * sizeof(i) + 1];
if (oi_table[i] != NULL) {
count++;
continue;
}
- sprintf(name, "%s.%d", OSD_OI_NAME_BASE, i);
+ snprintf(name, sizeof(name), "%s.%d", OSD_OI_NAME_BASE, i);
rc = osd_oi_open(info, osd, name, &oi_table[i], create);
if (rc == 0) {
count++;
static const char *const lock_mode_names[] = LOCK_MODE_NAMES;
-static const char *const lockahead_results[] = {
- [LLA_RESULT_SENT] = "Lock request sent",
- [LLA_RESULT_DIFFERENT] = "Different matching lock found",
- [LLA_RESULT_SAME] = "Matching lock on identical extent found",
-};
-
int lfs_get_mode(const char *string)
{
enum lock_mode_user mode;
return rc;
srandom(tv.tv_usec);
- snprintf(new_fsname, 8, "%08x", (__u32)random());
- new_fsname[8] = '\0';
+ snprintf(new_fsname, sizeof(new_fsname), "%08x", (__u32)random());
rc = snapshot_get_mgsnode(si, buf, sizeof(buf));
if (rc)