Remove OBD macros that are simply redefinitions
of CFS macros.
Also, convert some spaces to tabs.
Test-Parameters: trivial
Signed-off-by: Timothy Day <timday@amazon.com>
Signed-off-by: Ben Evans <beevans@whamcloud.com>
Change-Id: Icb4f25f51515d833fed2c05581288cde719c1d08
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51124
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
/* force the caller to try sync io. this can jump the list
* of queued writes and create a discontiguous rpc stream */
/* force the caller to try sync io. this can jump the list
* of queued writes and create a discontiguous rpc stream */
- if (OBD_FAIL_CHECK(OBD_FAIL_OSC_NO_GRANT) ||
+ if (CFS_FAIL_CHECK(OBD_FAIL_OSC_NO_GRANT) ||
cli->cl_dirty_max_pages == 0 ||
cli->cl_ar.ar_force_sync || loi->loi_ar.ar_force_sync) {
OSC_DUMP_GRANT(D_CACHE, cli, "forced sync i/o\n");
cli->cl_dirty_max_pages == 0 ||
cli->cl_ar.ar_force_sync || loi->loi_ar.ar_force_sync) {
OSC_DUMP_GRANT(D_CACHE, cli, "forced sync i/o\n");
- OBD_FAIL_TIMEOUT(OBD_FAIL_OSC_SLOW_PAGE_EVICT,
+ CFS_FAIL_TIMEOUT(OBD_FAIL_OSC_SLOW_PAGE_EVICT,
cfs_fail_val ?: 20);
if (io->ci_type == CIT_MISC &&
cfs_fail_val ?: 20);
if (io->ci_type == CIT_MISC &&
- OBD_FAIL_TIMEOUT(OBD_FAIL_OSC_DELAY_SETTIME, 1);
+ CFS_FAIL_TIMEOUT(OBD_FAIL_OSC_DELAY_SETTIME, 1);
cl_object_attr_lock(obj);
attr->cat_mtime = attr->cat_ctime = ktime_get_real_seconds();
rc = cl_object_attr_update(env, obj, attr, CAT_MTIME | CAT_CTIME);
cl_object_attr_lock(obj);
attr->cat_mtime = attr->cat_ctime = ktime_get_real_seconds();
rc = cl_object_attr_update(env, obj, attr, CAT_MTIME | CAT_CTIME);
unlock_res_and_lock(dlmlock);
unlock_res_and_lock(dlmlock);
- OBD_FAIL_TIMEOUT(OBD_FAIL_OSC_DELAY_CANCEL, 5);
+ CFS_FAIL_TIMEOUT(OBD_FAIL_OSC_DELAY_CANCEL, 5);
/* if l_ast_data is NULL, the dlmlock was enqueued by AGL or
* the object has been destroyed. */
/* if l_ast_data is NULL, the dlmlock was enqueued by AGL or
* the object has been destroyed. */
dlmlock = NULL;
if (obj == NULL && res->lr_type == LDLM_EXTENT) {
dlmlock = NULL;
if (obj == NULL && res->lr_type == LDLM_EXTENT) {
- if (OBD_FAIL_CHECK(OBD_FAIL_OSC_NO_SIZE_DATA))
+ if (CFS_FAIL_CHECK(OBD_FAIL_OSC_NO_SIZE_DATA))
if (osc_lock_is_lockless(oscl)) {
oio->oi_lockless = 1;
} else if (!async) {
if (osc_lock_is_lockless(oscl)) {
oio->oi_lockless = 1;
} else if (!async) {
- if (OBD_FAIL_PRECHECK(OBD_FAIL_PTLRPC_IDLE_RACE)) {
- OBD_RACE(OBD_FAIL_PTLRPC_IDLE_RACE);
+ if (CFS_FAIL_PRECHECK(OBD_FAIL_PTLRPC_IDLE_RACE)) {
+ CFS_RACE(OBD_FAIL_PTLRPC_IDLE_RACE);
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(cfs_time_seconds(1) / 2);
}
set_current_state(TASK_UNINTERRUPTIBLE);
schedule_timeout(cfs_time_seconds(1) / 2);
}
/* corrupt the data before we compute the checksum, to
* simulate an OST->client data error */
if (unlikely(i == 0 && opc == OST_READ &&
/* corrupt the data before we compute the checksum, to
* simulate an OST->client data error */
if (unlikely(i == 0 && opc == OST_READ &&
- OBD_FAIL_CHECK(OBD_FAIL_OSC_CHECKSUM_RECEIVE))) {
+ CFS_FAIL_CHECK(OBD_FAIL_OSC_CHECKSUM_RECEIVE))) {
unsigned char *ptr = kmap(pga[i]->pg);
memcpy(ptr + off, "bad1", min_t(typeof(nob), 4, nob));
unsigned char *ptr = kmap(pga[i]->pg);
memcpy(ptr + off, "bad1", min_t(typeof(nob), 4, nob));
/* For sending we only compute the wrong checksum instead
* of corrupting the data so it is still correct on a redo */
if (opc == OST_WRITE &&
/* For sending we only compute the wrong checksum instead
* of corrupting the data so it is still correct on a redo */
if (opc == OST_WRITE &&
- OBD_FAIL_CHECK(OBD_FAIL_OSC_CHECKSUM_SEND))
+ CFS_FAIL_CHECK(OBD_FAIL_OSC_CHECKSUM_SEND))
cksum++;
*check_sum = cksum;
cksum++;
*check_sum = cksum;
/* corrupt the data before we compute the checksum, to
* simulate an OST->client data error */
if (i == 0 && opc == OST_READ &&
/* corrupt the data before we compute the checksum, to
* simulate an OST->client data error */
if (i == 0 && opc == OST_READ &&
- OBD_FAIL_CHECK(OBD_FAIL_OSC_CHECKSUM_RECEIVE)) {
+ CFS_FAIL_CHECK(OBD_FAIL_OSC_CHECKSUM_RECEIVE)) {
unsigned char *ptr = kmap(pga[i]->pg);
int off = pga[i]->off & ~PAGE_MASK;
unsigned char *ptr = kmap(pga[i]->pg);
int off = pga[i]->off & ~PAGE_MASK;
/* For sending we only compute the wrong checksum instead
* of corrupting the data so it is still correct on a redo */
/* For sending we only compute the wrong checksum instead
* of corrupting the data so it is still correct on a redo */
- if (opc == OST_WRITE && OBD_FAIL_CHECK(OBD_FAIL_OSC_CHECKSUM_SEND))
+ if (opc == OST_WRITE && CFS_FAIL_CHECK(OBD_FAIL_OSC_CHECKSUM_SEND))
if (clpage->cp_type == CPT_TRANSIENT)
directio = true;
}
if (clpage->cp_type == CPT_TRANSIENT)
directio = true;
}
- if (OBD_FAIL_CHECK(OBD_FAIL_OSC_BRW_PREP_REQ))
+ if (CFS_FAIL_CHECK(OBD_FAIL_OSC_BRW_PREP_REQ))
RETURN(-ENOMEM); /* Recoverable */
RETURN(-ENOMEM); /* Recoverable */
- if (OBD_FAIL_CHECK(OBD_FAIL_OSC_BRW_PREP_REQ2))
+ if (CFS_FAIL_CHECK(OBD_FAIL_OSC_BRW_PREP_REQ2))
RETURN(-EINVAL); /* Fatal */
if ((cmd & OBD_BRW_WRITE) != 0) {
RETURN(-EINVAL); /* Fatal */
if ((cmd & OBD_BRW_WRITE) != 0) {
if (inode && IS_ENCRYPTED(inode) &&
llcrypt_has_encryption_key(inode) &&
if (inode && IS_ENCRYPTED(inode) &&
llcrypt_has_encryption_key(inode) &&
- !OBD_FAIL_CHECK(OBD_FAIL_LFSCK_NO_ENCFLAG)) {
+ !CFS_FAIL_CHECK(OBD_FAIL_LFSCK_NO_ENCFLAG)) {
if ((body->oa.o_valid & OBD_MD_FLFLAGS) == 0) {
body->oa.o_valid |= OBD_MD_FLFLAGS;
body->oa.o_flags = 0;
if ((body->oa.o_valid & OBD_MD_FLFLAGS) == 0) {
body->oa.o_valid |= OBD_MD_FLFLAGS;
body->oa.o_flags = 0;
cmd == OBD_BRW_READ ? "read" : "write", starting_offset,
ending_offset, cli->cl_r_in_flight, cli->cl_w_in_flight);
}
cmd == OBD_BRW_READ ? "read" : "write", starting_offset,
ending_offset, cli->cl_r_in_flight, cli->cl_w_in_flight);
}
- OBD_FAIL_TIMEOUT(OBD_FAIL_OSC_DELAY_IO, cfs_fail_val);
+ CFS_FAIL_TIMEOUT(OBD_FAIL_OSC_DELAY_IO, cfs_fail_val);
ptlrpcd_add_req(req);
rc = 0;
ptlrpcd_add_req(req);
rc = 0;
ldlm_lock_addref(lockh, mode);
/* Let cl_lock_state_wait fail with -ERESTARTSYS to unuse sublocks. */
ldlm_lock_addref(lockh, mode);
/* Let cl_lock_state_wait fail with -ERESTARTSYS to unuse sublocks. */
- OBD_FAIL_TIMEOUT(OBD_FAIL_LDLM_ENQUEUE_HANG, 2);
+ CFS_FAIL_TIMEOUT(OBD_FAIL_LDLM_ENQUEUE_HANG, 2);
/* Let CP AST to grant the lock first. */
/* Let CP AST to grant the lock first. */
- OBD_FAIL_TIMEOUT(OBD_FAIL_OSC_CP_ENQ_RACE, 1);
+ CFS_FAIL_TIMEOUT(OBD_FAIL_OSC_CP_ENQ_RACE, 1);
if (aa->oa_speculative) {
LASSERT(aa->oa_lvb == NULL);
if (aa->oa_speculative) {
LASSERT(aa->oa_lvb == NULL);
rc = osc_enqueue_fini(req, aa->oa_upcall, aa->oa_cookie, lockh, mode,
aa->oa_flags, aa->oa_speculative, rc);
rc = osc_enqueue_fini(req, aa->oa_upcall, aa->oa_cookie, lockh, mode,
aa->oa_flags, aa->oa_speculative, rc);
- OBD_FAIL_TIMEOUT(OBD_FAIL_OSC_CP_CANCEL_RACE, 10);
+ CFS_FAIL_TIMEOUT(OBD_FAIL_OSC_CP_CANCEL_RACE, 10);
ldlm_lock_decref(lockh, mode);
LDLM_LOCK_PUT(lock);
ldlm_lock_decref(lockh, mode);
LDLM_LOCK_PUT(lock);
enum ldlm_mode rc;
ENTRY;
enum ldlm_mode rc;
ENTRY;
- if (OBD_FAIL_CHECK(OBD_FAIL_OSC_MATCH))
+ if (CFS_FAIL_CHECK(OBD_FAIL_OSC_MATCH))
RETURN(-EIO);
/* Filesystem lock extents are extended to page boundaries so that
RETURN(-EIO);
/* Filesystem lock extents are extended to page boundaries so that
u32 keylen, void *key, u32 vallen, void *val,
struct ptlrpc_request_set *set)
{
u32 keylen, void *key, u32 vallen, void *val,
struct ptlrpc_request_set *set)
{
- struct ptlrpc_request *req;
- struct obd_device *obd = exp->exp_obd;
- struct obd_import *imp = class_exp2cliimp(exp);
- char *tmp;
- int rc;
- ENTRY;
+ struct ptlrpc_request *req;
+ struct obd_device *obd = exp->exp_obd;
+ struct obd_import *imp = class_exp2cliimp(exp);
+ char *tmp;
+ int rc;
+ ENTRY;
- OBD_FAIL_TIMEOUT(OBD_FAIL_OSC_SHUTDOWN, 10);
+ CFS_FAIL_TIMEOUT(OBD_FAIL_OSC_SHUTDOWN, 10);
- if (KEY_IS(KEY_CHECKSUM)) {
- if (vallen != sizeof(int))
- RETURN(-EINVAL);
- exp->exp_obd->u.cli.cl_checksum = (*(int *)val) ? 1 : 0;
- RETURN(0);
- }
+ if (KEY_IS(KEY_CHECKSUM)) {
+ if (vallen != sizeof(int))
+ RETURN(-EINVAL);
+ exp->exp_obd->u.cli.cl_checksum = (*(int *)val) ? 1 : 0;
+ RETURN(0);
+ }
- if (KEY_IS(KEY_SPTLRPC_CONF)) {
- sptlrpc_conf_client_adapt(obd);
- RETURN(0);
- }
+ if (KEY_IS(KEY_SPTLRPC_CONF)) {
+ sptlrpc_conf_client_adapt(obd);
+ RETURN(0);
+ }
- if (KEY_IS(KEY_FLUSH_CTX)) {
- sptlrpc_import_flush_my_ctx(imp);
- RETURN(0);
- }
+ if (KEY_IS(KEY_FLUSH_CTX)) {
+ sptlrpc_import_flush_my_ctx(imp);
+ RETURN(0);
+ }
if (KEY_IS(KEY_CACHE_LRU_SHRINK)) {
struct client_obd *cli = &obd->u.cli;
if (KEY_IS(KEY_CACHE_LRU_SHRINK)) {
struct client_obd *cli = &obd->u.cli;
- if (!set && !KEY_IS(KEY_GRANT_SHRINK))
- RETURN(-EINVAL);
+ if (!set && !KEY_IS(KEY_GRANT_SHRINK))
+ RETURN(-EINVAL);
- /* We pass all other commands directly to OST. Since nobody calls osc
- methods directly and everybody is supposed to go through LOV, we
- assume lov checked invalid values for us.
- The only recognised values so far are evict_by_nid and mds_conn.
- Even if something bad goes through, we'd get a -EINVAL from OST
- anyway. */
+ /*
+ * We pass all other commands directly to OST. Since nobody calls osc
+ * methods directly and everybody is supposed to go through LOV, we
+ * assume lov checked invalid values for us.
+ * The only recognised values so far are evict_by_nid and mds_conn.
+ * Even if something bad goes through, we'd get a -EINVAL from OST
+ * anyway.
+ */
req = ptlrpc_request_alloc(imp, KEY_IS(KEY_GRANT_SHRINK) ?
&RQF_OST_SET_GRANT_INFO :
req = ptlrpc_request_alloc(imp, KEY_IS(KEY_GRANT_SHRINK) ?
&RQF_OST_SET_GRANT_INFO :