Whamcloud - gitweb
LU-9202 lfsck: skip unavailable targets when sync failures
[fs/lustre-release.git] / lustre / osc / osc_object.c
index 454311c..7c486dd 100644 (file)
  *
  * You should have received a copy of the GNU General Public License
  * version 2 along with this program; If not, see
- * http://www.sun.com/software/products/lustre/docs/GPLv2.pdf
- *
- * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
- * CA 95054 USA or visit www.sun.com if you need additional information or
- * have any questions.
+ * http://www.gnu.org/licenses/gpl-2.0.html
  *
  * GPL HEADER END
  */
@@ -88,7 +84,7 @@ static int osc_object_init(const struct lu_env *env, struct lu_object *obj,
        osc->oo_root.rb_node = NULL;
        INIT_LIST_HEAD(&osc->oo_hp_exts);
        INIT_LIST_HEAD(&osc->oo_urgent_exts);
-       INIT_LIST_HEAD(&osc->oo_rpc_exts);
+       INIT_LIST_HEAD(&osc->oo_full_exts);
        INIT_LIST_HEAD(&osc->oo_reading_exts);
        atomic_set(&osc->oo_nr_reads, 0);
        atomic_set(&osc->oo_nr_writes, 0);
@@ -117,7 +113,7 @@ static void osc_object_free(const struct lu_env *env, struct lu_object *obj)
        LASSERT(osc->oo_root.rb_node == NULL);
        LASSERT(list_empty(&osc->oo_hp_exts));
        LASSERT(list_empty(&osc->oo_urgent_exts));
-       LASSERT(list_empty(&osc->oo_rpc_exts));
+       LASSERT(list_empty(&osc->oo_full_exts));
        LASSERT(list_empty(&osc->oo_reading_exts));
        LASSERT(atomic_read(&osc->oo_nr_reads) == 0);
        LASSERT(atomic_read(&osc->oo_nr_writes) == 0);
@@ -241,15 +237,15 @@ static int osc_object_fiemap(const struct lu_env *env, struct cl_object *obj,
        if (!(fmkey->lfik_fiemap.fm_flags & FIEMAP_FLAG_SYNC))
                goto skip_locking;
 
-       policy.l_extent.start = fmkey->lfik_fiemap.fm_start & PAGE_CACHE_MASK;
+       policy.l_extent.start = fmkey->lfik_fiemap.fm_start & PAGE_MASK;
 
        if (OBD_OBJECT_EOF - fmkey->lfik_fiemap.fm_length <=
-           fmkey->lfik_fiemap.fm_start + PAGE_CACHE_SIZE - 1)
+           fmkey->lfik_fiemap.fm_start + PAGE_SIZE - 1)
                policy.l_extent.end = OBD_OBJECT_EOF;
        else
                policy.l_extent.end = (fmkey->lfik_fiemap.fm_start +
                                       fmkey->lfik_fiemap.fm_length +
-                                      PAGE_CACHE_SIZE - 1) & PAGE_CACHE_MASK;
+                                      PAGE_SIZE - 1) & PAGE_MASK;
 
        ostid_build_res_name(&fmkey->lfik_oa.o_oi, &resid);
        mode = ldlm_lock_match(exp->exp_obd->obd_namespace,
@@ -379,7 +375,14 @@ static void osc_req_attr_set(const struct lu_env *env, struct cl_object *obj,
                oa->o_valid |= OBD_MD_FLGROUP;
        }
        if (flags & OBD_MD_FLID) {
-               ostid_set_id(&oa->o_oi, ostid_id(&oinfo->loi_oi));
+               int rc;
+
+               rc = ostid_set_id(&oa->o_oi, ostid_id(&oinfo->loi_oi));
+               if (rc) {
+                       CERROR("Bad %llu to set " DOSTID " : rc %d\n",
+                              (unsigned long long)ostid_id(&oinfo->loi_oi),
+                              POSTID(&oa->o_oi), rc);
+               }
                oa->o_valid |= OBD_MD_FLID;
        }
        if (flags & OBD_MD_FLHANDLE) {