Whamcloud - gitweb
b=6285
[fs/lustre-release.git] / lustre / smfs / dir.c
index 75b0431..296973b 100644 (file)
@@ -61,7 +61,11 @@ static int smfs_create(struct inode *dir, struct dentry *dentry,
         int rc = 0;
         
         ENTRY;
-
+        
+        CDEBUG(D_INODE, "VFS Op:name=%.*s (%p),dir=%lu/%u\n",
+               dentry->d_name.len, dentry->d_name.name, dentry,
+               dir->i_ino, dir->i_generation);
+        
         LASSERT(cache_dir);
         LASSERT(cache_dir->i_op->create);
         
@@ -180,6 +184,10 @@ static int smfs_do_lookup (struct inode * dir,
 
         ENTRY;
         
+        CDEBUG(D_INODE, "VFS Op:name=%.*s (%p),dir=%lu/%u\n",
+               dentry->d_name.len, dentry->d_name.name, dentry,
+               dir->i_ino, dir->i_generation);
+
         if (!cache_dir)
                 RETURN(-ENOENT);
 
@@ -215,14 +223,25 @@ static int smfs_do_lookup (struct inode * dir,
                 smfs_update_dentry(dentry, tmp);         
                 
                 if (tmp->d_inode) {
-                        if (!tmp->d_inode->i_nlink)
-                                CWARN("inode #%lu (%p) nlink is 0\n",
-                                      tmp->d_inode->i_ino, tmp->d_inode);
-                        
                         *inode = smfs_get_inode(dir->i_sb, tmp->d_inode, 
                                                 I2SMI(dir), 0); 
                         if (!(*inode))
                                 rc = -ENOENT;
+                        else {
+                                if (!tmp->d_inode->i_nlink) {
+                                        struct inode * ind = tmp->d_inode;
+                                
+                                        CWARN("inode #%lu (%*s) nlink is %i/%i\n",
+                                              ind->i_ino, tmp->d_name.len,
+                                              tmp->d_name.name, ind->i_nlink,
+                                              (*inode)->i_nlink);
+                                        CWARN("parent #%lu (%*s) nlink is %i\n",
+                                              dir->i_ino, tmp->d_parent->d_name.len,
+                                              tmp->d_parent->d_name.name,
+                                              cache_dir->i_nlink);
+                                        LBUG();
+                                }
+                        }
                 }
         }
         
@@ -417,6 +436,10 @@ static int smfs_unlink(struct inode * dir, struct dentry *dentry)
         LASSERT(cache_dir->i_op->unlink);
         LASSERT(parent);
         
+        CDEBUG(D_INODE, "VFS Op:name=%.*s (%p),dir=%lu/%u\n",
+               dentry->d_name.len, dentry->d_name.name, dentry,
+               dir->i_ino, dir->i_generation);
+
         cache_parent = pre_smfs_dentry(NULL, parent, dentry->d_parent);
         cache_dentry = pre_smfs_dentry(cache_parent, cache_inode, dentry);
         if (!cache_dentry || !cache_parent) {
@@ -530,6 +553,11 @@ static int smfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
         LASSERT(cache_dir);
         LASSERT(parent);
         
+        CDEBUG(D_INODE, "VFS Op:name=%.*s (%p),dir=%lu/%u\n",
+               dentry->d_name.len, dentry->d_name.name, dentry,
+               dir->i_ino, dir->i_generation);
+
+        
         cache_parent = pre_smfs_dentry(NULL, parent, dentry->d_parent);
         cache_dentry = pre_smfs_dentry(cache_parent, NULL, dentry);
         if (!cache_parent || !cache_dentry) {
@@ -585,6 +613,10 @@ static int smfs_rmdir(struct inode *dir, struct dentry *dentry)
 
         ENTRY;
         
+        CDEBUG(D_INODE, "VFS Op:name=%.*s (%p),dir=%lu/%u\n",
+               dentry->d_name.len, dentry->d_name.name, dentry,
+               dir->i_ino, dir->i_generation);
+
         LASSERT(cache_dir);
         LASSERT(cache_dir->i_op->rmdir);
         LASSERT(parent);