Whamcloud - gitweb
LU-16002 ptlrpc: adds configurable ping interval
[fs/lustre-release.git] / lustre / target / out_lib.c
index cf0cb2f..05987a7 100644 (file)
@@ -43,7 +43,7 @@
 
 const char *update_op_str(__u16 opc)
 {
-       static const char *opc_str[] = {
+       static const char *const opc_str[] = {
                [OUT_START] = "start",
                [OUT_CREATE] = "create",
                [OUT_DESTROY] = "destroy",
@@ -670,10 +670,6 @@ int out_attr_set_add_exec(const struct lu_env *env, struct dt_object *dt_obj,
        if (rc != 0)
                return rc;
 
-       if (attr->la_valid & LA_FLAGS &&
-           attr->la_flags & LUSTRE_SET_SYNC_FL)
-               th->th_sync |= 1;
-
        arg = tx_add_exec(ta, out_tx_attr_set_exec, out_tx_attr_set_undo,
                          file, line);
        if (IS_ERR(arg))
@@ -754,7 +750,8 @@ static int out_tx_xattr_set_exec(const struct lu_env *env,
               dt_obd_name(th->th_dev), arg->u.xattr_set.buf.lb_buf,
               arg->u.xattr_set.name, arg->u.xattr_set.flags);
 
-       if (!lu_object_exists(&dt_obj->do_lu)) {
+       if (!lu_object_exists(&dt_obj->do_lu) ||
+           OBD_FAIL_PRECHECK(OBD_FAIL_OUT_OBJECT_MISS)) {
                rc = -ENOENT;
        } else {
                struct linkea_data ldata = { 0 };
@@ -1072,7 +1069,7 @@ static int out_obj_index_insert(const struct lu_env *env,
               (char *)key, PFID(((struct dt_insert_rec *)rec)->rec_fid),
               ((struct dt_insert_rec *)rec)->rec_type);
 
-       if (dt_try_as_dir(env, dt_obj) == 0)
+       if (!dt_try_as_dir(env, dt_obj, true))
                return -ENOTDIR;
 
        dt_write_lock(env, dt_obj, DT_TGT_CHILD);
@@ -1093,7 +1090,7 @@ static int out_obj_index_delete(const struct lu_env *env,
               dt_obd_name(th->th_dev), PFID(lu_object_fid(&dt_obj->do_lu)),
               (char *)key);
 
-       if (dt_try_as_dir(env, dt_obj) == 0)
+       if (!dt_try_as_dir(env, dt_obj, true))
                return -ENOTDIR;
 
        dt_write_lock(env, dt_obj, DT_TGT_CHILD);
@@ -1143,10 +1140,8 @@ int out_index_insert_add_exec(const struct lu_env *env,
        struct tx_arg   *arg;
        int             rc;
 
-       if (dt_try_as_dir(env, dt_obj) == 0) {
-               rc = -ENOTDIR;
-               return rc;
-       }
+       if (!dt_try_as_dir(env, dt_obj, false))
+               return -ENOTDIR;
 
        rc = dt_declare_insert(env, dt_obj, rec, key, th);
        if (rc != 0)
@@ -1205,10 +1200,8 @@ int out_index_delete_add_exec(const struct lu_env *env,
        struct tx_arg   *arg;
        int             rc;
 
-       if (dt_try_as_dir(env, dt_obj) == 0) {
-               rc = -ENOTDIR;
-               return rc;
-       }
+       if (!dt_try_as_dir(env, dt_obj, true))
+               return -ENOTDIR;
 
        LASSERT(ta->ta_handle != NULL);
        rc = dt_declare_delete(env, dt_obj, key, th);