Whamcloud - gitweb
Silence bogus compiler warning by moving code closer together.
authoradilger <adilger>
Fri, 27 Sep 2002 00:12:52 +0000 (00:12 +0000)
committeradilger <adilger>
Fri, 27 Sep 2002 00:12:52 +0000 (00:12 +0000)
lustre/mds/mds_reint.c

index b8c6a8e..7fc879a 100644 (file)
@@ -412,7 +412,6 @@ static int mds_reint_unlink(struct mds_update_record *rec, int offset,
         struct dentry *dchild = NULL;
         struct mds_obd *mds = mds_req2mds(req);
         struct obd_device *obd = req->rq_export->exp_obd;
-        struct mds_body *body;
         char *name;
         struct inode *dir, *inode;
         struct lustre_handle lockh, child_lockh;
@@ -454,12 +453,6 @@ static int mds_reint_unlink(struct mds_update_record *rec, int offset,
                 GOTO(out_unlink_dchild, rc = -ENOENT);
         }
 
-        if (offset) {
-                body = lustre_msg_buf(req->rq_repmsg, 1);
-                mds_pack_inode2fid(&body->fid1, inode);
-                mds_pack_inode2body(body, inode);
-        }
-
         OBD_FAIL_WRITE(OBD_FAIL_MDS_REINT_UNLINK_WRITE, dir->i_sb->s_dev);
 
         switch (rec->ur_mode /* & S_IFMT ? */) {
@@ -472,8 +465,13 @@ static int mds_reint_unlink(struct mds_update_record *rec, int offset,
         case S_IFREG:
                 /* get OBD EA data first so client can also destroy object */
                 if ((inode->i_mode & S_IFMT) == S_IFREG && offset) {
+                        struct mds_body *body;
                         struct lov_mds_md *lmm;
 
+                        body = lustre_msg_buf(req->rq_repmsg, 1);
+                        mds_pack_inode2fid(&body->fid1, inode);
+                        mds_pack_inode2body(body, inode);
+
                         lmm = lustre_msg_buf(req->rq_repmsg, 2);
                         lmm->lmm_easize = mds->mds_max_mdsize;
                         if ((rc = mds_fs_get_md(mds, inode, lmm)) < 0) {