Whamcloud - gitweb
added open support: the simplest case, no CMD, no xattr.
authorhuanghua <huanghua>
Fri, 7 Jul 2006 09:13:15 +0000 (09:13 +0000)
committerhuanghua <huanghua>
Fri, 7 Jul 2006 09:13:15 +0000 (09:13 +0000)
lustre/mdt/mdt_handler.c
lustre/mdt/mdt_open.c
lustre/mdt/mdt_reint.c
lustre/osd/osd_handler.c
lustre/utils/loadmod_all.sh

index d4f4aba..e9837a5 100644 (file)
@@ -547,7 +547,6 @@ static int mdt_reint(struct mdt_thread_info *info)
         RETURN(rc);
 }
 
-#ifdef MDT_CODE
 /* TODO these two methods not available now. */
 
 /* this should sync the whole device */
@@ -604,13 +603,6 @@ static int mdt_sync(struct mdt_thread_info *info)
         }
         RETURN(rc);
 }
-#else
-static int mdt_sync(struct mdt_thread_info *info)
-{
-        return -EOPNOTSUPP;
-}
-#endif
-
 
 static int mdt_handle_quotacheck(struct mdt_thread_info *info)
 {
@@ -999,7 +991,6 @@ static int mdt_req_handle(struct mdt_thread_info *info,
 
         /* If we're DISCONNECTing, the mdt_export_data is already freed */
         if (result == 0 && h->mh_opc != MDS_DISCONNECT) {
-#ifdef MDT_CODE
                 /* FIXME: fake untill journal callback & open handling is OK.*/
                 __u64 last_transno;
                 __u64 last_committed;
@@ -1015,7 +1006,7 @@ static int mdt_req_handle(struct mdt_thread_info *info,
                 req->rq_repmsg->last_xid = req->rq_xid;
                 req->rq_repmsg->last_committed = last_committed;
                 req->rq_export->exp_obd->obd_last_committed = last_committed;
-#else
+#if 0
                 req->rq_repmsg->last_xid = le64_to_cpu(req_exp_last_xid(req));
                 target_committed_to_req(req);
 #endif
index 9cff0e5..29c2afe 100644 (file)
@@ -114,6 +114,7 @@ static int mdt_object_open(struct mdt_thread_info *info,
         repbody->fid1 = *mdt_object_fid(o);
         repbody->valid |= OBD_MD_FLID;
 
+/*
         rc = mo_xattr_get(info->mti_ctxt, mdt_object_child(o),
                           lmm, info->mti_mdt->mdt_max_mdsize, "lov");
         if (rc < 0)
@@ -125,7 +126,7 @@ static int mdt_object_open(struct mdt_thread_info *info,
                 repbody->valid |= OBD_MD_FLEASIZE;
         repbody->eadatasize = rc;
         rc = 0;
-
+*/
         mfd = mdt_mfd_new();
         if (mfd == NULL) {
                 CERROR("mds: out of memory\n");
@@ -190,6 +191,7 @@ int mdt_lock_new_child(struct mdt_thread_info *info,
         if (child_lockh == NULL)
                 child_lockh = &lockh;
 
+        mdt_lock_handle_init(&lockh);
         lockh.mlh_mode = LCK_EX;
         rc = mdt_object_lock(info->mti_mdt->mdt_namespace, 
                              o, &lockh, MDS_INODELOCK_UPDATE);
@@ -351,7 +353,7 @@ int mdt_close(struct mdt_thread_info *info)
                 mdt_pack_attr2body(repbody, &info->mti_attr);
                 repbody->fid1 = *mdt_object_fid(o);
                 repbody->valid |= OBD_MD_FLID;
-
+/*
                 rc = mo_xattr_get(info->mti_ctxt, mdt_object_child(o),
                                   lmm, info->mti_mdt->mdt_max_mdsize, "lov");
                 if (rc >= 0) {
@@ -362,6 +364,7 @@ int mdt_close(struct mdt_thread_info *info)
                         repbody->eadatasize = rc;
                         rc = 0;
                 }
+*/
         }
 
         rc = mdt_mfd_close(info->mti_ctxt, mfd, 1);
index 51d4d70..49c46bd 100644 (file)
@@ -179,21 +179,21 @@ static int mdt_reint_setattr(struct mdt_thread_info *info)
         repbody->fid1 = *mdt_object_fid(mo);
         repbody->valid |= OBD_MD_FLID;
        
-        /* don't return OST-specific attributes if we didn't just set them. */
+        /* don't return OST-specific attributes if we didn't just set them. 
         if (attr->la_valid & ATTR_SIZE)
                 repbody->valid |= OBD_MD_FLSIZE | OBD_MD_FLBLOCKS;
         if (attr->la_valid & (ATTR_MTIME | ATTR_MTIME_SET))
                 repbody->valid |= OBD_MD_FLMTIME;
         if (attr->la_valid & (ATTR_ATIME | ATTR_ATIME_SET))
                 repbody->valid |= OBD_MD_FLATIME;
-
+        */
         /* FIXME: I have to combine the attr_set & xattr_set into one single
                   transaction. How can I?
-         */ 
         rc = mo_xattr_set(info->mti_ctxt, mdt_object_child(mo),
                           rr->rr_eadata, rr->rr_eadatalen, "lov");
         if (rc)
                 GOTO(out_unlock, rc);
+         */ 
 
         /* FIXME & TODO Please deal with logcookies here*/
         GOTO(out_unlock, rc);
index 4c9145a..75992a7 100644 (file)
@@ -503,6 +503,14 @@ static int osd_attr_get(const struct lu_context *ctxt, struct dt_object *dt,
         return osd_inode_getattr(ctxt, obj->oo_inode, attr);
 }
 
+static int osd_attr_set(const struct lu_context *ctxt,
+                        struct dt_object *dt,
+                        const struct lu_attr *attr,
+                        struct thandle *handle)
+{
+        return 0;
+}
+
 /*
  * Object creation.
  *
@@ -772,6 +780,7 @@ static struct dt_object_operations osd_obj_ops = {
         .do_object_lock      = osd_object_lock,
         .do_object_unlock    = osd_object_unlock,
         .do_attr_get         = osd_attr_get,
+        .do_attr_set         = osd_attr_set,
         .do_object_create    = osd_object_create,
         .do_object_destroy   = osd_object_destroy,
         .do_object_index_try = osd_index_try,
index bcb22ea..f7e254d 100755 (executable)
@@ -21,3 +21,6 @@ HOST=`hostname`
 echo -1 >/proc/sys/lnet/debug
 echo "/r/tmp/$HOST.debug" >/proc/sys/lnet/daemon_file
 
+#  To generate gdb debug file:
+rm -f /r/tmp/ogdb-`hostname`
+./lctl modules > /r/tmp/ogdb-`hostname`