aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-12-26 22:49:43 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2015-01-25 23:16:27 -0500
commit5e9e2040247ac19a46d6627736ece726c46f1fdf (patch)
tree6036d436c295688a894f414788840274788e37af
parentd443b9fd56e85c0e58d10b75cf5eb38e0b2c4c02 (diff)
get rid of lustre_dump_dentry()
it's not only badly racy, it's actually dead code - the call in ll_invalidate_aliases() is unreachable. For an alias of our inode to be root dentry, the inode would have to be its ->d_inode, aka the root inode, and we never call ll_invalidate_aliases() for that. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--drivers/staging/lustre/lustre/llite/dcache.c8
-rw-r--r--drivers/staging/lustre/lustre/llite/llite_internal.h1
-rw-r--r--drivers/staging/lustre/lustre/llite/llite_lib.c42
3 files changed, 0 insertions, 51 deletions
diff --git a/drivers/staging/lustre/lustre/llite/dcache.c b/drivers/staging/lustre/lustre/llite/dcache.c
index 5bb9c85cec81..88614b71cf6d 100644
--- a/drivers/staging/lustre/lustre/llite/dcache.c
+++ b/drivers/staging/lustre/lustre/llite/dcache.c
@@ -263,14 +263,6 @@ void ll_invalidate_aliases(struct inode *inode)
263 dentry, dentry, dentry->d_parent, 263 dentry, dentry, dentry->d_parent,
264 dentry->d_inode, dentry->d_flags); 264 dentry->d_inode, dentry->d_flags);
265 265
266 if (unlikely(dentry == dentry->d_sb->s_root)) {
267 CERROR("%s: called on root dentry=%p, fid="DFID"\n",
268 ll_get_fsname(dentry->d_sb, NULL, 0),
269 dentry, PFID(ll_inode2fid(inode)));
270 lustre_dump_dentry(dentry, 1);
271 dump_stack();
272 }
273
274 d_lustre_invalidate(dentry, 0); 266 d_lustre_invalidate(dentry, 0);
275 } 267 }
276 ll_unlock_dcache(inode); 268 ll_unlock_dcache(inode);
diff --git a/drivers/staging/lustre/lustre/llite/llite_internal.h b/drivers/staging/lustre/lustre/llite/llite_internal.h
index 37306e0c7aad..d032c2b086cc 100644
--- a/drivers/staging/lustre/lustre/llite/llite_internal.h
+++ b/drivers/staging/lustre/lustre/llite/llite_internal.h
@@ -816,7 +816,6 @@ int ll_show_options(struct seq_file *seq, struct dentry *dentry);
816void ll_dirty_page_discard_warn(struct page *page, int ioret); 816void ll_dirty_page_discard_warn(struct page *page, int ioret);
817int ll_prep_inode(struct inode **inode, struct ptlrpc_request *req, 817int ll_prep_inode(struct inode **inode, struct ptlrpc_request *req,
818 struct super_block *, struct lookup_intent *); 818 struct super_block *, struct lookup_intent *);
819void lustre_dump_dentry(struct dentry *, int recur);
820int ll_obd_statfs(struct inode *inode, void *arg); 819int ll_obd_statfs(struct inode *inode, void *arg);
821int ll_get_max_mdsize(struct ll_sb_info *sbi, int *max_mdsize); 820int ll_get_max_mdsize(struct ll_sb_info *sbi, int *max_mdsize);
822int ll_get_default_mdsize(struct ll_sb_info *sbi, int *default_mdsize); 821int ll_get_default_mdsize(struct ll_sb_info *sbi, int *default_mdsize);
diff --git a/drivers/staging/lustre/lustre/llite/llite_lib.c b/drivers/staging/lustre/lustre/llite/llite_lib.c
index a3367bfb1456..0af546a74154 100644
--- a/drivers/staging/lustre/lustre/llite/llite_lib.c
+++ b/drivers/staging/lustre/lustre/llite/llite_lib.c
@@ -665,48 +665,6 @@ int ll_get_default_cookiesize(struct ll_sb_info *sbi, int *lmmsize)
665 return rc; 665 return rc;
666} 666}
667 667
668static void ll_dump_inode(struct inode *inode)
669{
670 struct ll_d_hlist_node *tmp;
671 int dentry_count = 0;
672
673 LASSERT(inode != NULL);
674
675 ll_d_hlist_for_each(tmp, &inode->i_dentry)
676 dentry_count++;
677
678 CERROR("inode %p dump: dev=%s ino=%lu mode=%o count=%u, %d dentries\n",
679 inode, ll_i2mdexp(inode)->exp_obd->obd_name, inode->i_ino,
680 inode->i_mode, atomic_read(&inode->i_count), dentry_count);
681}
682
683void lustre_dump_dentry(struct dentry *dentry, int recur)
684{
685 struct list_head *tmp;
686 int subdirs = 0;
687
688 LASSERT(dentry != NULL);
689
690 list_for_each(tmp, &dentry->d_subdirs)
691 subdirs++;
692
693 CERROR("dentry %p dump: name=%pd parent=%pd (%p), inode=%p, count=%u, flags=0x%x, fsdata=%p, %d subdirs\n",
694 dentry, dentry, dentry->d_parent, dentry->d_parent,
695 dentry->d_inode, d_count(dentry),
696 dentry->d_flags, dentry->d_fsdata, subdirs);
697 if (dentry->d_inode != NULL)
698 ll_dump_inode(dentry->d_inode);
699
700 if (recur == 0)
701 return;
702
703 list_for_each(tmp, &dentry->d_subdirs) {
704 struct dentry *d = list_entry(tmp, struct dentry, d_child);
705
706 lustre_dump_dentry(d, recur - 1);
707 }
708}
709
710static void client_common_put_super(struct super_block *sb) 668static void client_common_put_super(struct super_block *sb)
711{ 669{
712 struct ll_sb_info *sbi = ll_s2sbi(sb); 670 struct ll_sb_info *sbi = ll_s2sbi(sb);