Whamcloud - gitweb
- minor cleanups since test #46 got working
authoralex <alex>
Mon, 28 Jun 2004 15:27:59 +0000 (15:27 +0000)
committeralex <alex>
Mon, 28 Jun 2004 15:27:59 +0000 (15:27 +0000)
lustre/mds/handler.c
lustre/mds/mds_open.c
lustre/mds/mds_reint.c

index 9a04a47..c1ba5f1 100644 (file)
@@ -828,7 +828,8 @@ int mds_check_mds_num(struct obd_device *obd, struct inode* inode,
                 int i;
                 i = mea_name2idx(mea, name, namelen - 1);
                 if (mea->mea_master != mea->mea_fids[i].mds) {
-                        CERROR("inapropriate MDS(%d) for %s. should be %d(%d)\n",
+                        CDEBUG(D_OTHER,
+                               "inapropriate MDS(%d) for %s. should be %d(%d)\n",
                                mea->mea_master, name, mea->mea_fids[i].mds, i);
                         rc = -ERESTART;
                 }
@@ -1324,7 +1325,7 @@ static int mdt_obj_create(struct ptlrpc_request *req)
         unsigned int tmpname;
         struct lvfs_ucred uc;
         struct mea *mea;
-        void *handle;
+        void *handle = NULL;
         ENTRY;
        
         DEBUG_REQ(D_HA, req, "create remote object");
index 7fc99a7..1acafaa 100644 (file)
@@ -910,7 +910,8 @@ int mds_open(struct mds_update_record *rec, int offset,
                 int i;
                 i = mea_name2idx(mea, rec->ur_name, rec->ur_namelen - 1);
                 if (mea->mea_master != mea->mea_fids[i].mds) {
-                        CERROR("%s: inapropriate MDS(%d) for %lu/%u:%s."
+                        CDEBUG(D_OTHER,
+                               "%s: inapropriate MDS(%d) for %lu/%u:%s."
                                " should be %d(%d)\n", obd->obd_name,
                                mea->mea_master, dparent->d_inode->i_ino,
                                dparent->d_inode->i_generation, rec->ur_name,
@@ -976,19 +977,16 @@ got_child:
                 unsigned long ino = rec->ur_fid2->id;
                 struct iattr iattr;
                 struct inode *inode;
-
-                if ((rc = mds_try_to_split_dir(obd, dparent, &mea,
-                                               0, update_mode))) {
-                        if (rc > 0) {
-                                /* dir got splitted */
-                                CERROR("%s: splitted %lu/%u - %d\n", obd->obd_name,
-                                        dparent->d_inode->i_ino,
-                                        dparent->d_inode->i_generation, rc);
-                                GOTO(cleanup, rc = -ERESTART);
-                        } else {
-                                /* error happened during spitting */
-                                GOTO(cleanup, rc);
-                        }
+                rc = mds_try_to_split_dir(obd, dparent, &mea, 0, update_mode);
+                CDEBUG(D_OTHER, "%s: splitted %lu/%u - %d\n",
+                       obd->obd_name, dparent->d_inode->i_ino,
+                       dparent->d_inode->i_generation, rc);
+                if (rc > 0) {
+                        /* dir got splitted */
+                        GOTO(cleanup, rc = -ERESTART);
+                } else if (rc < 0) {
+                        /* error happened during spitting */
+                        GOTO(cleanup, rc);
                 }
 
                 if (!(rec->ur_flags & MDS_OPEN_CREAT)) {
index d10fc12..8dca20e 100644 (file)
@@ -603,7 +603,7 @@ static int mds_reint_create(struct mds_update_record *rec, int offset,
                 int i;
                 i = mea_name2idx(mea, rec->ur_name, rec->ur_namelen - 1);
                 if (mea->mea_master != mea->mea_fids[i].mds) {
-                        CERROR("inapropriate MDS(%d) for %lu/%u:%s."
+                        CDEBUG(D_OTHER, "inapropriate MDS(%d) for %lu/%u:%s."
                                " should be %d(%d)\n",
                                mea->mea_master, dparent->d_inode->i_ino,
                                dparent->d_inode->i_generation, rec->ur_name,
@@ -624,21 +624,16 @@ static int mds_reint_create(struct mds_update_record *rec, int offset,
         OBD_FAIL_WRITE(OBD_FAIL_MDS_REINT_CREATE_WRITE, dir->i_sb);
 
         if (type == S_IFREG || type == S_IFDIR) {
-                if ((rc = mds_try_to_split_dir(obd, dparent, &mea, 
-                                               0, parent_mode))) {
-                        if (rc > 0) {
-                                /* dir got splitted */
-                                CERROR("%s: splitted %lu/%u - %d/%d\n",
-                                       obd->obd_name, dparent->d_inode->i_ino,
-                                       dparent->d_inode->i_generation, rc,
-                                       parent_mode);
-                                CERROR("  creation %*s was requested\n",
-                                       rec->ur_namelen - 1, rec->ur_name);
-                                GOTO(cleanup, rc = -ERESTART);
-                        } else {
-                                /* error happened during spitting. */
-                                GOTO(cleanup, rc);
-                        }
+                rc = mds_try_to_split_dir(obd, dparent, &mea, 0, parent_mode);
+                CDEBUG(D_OTHER, "%s: splitted %lu/%u - %d/%d\n",
+                       obd->obd_name, dparent->d_inode->i_ino,
+                       dparent->d_inode->i_generation, rc, parent_mode);
+                if (rc > 0) {
+                        /* dir got splitted */
+                        GOTO(cleanup, rc = -ERESTART);
+                } else if (rc < 0) {
+                        /* error happened during spitting. */
+                        GOTO(cleanup, rc);
                 }
         }
 
@@ -686,21 +681,16 @@ static int mds_reint_create(struct mds_update_record *rec, int offset,
                                  * signalthat we have exclusive access
                                  * to the directory. simple because
                                  * nobody knows it already exists -bzzz */
-                                if ((rc = mds_try_to_split_dir(obd, dchild,
-                                                               NULL, nstripes,
-                                                               LCK_EX))) {
-                                        if (rc > 0) {
-                                                /* dir got splitted */
-                                        CERROR("%s: splitted %lu/%u - %d\n",
-                                               obd->obd_name,
-                                               dchild->d_inode->i_ino,
-                                               dchild->d_inode->i_generation, rc);
-                                                rc = 0;
-                                        } else {
-                                                /* an error occured during
-                                                 * splitting. */
-                                                GOTO(cleanup, rc);
-                                        }
+                                rc = mds_try_to_split_dir(obd, dchild,
+                                                          NULL, nstripes,
+                                                          LCK_EX);
+                                if (rc > 0) {
+                                        /* dir got splitted */
+                                        rc = 0;
+                                } else if (rc < 0) {
+                                        /* an error occured during
+                                         * splitting. */
+                                        GOTO(cleanup, rc);
                                 }
                         }
                 } else if (!DENTRY_VALID(dchild)) {