struct obd_ioctl_data;
int llog_print_cb(const struct lu_env *env, struct llog_handle *handle,
struct llog_rec_hdr *rec, void *data);
-int llog_ioctl(const struct lu_env *env, struct llog_ctxt *ctxt, int cmd,
- struct obd_ioctl_data *data);
+int llog_ioctl(const struct lu_env *env, struct llog_ctxt *ctxt,
+ unsigned int cmd, struct obd_ioctl_data *data);
int llog_catalog_list(const struct lu_env *env, struct dt_device *d,
int count, struct obd_ioctl_data *data,
const struct lu_fid *fid);
if (IS_ERR(lta))
RETURN(PTR_ERR(lta));
- task = kthread_run(lfsck_assistant_engine, lta, lad->lad_name);
+ task = kthread_run(lfsck_assistant_engine, lta, "%s", lad->lad_name);
if (IS_ERR(task)) {
rc = PTR_ERR(task);
CERROR("%s: cannot start LFSCK assistant thread for %s: "
.lgd_name = name,
.lgd_fid = ll_i2info(child->d_inode)->lli_fid,
#ifdef HAVE_DIR_CONTEXT
- .ctx.actor = ll_nfs_get_name_filldir,
+ .ctx.actor = (filldir_t)ll_nfs_get_name_filldir,
#endif
.lgd_found = 0,
};
&lds->lds_def_comp_entries[i];
CDEBUG(D_LAYOUT,
- "inherit "DFID" file layout from default: flags=%#x size=%hu nr=%u offset=%u pattern=%#x pool=%s\n",
+ "inherit "DFID" file layout from default: flags=%#x size=%u nr=%u offset=%u pattern=%#x pool=%s\n",
PFID(lu_object_fid(&lo->ldo_obj.do_lu)),
def_comp->llc_flags,
def_comp->llc_stripe_size,
thread->mgt_abort = false;
thread->mgt_init = true;
- task = kthread_run(func, thread, name);
+ task = kthread_run(func, thread, "%s", name);
if (IS_ERR(task)) {
complete(&thread->mgt_finished);
return PTR_ERR(task);
{
struct config_llog_instance lcfg = *cfg;
struct config_llog_data *cld;
+ bool is_server = IS_SERVER(s2lsi(sb));
char logname[32];
#ifdef HAVE_SERVER_SUPPORT
*/
LASSERT(strlen(fsname) < sizeof(logname) / 2);
strncpy(logname, fsname, sizeof(logname));
- if (IS_SERVER(s2lsi(sb))) { /* mdt */
- LASSERT(lcfg.cfg_instance == 0);
+
+ LASSERT(is_server ? lcfg.cfg_instance == 0 : lcfg.cfg_instance != 0);
+ if (is_server)
lcfg.cfg_instance = ll_get_cfg_instance(sb);
- strncat(logname, "-mdtir", sizeof(logname));
- } else {
- LASSERT(lcfg.cfg_instance != 0);
- strncat(logname, "-cliir", sizeof(logname));
- }
+ scnprintf(logname, sizeof(logname), "%s-%s", fsname,
+ is_server ? "mdtir" : "cliir");
cld = do_config_log_add(obd, logname, MGS_CFG_T_RECOVER, &lcfg, sb);
return cld;
if (max > OBD_MAX_RIF_MAX || max < 1)
return -ERANGE;
- CDEBUG(D_INFO, "%s: max = %hu max_mod = %u rif = %u\n",
+ CDEBUG(D_INFO, "%s: max = %u max_mod = %u rif = %u\n",
cli->cl_import->imp_obd->obd_name, max,
cli->cl_max_mod_rpcs_in_flight, cli->cl_max_rpcs_in_flight);
*/
if (max >= cli->cl_max_rpcs_in_flight) {
CDEBUG(D_INFO,
- "%s: increasing max_rpcs_in_flight=%hu to allow larger max_mod_rpcs_in_flight=%u\n",
+ "%s: increasing max_rpcs_in_flight=%u to allow larger max_mod_rpcs_in_flight=%u\n",
cli->cl_import->imp_obd->obd_name, max + 1, max);
obd_set_max_rpcs_in_flight(cli, max + 1);
}
RETURN(rc);
}
-int llog_ioctl(const struct lu_env *env, struct llog_ctxt *ctxt, int cmd,
- struct obd_ioctl_data *data)
+int llog_ioctl(const struct lu_env *env, struct llog_ctxt *ctxt,
+ unsigned int cmd, struct obd_ioctl_data *data)
{
struct llog_logid logid;
int rc = 0;
/**
* Invariant that has to be true all of the time.
*/
-static int osc_lock_invariant(struct osc_lock *ols)
+static inline int osc_lock_invariant(struct osc_lock *ols)
{
struct ldlm_lock *lock = osc_handle_ptr(&ols->ols_handle);
struct ldlm_lock *olock = ols->ols_dlmlock;
#ifdef HAVE_NR_UNSTABLE_NFS
/* Old kernels use a separate counter for unstable pages,
* newer kernels treat them like any other writeback.
+ * (see Linux commit: v5.7-467-g8d92890bd6b8)
*/
#define NR_WRITEBACK NR_UNSTABLE_NFS
#endif
}
if (count > 0) {
- mod_zone_page_state(zone, NR_WRITEBACK,
+ mod_zone_page_state(zone,
+ (enum zone_stat_item)NR_WRITEBACK,
factor * count);
count = 0;
}
++count;
}
if (count > 0)
- mod_zone_page_state(zone, NR_WRITEBACK, factor * count);
+ mod_zone_page_state(zone, (enum zone_stat_item)NR_WRITEBACK,
+ factor * count);
}
static inline void add_unstable_page_accounting(struct ptlrpc_bulk_desc *desc,
return;
}
- task = kthread_create(lwp_notify_main, exp, name);
+ task = kthread_create(lwp_notify_main, exp, "%s", name);
if (IS_ERR(task)) {
CERROR("Failed to start LWP notify thread:%s. %lu\n",
name, PTR_ERR(task));
* This empties the pre-creation pool and effectively blocks any new
* reservations.
*/
- LASSERTF(fid_oid(&d->opd_pre_last_created_fid) <= IDIF_MAX_OID,
- "%s: last_created_fid "DFID" > %llu\n",
- d->opd_obd->obd_name, PFID(&d->opd_pre_last_created_fid),
- IDIF_MAX_OID);
d->opd_pre_used_fid = d->opd_pre_last_created_fid;
d->opd_pre_create_slow = 0;
if ((body->oa.o_valid & OBD_MD_FLSIZE) && body->oa.o_size)
static int qsd_enabled_seq_show(struct seq_file *m, void *data)
{
- struct qsd_instance *qsd = m->private;
- char enabled[5];
+ struct qsd_instance *qsd = m->private;
+ char enabled[5] = "";
+ int types = 0;
LASSERT(qsd != NULL);
memset(enabled, 0, sizeof(enabled));
if (qsd_type_enabled(qsd, USRQUOTA))
- strncat(enabled, "u", sizeof(enabled) - strlen(enabled));
+ enabled[types++] = 'u';
if (qsd_type_enabled(qsd, GRPQUOTA))
- strncat(enabled, "g", sizeof(enabled) - strlen(enabled));
+ enabled[types++] = 'g';
if (qsd_type_enabled(qsd, PRJQUOTA))
- strncat(enabled, "p", sizeof(enabled) - strlen(enabled));
- if (strlen(enabled) == 0)
- strncat(enabled, "none", sizeof(enabled) - strlen(enabled));
+ enabled[types++] = 'p';
+ if (!types)
+ strncpy(enabled, "none", 4);
seq_printf(m, "%s\n", enabled);
return 0;
op->uop_params_off[i] = index;
}
- CDEBUG(D_INFO, "%huth "DFID" %s param_count = %u\n",
+ CDEBUG(D_INFO, "%uth "DFID" %s param_count = %u\n",
*op_count, PFID(fid), update_op_str(op_type), *param_count);
*op_count = *op_count + 1;
int main(int argc, char **argv)
{
- int rc;
+ ssize_t rc;
int fd;
void *volatile buf = (void *)0x4096000;
void *volatile fd_ptr;
if (rc != 2UL*1024*1024)
perror("write 2M");
- rc = write(fd, fd_ptr, 2UL*1024*1024*1024);
- if (rc != 2UL*1024*1024*1024)
- perror("write 2G");
+ rc = write(fd, fd_ptr, 1UL*(1024+512)*1024*1024);
+ if (rc != 1UL*(1024+512)*1024*1024)
+ perror("write 1.5G");
rc = write(fd, fd_ptr, -2);
if (rc != -2)