Whamcloud - gitweb
- changed name convention in cobd, thus all MD related methods have _md_ prefix like...
[fs/lustre-release.git] / lustre / liblustre / file.c
index 78b9202..b2fa8f4 100644 (file)
 #include <sys/queue.h>
 #include <fcntl.h>
 
+#ifdef HAVE_XTIO_H
 #include <xtio.h>
+#endif
 #include <sysio.h>
 #include <fs.h>
 #include <mount.h>
 #include <inode.h>
+#ifdef HAVE_FILE_H
 #include <file.h>
+#endif
 
 #undef LIST_HEAD
 
@@ -61,13 +65,13 @@ void llu_prepare_mdc_data(struct mdc_op_data *data, struct inode *i1,
 
 void obdo_refresh_inode(struct inode *dst,
                         struct obdo *src,
-                        obd_flag valid)
+                        obd_valid valid)
 {
         struct llu_inode_info *lli = llu_i2info(dst);
         valid &= src->o_valid;
 
         if (valid & (OBD_MD_FLCTIME | OBD_MD_FLMTIME))
-                CDEBUG(D_INODE, "valid %x, cur time %lu/%lu, new %lu/%lu\n",
+                CDEBUG(D_INODE, "valid "LPX64", cur time %lu/%lu, new %lu/%lu\n",
                        src->o_valid, LTIME_S(lli->lli_st_mtime), 
                        LTIME_S(lli->lli_st_ctime),
                        (long)src->o_mtime, (long)src->o_ctime);
@@ -90,7 +94,7 @@ void obdo_refresh_inode(struct inode *dst,
 
 static int llu_local_open(struct llu_inode_info *lli, struct lookup_intent *it)
 {
-        struct ptlrpc_request *req = it->d.lustre.it_data;
+        struct ptlrpc_request *req = LUSTRE_IT(it)->it_data;
         struct ll_file_data *fd;
         struct mds_body *body;
         ENTRY;
@@ -107,14 +111,14 @@ static int llu_local_open(struct llu_inode_info *lli, struct lookup_intent *it)
 
         OBD_ALLOC(fd, sizeof(*fd));
         /* We can't handle this well without reorganizing ll_file_open and
-         * ll_mdc_close, so don't even try right now. */
+         * ll_md_close(), so don't even try right now. */
         LASSERT(fd != NULL);
 
         memcpy(&fd->fd_mds_och.och_fh, &body->handle, sizeof(body->handle));
         fd->fd_mds_och.och_magic = OBD_CLIENT_HANDLE_MAGIC;
         lli->lli_file_data = fd;
 
-        mdc_set_open_replay_data(NULL, &fd->fd_mds_och, it->d.lustre.it_data);
+        mdc_set_open_replay_data(NULL, &fd->fd_mds_och, LUSTRE_IT(it)->it_data);
 
         RETURN(0);
 }
@@ -139,9 +143,8 @@ int llu_iop_open(struct pnode *pnode, int flags, mode_t mode)
         CDEBUG(D_VFSTRACE, "VFS Op:inode=%lu\n", lli->lli_st_ino);
         LL_GET_INTENT(inode, it);
 
-        if (!it->d.lustre.it_disposition) {
+        if (!LUSTRE_IT(it)->it_disposition)
                 LBUG();
-        }
 
         rc = it_open_error(DISP_OPEN_OPEN, it);
         if (rc)
@@ -168,7 +171,7 @@ int llu_iop_open(struct pnode *pnode, int flags, mode_t mode)
         lli->lli_open_flags = flags & ~(O_CREAT | O_EXCL | O_TRUNC);
 
  out_release:
-        request = it->d.lustre.it_data;
+        request = LUSTRE_IT(it)->it_data;
         ptlrpc_req_finished(request);
 
         it->it_op_release(it);
@@ -225,7 +228,7 @@ int llu_objects_destroy(struct ptlrpc_request *request, struct inode *dir)
                 GOTO(out, rc = -EPROTO);
         }
 
-        rc = obd_unpackmd(llu_i2obdexp(dir), &lsm, eadata, body->eadatasize);
+        rc = obd_unpackmd(llu_i2dtexp(dir), &lsm, eadata, body->eadatasize);
         if (rc < 0) {
                 CERROR("obd_unpackmd: %d\n", rc);
                 GOTO(out, rc);
@@ -252,13 +255,13 @@ int llu_objects_destroy(struct ptlrpc_request *request, struct inode *dir)
                 }
         }
 
-        rc = obd_destroy(llu_i2obdexp(dir), oa, lsm, &oti);
+        rc = obd_destroy(llu_i2dtexp(dir), oa, lsm, &oti);
         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);
+        obd_free_memmd(llu_i2dtexp(dir), &lsm);
  out:
         return rc;
 }
@@ -340,7 +343,7 @@ int llu_file_release(struct inode *inode)
         if (!fd) /* no process opened the file after an mcreate */
                 RETURN(0);
 
-        rc2 = llu_mdc_close(sbi->ll_lmv_exp, inode);
+        rc2 = llu_mdc_close(sbi->ll_md_exp, inode);
         if (rc2 && !rc)
                 rc = rc2;
 
@@ -405,7 +408,7 @@ static void llu_truncate(struct inode *inode)
                oa.o_id, lli->lli_st_size);
 
         /* truncate == punch from new size to absolute end of file */
-        err = obd_punch(llu_i2obdexp(inode), &oa, lsm, lli->lli_st_size,
+        err = obd_punch(llu_i2dtexp(inode), &oa, lsm, lli->lli_st_size,
                         OBD_OBJECT_EOF, NULL);
         if (err)
                 CERROR("obd_truncate fails (%d) ino %lu\n", err, lli->lli_st_ino);