Whamcloud - gitweb
b=22632 also build mptlinux on SLES11
[fs/lustre-release.git] / lustre / kernel_patches / patches / iopen-misc-2.6.22-vanilla.patch
1 This patch is needed to allow sharing the kernel with 1.8, and until
2 the MGS and llog code has been moved over to using the OSD interface.
3
4 Index: linux-2.6.22.5/fs/dcache.c
5 ===================================================================
6 --- linux-2.6.22.5.orig/fs/dcache.c     2008-02-21 00:56:29.000000000 -0700
7 +++ linux-2.6.22.5/fs/dcache.c  2008-02-21 00:57:02.000000000 -0700
8 @@ -1441,13 +1441,22 @@
9   * Adds a dentry to the hash according to its name.
10   */
11   
12 -void d_rehash(struct dentry * entry)
13 +void d_rehash_cond(struct dentry * entry, int lock)
14  {
15 -       spin_lock(&dcache_lock);
16 +       if (lock)
17 +               spin_lock(&dcache_lock);
18         spin_lock(&entry->d_lock);
19         _d_rehash(entry);
20         spin_unlock(&entry->d_lock);
21 -       spin_unlock(&dcache_lock);
22 +       if (lock)
23 +               spin_unlock(&dcache_lock);
24 +}
25 +
26 +EXPORT_SYMBOL(d_rehash_cond);
27 +
28 +void d_rehash(struct dentry * entry)
29 +{
30 +       d_rehash_cond(entry, 1);
31  }
32  
33  #define do_switch(x,y) do { \
34 @@ -1537,7 +1546,7 @@
35   * Update the dcache to reflect the move of a file name. Negative
36   * dcache entries should not be moved in this way.
37   */
38 -static void d_move_locked(struct dentry * dentry, struct dentry * target)
39 +void d_move_locked(struct dentry * dentry, struct dentry * target)
40  {
41         struct hlist_head *list;
42  
43 @@ -1595,6 +1604,7 @@
44         spin_unlock(&dentry->d_lock);
45         write_sequnlock(&rename_lock);
46  }
47 +EXPORT_SYMBOL(d_move_locked);
48  
49  /**
50   * d_move - move a dentry
51 Index: linux-2.6.22.5/include/linux/dcache.h
52 ===================================================================
53 --- linux-2.6.22.5.orig/include/linux/dcache.h  2008-02-21 00:56:29.000000000 -0700
54 +++ linux-2.6.22.5/include/linux/dcache.h       2008-02-21 00:57:02.000000000 -0700
55 @@ -251,6 +251,7 @@ extern int have_submounts(struct dentry 
56   * This adds the entry to the hash queues.
57   */
58  extern void d_rehash(struct dentry *);
59 +extern void d_rehash_cond(struct dentry *, int lock);
60  
61  /**
62   * d_add - add dentry to hash queues
63 @@ -286,6 +287,7 @@ static inline struct dentry *d_add_uniqu
64  
65  /* used for rename() and baskets */
66  extern void d_move(struct dentry *, struct dentry *);
67 +extern void d_move_locked(struct dentry *, struct dentry *);
68  
69  /* appendix may either be NULL or be used for transname suffixes */
70  extern struct dentry * d_lookup(struct dentry *, struct qstr *);