Whamcloud - gitweb
b=3874
authoralex <alex>
Sat, 24 Jul 2004 12:06:50 +0000 (12:06 +0000)
committeralex <alex>
Sat, 24 Jul 2004 12:06:50 +0000 (12:06 +0000)
- avoid needless fsfilt_get_md() and taking i_sem on a non-splittable parent

lustre/mds/mds_lmv.c

index 7496916..6e97e63 100644 (file)
@@ -477,6 +477,8 @@ cleanup:
 
 #define MAX_DIR_SIZE    (64 * 1024)
 
+#define I_NON_SPLITTABLE        256
+
 int mds_splitting_expected(struct obd_device *obd, struct dentry *dentry)
 {
         struct mds_obd *mds = &obd->u.mds;
@@ -495,6 +497,10 @@ int mds_splitting_expected(struct obd_device *obd, struct dentry *dentry)
         if (!S_ISDIR(dentry->d_inode->i_mode))
                 return MDS_NO_SPLITTABLE;
 
+        /* already splittied or slave directory (part of splitted dir) */
+        if (dentry->d_inode->i_flags & I_NON_SPLITTABLE)
+                return MDS_NO_SPLITTABLE;
+
         /* don't split root directory */
         if (dentry->d_inode->i_ino == mds->mds_rootfid.id)
                 return MDS_NO_SPLITTABLE;
@@ -507,6 +513,8 @@ int mds_splitting_expected(struct obd_device *obd, struct dentry *dentry)
         if (mea) {
                 /* already splitted or slave object: shouldn't be splitted */
                 rc = MDS_NO_SPLITTABLE;
+                /* mark to skip subsequent checks */
+                dentry->d_inode->i_flags |= I_NON_SPLITTABLE;
         } else {
                 /* may be splitted */
                 rc = MDS_EXPECT_SPLIT;