Whamcloud - gitweb
LU-3279 changelog: fix CL_LAYOUT, accept all types
[fs/lustre-release.git] / lustre / liblustre / file.c
index f7618b3..4b8dad3 100644 (file)
@@ -1,6 +1,4 @@
-/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
- * vim:expandtab:shiftwidth=8:tabstop=8:
- *
+/*
  * GPL HEADER START
  *
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,7 +27,7 @@
  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  * Use is subject to license terms.
  *
- * Copyright (c) 2011, Whamcloud, Inc.
+ * Copyright (c) 2011, 2013, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
@@ -188,7 +186,6 @@ int llu_iop_open(struct pnode *pnode, int flags, mode_t mode)
         struct intnl_stat *st = llu_i2stat(inode);
         struct ptlrpc_request *request;
         struct lookup_intent *it;
-        struct lov_stripe_md *lsm;
         int rc = 0;
         ENTRY;
 
@@ -216,8 +213,7 @@ int llu_iop_open(struct pnode *pnode, int flags, mode_t mode)
         if (!S_ISREG(st->st_mode))
                 GOTO(out_release, rc = 0);
 
-        lsm = lli->lli_smd;
-        if (lsm)
+       if (lli->lli_has_smd)
                 flags &= ~O_LOV_DELAY_CREATE;
         /*XXX: open_flags are overwritten and the previous ones are lost */
         lli->lli_open_flags = flags & ~(O_CREAT | O_EXCL | O_TRUNC);
@@ -286,8 +282,7 @@ int llu_objects_destroy(struct ptlrpc_request *req, struct inode *dir)
         if (oa == NULL)
                 GOTO(out_free_memmd, rc = -ENOMEM);
 
-        oa->o_id = lsm->lsm_object_id;
-        oa->o_seq = lsm->lsm_object_seq;
+       oa->o_oi = lsm->lsm_oi;
         oa->o_mode = body->mode & S_IFMT;
         oa->o_valid = OBD_MD_FLID | OBD_MD_FLTYPE | OBD_MD_FLGROUP;
         obdo_set_parent_fid(oa, &llu_i2info(dir)->lli_fid);
@@ -304,15 +299,15 @@ int llu_objects_destroy(struct ptlrpc_request *req, struct inode *dir)
                 }
         }
 
-        rc = obd_destroy(llu_i2obdexp(dir), oa, lsm, &oti, NULL, NULL);
-        OBDO_FREE(oa);
-        if (rc)
-                CERROR("obd destroy objid 0x"LPX64" error %d\n",
-                       lsm->lsm_object_id, rc);
- out_free_memmd:
-        obd_free_memmd(llu_i2obdexp(dir), &lsm);
- out:
-        return rc;
+       rc = obd_destroy(NULL, llu_i2obdexp(dir), oa, lsm, &oti, NULL, NULL);
+       OBDO_FREE(oa);
+       if (rc)
+               CERROR("obd destroy objid "DOSTID" error %d\n",
+                      POSTID(&lsm->lsm_oi), rc);
+out_free_memmd:
+       obd_free_memmd(llu_i2obdexp(dir), &lsm);
+out:
+       return rc;
 }
 
 /** Cliens updates SOM attributes on MDS: obd_getattr and md_setattr. */
@@ -337,10 +332,7 @@ int llu_som_update(struct inode *inode, struct md_op_data *op_data)
                                        old_flags & MF_GETATTR_LOCK);
                 if (rc) {
                         oa.o_valid = 0;
-                        if (rc == -ENOENT)
-                                CDEBUG(D_INODE, "objid "LPX64" is destroyed\n",
-                                       lli->lli_smd->lsm_object_id);
-                        else
+                       if (rc != -ENOENT)
                                 CERROR("inode_getattr failed (%d): unable to "
                                        "send a Size-on-MDS attribute update "
                                        "for inode %llu/%lu\n", rc,