Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / lustre / kernel_patches / patches / invalidate_show-2.4.20-rh.patch
1  fs/inode.c         |   23 +++++++++++++++--------
2  fs/smbfs/inode.c   |    2 +-
3  fs/super.c         |    4 ++--
4  include/linux/fs.h |    2 +-
5  4 files changed, 19 insertions(+), 12 deletions(-)
6
7 --- kernel-2.4.20/fs/inode.c~invalidate_show-2.4.20-rh  2003-05-24 01:56:40.000000000 -0400
8 +++ kernel-2.4.20-root/fs/inode.c       2003-06-02 00:35:37.000000000 -0400
9 @@ -628,7 +628,8 @@ static void dispose_list(struct list_hea
10  /*
11   * Invalidate all inodes for a device.
12   */
13 -static int invalidate_list(struct list_head *head, struct super_block * sb, struct list_head * dispose)
14 +static int invalidate_list(struct list_head *head, struct super_block * sb,
15 +                          struct list_head * dispose, int show)
16  {
17         struct list_head *next;
18         int busy = 0, count = 0;
19 @@ -653,6 +654,11 @@ static int invalidate_list(struct list_h
20                         count++;
21                         continue;
22                 }
23 +               if (show)
24 +                       printk(KERN_ERR
25 +                              "inode busy: dev %s:%lu (%p) mode %o count %u\n",
26 +                              kdevname(sb->s_dev), inode->i_ino, inode,
27 +                              inode->i_mode, atomic_read(&inode->i_count));
28                 busy = 1;
29         }
30         /* only unused inodes may be cached with i_count zero */
31 @@ -671,23 +677,24 @@ static int invalidate_list(struct list_h
32  /**
33   *     invalidate_inodes       - discard the inodes on a device
34   *     @sb: superblock
35 + *     @show: whether we should display any busy inodes found
36   *
37   *     Discard all of the inodes for a given superblock. If the discard
38   *     fails because there are busy inodes then a non zero value is returned.
39   *     If the discard is successful all the inodes have been discarded.
40   */
41   
42 -int invalidate_inodes(struct super_block * sb)
43 +int invalidate_inodes(struct super_block * sb, int show)
44  {
45         int busy;
46         LIST_HEAD(throw_away);
47  
48         spin_lock(&inode_lock);
49 -       busy = invalidate_list(&inode_in_use, sb, &throw_away);
50 -       busy |= invalidate_list(&inode_unused, sb, &throw_away);
51 -       busy |= invalidate_list(&inode_unused_pagecache, sb, &throw_away);
52 -       busy |= invalidate_list(&sb->s_dirty, sb, &throw_away);
53 -       busy |= invalidate_list(&sb->s_locked_inodes, sb, &throw_away);
54 +       busy = invalidate_list(&inode_in_use, sb, &throw_away, show);
55 +       busy |= invalidate_list(&inode_unused, sb, &throw_away, show);
56 +       busy |= invalidate_list(&inode_unused_pagecache, sb, &throw_away, show);
57 +       busy |= invalidate_list(&sb->s_dirty, sb, &throw_away, show);
58 +       busy |= invalidate_list(&sb->s_locked_inodes, sb, &throw_away, show);
59         spin_unlock(&inode_lock);
60  
61         dispose_list(&throw_away);
62 @@ -713,7 +720,7 @@ int invalidate_device(kdev_t dev, int do
63                  * hold).
64                  */
65                 shrink_dcache_sb(sb);
66 -               res = invalidate_inodes(sb);
67 +               res = invalidate_inodes(sb, 0);
68                 drop_super(sb);
69         }
70         invalidate_buffers(dev);
71 --- kernel-2.4.20/fs/super.c~invalidate_show-2.4.20-rh  2003-05-24 01:56:24.000000000 -0400
72 +++ kernel-2.4.20-root/fs/super.c       2003-06-02 00:35:00.000000000 -0400
73 @@ -943,7 +943,7 @@ void kill_super(struct super_block *sb)
74         lock_super(sb);
75         lock_kernel();
76         sb->s_flags &= ~MS_ACTIVE;
77 -       invalidate_inodes(sb);  /* bad name - it should be evict_inodes() */
78 +       invalidate_inodes(sb, 0);  /* bad name - it should be evict_inodes() */
79         if (sop) {
80                 if (sop->write_super && sb->s_dirt)
81                         sop->write_super(sb);
82 @@ -952,7 +952,7 @@ void kill_super(struct super_block *sb)
83         }
84  
85         /* Forget any remaining inodes */
86 -       if (invalidate_inodes(sb)) {
87 +       if (invalidate_inodes(sb, 1)) {
88                 printk(KERN_ERR "VFS: Busy inodes after unmount. "
89                         "Self-destruct in 5 seconds.  Have a nice day...\n");
90         }
91 --- kernel-2.4.20/include/linux/fs.h~invalidate_show-2.4.20-rh  2003-06-02 00:31:47.000000000 -0400
92 +++ kernel-2.4.20-root/include/linux/fs.h       2003-06-02 00:35:00.000000000 -0400
93 @@ -1284,7 +1284,7 @@ static inline void mark_buffer_dirty_ino
94  extern void set_buffer_flushtime(struct buffer_head *);
95  extern void balance_dirty(void);
96  extern int check_disk_change(kdev_t);
97 -extern int invalidate_inodes(struct super_block *);
98 +extern int invalidate_inodes(struct super_block *, int);
99  extern int invalidate_device(kdev_t, int);
100  extern void invalidate_inode_pages(struct inode *);
101  extern void invalidate_inode_pages2(struct address_space *);
102 --- kernel-2.4.20/fs/smbfs/inode.c~invalidate_show-2.4.20-rh    2002-11-28 18:53:15.000000000 -0500
103 +++ kernel-2.4.20-root/fs/smbfs/inode.c 2003-06-02 00:35:00.000000000 -0400
104 @@ -167,7 +167,7 @@ smb_invalidate_inodes(struct smb_sb_info
105  {
106         VERBOSE("\n");
107         shrink_dcache_sb(SB_of(server));
108 -       invalidate_inodes(SB_of(server));
109 +       invalidate_inodes(SB_of(server), 0);
110  }
111  
112  /*
113
114 _