Whamcloud - gitweb
LU-10698 obdclass: allow specifying complex jobids
[fs/lustre-release.git] / lustre / llite / vvp_io.c
index 236e245..793ec00 100644 (file)
@@ -23,7 +23,7 @@
  * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, 2016, Intel Corporation.
+ * Copyright (c) 2011, 2017, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -363,6 +363,8 @@ static void vvp_io_fini(const struct lu_env *env, const struct cl_io_slice *ios)
         * RPC.
         */
        if (io->ci_need_write_intent) {
+               enum layout_intent_opc opc = LAYOUT_INTENT_WRITE;
+
                io->ci_need_write_intent = 0;
 
                LASSERT(io->ci_type == CIT_WRITE ||
@@ -372,8 +374,10 @@ static void vvp_io_fini(const struct lu_env *env, const struct cl_io_slice *ios)
                       PFID(lu_object_fid(&obj->co_lu)), io->ci_type,
                       PEXT(&io->ci_write_intent));
 
-               rc = ll_layout_write_intent(inode, io->ci_write_intent.e_start,
-                                           io->ci_write_intent.e_end);
+               if (cl_io_is_trunc(io))
+                       opc = LAYOUT_INTENT_TRUNC;
+
+               rc = ll_layout_write_intent(inode, opc, &io->ci_write_intent);
                io->ci_result = rc;
                if (!rc)
                        io->ci_need_restart = 1;
@@ -1468,7 +1472,7 @@ int vvp_io_init(const struct lu_env *env, struct cl_object *obj,
                 * it's not accurate if the file is shared by different
                 * jobs.
                 */
-               lustre_get_jobid(lli->lli_jobid);
+               lustre_get_jobid(lli->lli_jobid, sizeof(lli->lli_jobid));
        } else if (io->ci_type == CIT_SETATTR) {
                if (!cl_io_is_trunc(io))
                        io->ci_lockreq = CILR_MANDATORY;