Whamcloud - gitweb
- decrease the seq width to prevent i_ino overflow in CMD
authortappro <tappro>
Mon, 28 Aug 2006 12:31:05 +0000 (12:31 +0000)
committertappro <tappro>
Mon, 28 Aug 2006 12:31:05 +0000 (12:31 +0000)
- put code with iget5_locked() using in ll_iget() to provide generic mapping fid
  to ino. It works though is disabled for now

lustre/include/lustre_fid.h
lustre/llite/namei.c

index 8fdc7a9..1c278c9 100644 (file)
@@ -39,14 +39,14 @@ extern const struct lu_range LUSTRE_SEQ_SPACE_RANGE;
 extern const struct lu_range LUSTRE_SEQ_ZERO_RANGE;
 
 enum {
-        /* this is how may FIDs may be allocated in one sequence. */
-        LUSTRE_SEQ_MAX_WIDTH = 0x00000000000002800ULL,
+        /* this is how may FIDs may be allocated in one sequence. 16384 for now */
+        LUSTRE_SEQ_MAX_WIDTH = 0x0000000000004000ULL,
 
-        /* how many sequences may be allocate for meta-sequence (this is 10240
+        /* how many sequences may be allocate for meta-sequence (this is 128
          * sequences). */
-        LUSTRE_SEQ_META_WIDTH = 0x00000000000002800ULL,
+        LUSTRE_SEQ_META_WIDTH = 0x0000000000000080ULL,
 
-        /* this is how many sequences (10240 * 10240) may be in one
+        /* this is how many sequences (128 * 128) may be in one
          * super-sequence allocated to MDTs. */
         LUSTRE_SEQ_SUPER_WIDTH = (LUSTRE_SEQ_META_WIDTH * LUSTRE_SEQ_META_WIDTH)
 };
index 10fff69..4a111b8 100644 (file)
@@ -30,6 +30,7 @@
 #define DEBUG_SUBSYSTEM S_LLITE
 
 #include <obd_support.h>
+#include <lustre_fid.h>
 #include <lustre_lite.h>
 #include <lustre_dlm.h>
 #include <lustre_ver.h>
@@ -53,9 +54,19 @@ int ll_unlock(__u32 mode, struct lustre_handle *lockh)
  * Returns inode or NULL
  */
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0))
+#if 0
+/* that variant provides correct mapping fid to inode,
+ * it is put here as alternative way to the current one ll_iget() below */
+int ll_test_inode(struct inode *inode, void *opaque)
+{
+        return lu_fid_eq(&ll_i2info(inode)->lli_fid, (struct lu_fid *)opaque);
+}
+
 int ll_set_inode(struct inode *inode, void *opaque)
 {
-        ll_read_inode2(inode, opaque);
+        struct lu_fid *fid = opaque;
+        ll_i2info(inode)->lli_fid = *fid;
+        inode->i_ino = ll_fid_build_ino(ll_s2sbi(inode->i_sb), fid);
         return 0;
 }
 
@@ -66,6 +77,30 @@ struct inode *ll_iget(struct super_block *sb, ino_t hash,
         struct inode *inode;
         LASSERT(hash != 0);
 
+        inode = iget5_locked(sb, hash, ll_test_inode, ll_set_inode,
+                             &md->body->fid1);
+        if (inode) {
+                if (inode->i_state & I_NEW) {
+                        lli = ll_i2info(inode);
+                        ll_read_inode2(inode, md);
+                        unlock_new_inode(inode);
+                } else {
+                        ll_update_inode(inode, md);
+                }
+                CDEBUG(D_VFSTRACE, "inode: %lu/%u(%p)\n",
+                       inode->i_ino, inode->i_generation, inode);
+        }
+
+        return inode;
+}
+#else
+struct inode *ll_iget(struct super_block *sb, ino_t hash,
+                      struct lustre_md *md)
+{
+        struct ll_inode_info *lli;
+        struct inode *inode;
+        LASSERT(hash != 0);
+
         inode = iget_locked(sb, hash);
         if (inode) {
                 if (inode->i_state & I_NEW) {
@@ -81,6 +116,7 @@ struct inode *ll_iget(struct super_block *sb, ino_t hash,
 
         return inode;
 }
+#endif
 #else
 struct inode *ll_iget(struct super_block *sb, ino_t hash,
                       struct lustre_md *md)