~ubuntu-branches/debian/wheezy/linux-2.6/wheezy

« back to all changes in this revision

Viewing changes to debian/patches/features/all/rt/fs-dentry-use-seqlock.patch

  • Committer: Package Import Robot
  • Author(s): Ben Hutchings, Bastian Blank, Ben Hutchings, Uwe Kleine-König
  • Date: 2012-03-04 15:32:20 UTC
  • mfrom: (1.3.14)
  • mto: This revision was merged to the branch mainline in revision 57.
  • Revision ID: package-import@ubuntu.com-20120304153220-zbhqnmufx18yk6q4
* New upstream stable update:
  http://www.kernel.org/pub/linux/kernel/v3.x/ChangeLog-3.2.8
  - [i386] i387: move TS_USEDFPU flag from thread_info to task_struct
  - [x86] additional refactoring of FPU/SSE state save and restore
  http://www.kernel.org/pub/linux/kernel/v3.x/ChangeLog-3.2.9
  - vfs: fix d_inode_lookup() dentry ref leak
  - target: Allow control CDBs with data > 1 page
  - epoll: introduce POLLFREE to flush ->signalfd_wqh before kfree()
  - epoll: ep_unregister_pollwait() can use the freed pwq->whead
  - epoll: limit paths (CVE-2011-1083)
  - cdrom: use copy_to_user() without the underscores

[ Bastian Blank ]
* [mips,mipsel] Also remove ext4 modules from installer.

[ Ben Hutchings ]
* Update debconf template translations:
  - Update Dutch (Willem Kuyn) (Closes: #658736)
  - Add Polish (Michał Kułach) (Closes: #658912)
* Bump ABI to 2
* fs: Introduce and enable security restrictions on links:
  - Do not follow symlinks in /tmp that are owned by other users
    (sysctl: fs.protected_symlinks)
  - Do not allow unprivileged users to create hard links to sensitive files
    (sysctl: fs.protected_hardlinks) (Closes: #609455)
    + This breaks the 'at' package in stable, which will be fixed shortly
      (see #597130)
  The precise restrictions are specified in Documentation/sysctl/fs.txt in
  the linux-doc-3.2 and linux-source-3.2 packages.
* iwlwifi: fix key removal (Closes: #651199)
* cgroups: Set CGROUP_PERF
* hid: Enable HID_HOLTEK, HID_PRIMAX, HID_SPEEDLINK, HID_WIIMOTE as modules,
  HID_ACRUX_FF
* media/rc: Enable RC_ATI_REMOTE as module
* gspca: Enable USB_GSPCA_TOPRO as module
* dvb-usb: Enable DVB_USB_PCTV452E, DVB_USB_MXL111SF as modules

[ Uwe Kleine-König ]
* [x86] Update rt featureset to 3.2.9-rt15

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Subject: fs: dentry use seqlock
 
2
From: Thomas Gleixner <tglx@linutronix.de>
 
3
Date: Mon, 27 Feb 2012 18:08:46 +0100
 
4
 
 
5
Replace the open coded seqlock with a real seqlock, so RT can handle
 
6
it.
 
7
 
 
8
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
 
9
Cc: stable-rt@vger.kernel.org
 
10
 
 
11
---
 
12
 arch/powerpc/platforms/cell/spufs/inode.c |    6 
 
13
 drivers/infiniband/hw/ipath/ipath_fs.c    |    6 
 
14
 drivers/infiniband/hw/qib/qib_fs.c        |    6 
 
15
 drivers/usb/core/inode.c                  |   12 -
 
16
 fs/9p/vfs_dir.c                           |    4 
 
17
 fs/afs/dir.c                              |    4 
 
18
 fs/autofs4/autofs_i.h                     |   24 +-
 
19
 fs/autofs4/expire.c                       |   44 ++---
 
20
 fs/autofs4/root.c                         |   38 ++--
 
21
 fs/btrfs/export.c                         |    4 
 
22
 fs/btrfs/inode.c                          |    4 
 
23
 fs/ceph/caps.c                            |    8 
 
24
 fs/ceph/debugfs.c                         |    8 
 
25
 fs/ceph/dir.c                             |   30 +--
 
26
 fs/ceph/export.c                          |    4 
 
27
 fs/ceph/inode.c                           |   20 +-
 
28
 fs/ceph/mds_client.c                      |   18 +-
 
29
 fs/cifs/dir.c                             |    6 
 
30
 fs/coda/cache.c                           |    4 
 
31
 fs/configfs/configfs_internal.h           |    4 
 
32
 fs/configfs/inode.c                       |    6 
 
33
 fs/dcache.c                               |  253 ++++++++++++++----------------
 
34
 fs/dcookies.c                             |    8 
 
35
 fs/exportfs/expfs.c                       |   12 -
 
36
 fs/fat/inode.c                            |    4 
 
37
 fs/fat/namei_vfat.c                       |    4 
 
38
 fs/fs-writeback.c                         |    4 
 
39
 fs/fuse/inode.c                           |    4 
 
40
 fs/gfs2/export.c                          |    4 
 
41
 fs/isofs/export.c                         |    4 
 
42
 fs/libfs.c                                |   36 ++--
 
43
 fs/namei.c                                |   42 ++--
 
44
 fs/namespace.c                            |    8 
 
45
 fs/ncpfs/dir.c                            |    6 
 
46
 fs/ncpfs/ncplib_kernel.h                  |    8 
 
47
 fs/nfs/dir.c                              |    6 
 
48
 fs/nfs/getroot.c                          |   12 -
 
49
 fs/nfs/namespace.c                        |   16 -
 
50
 fs/nfs/unlink.c                           |   20 +-
 
51
 fs/nilfs2/namei.c                         |    4 
 
52
 fs/notify/fsnotify.c                      |    8 
 
53
 fs/notify/vfsmount_mark.c                 |   24 +-
 
54
 fs/ocfs2/dcache.c                         |    6 
 
55
 fs/ocfs2/export.c                         |    4 
 
56
 fs/reiserfs/inode.c                       |    4 
 
57
 fs/udf/namei.c                            |    4 
 
58
 fs/xfs/xfs_export.c                       |    8 
 
59
 include/linux/dcache.h                    |   15 -
 
60
 include/linux/fs.h                        |    4 
 
61
 include/linux/fsnotify_backend.h          |    6 
 
62
 kernel/cgroup.c                           |   22 +-
 
63
 net/sunrpc/rpc_pipe.c                     |    6 
 
64
 security/selinux/selinuxfs.c              |   14 -
 
65
 53 files changed, 418 insertions(+), 422 deletions(-)
 
66
 
 
67
Index: linux-3.2/arch/powerpc/platforms/cell/spufs/inode.c
 
68
===================================================================
 
69
--- linux-3.2.orig/arch/powerpc/platforms/cell/spufs/inode.c
 
70
+++ linux-3.2/arch/powerpc/platforms/cell/spufs/inode.c
 
71
@@ -165,18 +165,18 @@ static void spufs_prune_dir(struct dentr
 
72
 
 
73
        mutex_lock(&dir->d_inode->i_mutex);
 
74
        list_for_each_entry_safe(dentry, tmp, &dir->d_subdirs, d_u.d_child) {
 
75
-               spin_lock(&dentry->d_lock);
 
76
+               seq_spin_lock(&dentry->d_lock);
 
77
                if (!(d_unhashed(dentry)) && dentry->d_inode) {
 
78
                        dget_dlock(dentry);
 
79
                        __d_drop(dentry);
 
80
-                       spin_unlock(&dentry->d_lock);
 
81
+                       seq_spin_unlock(&dentry->d_lock);
 
82
                        simple_unlink(dir->d_inode, dentry);
 
83
                        /* XXX: what was dcache_lock protecting here? Other
 
84
                         * filesystems (IB, configfs) release dcache_lock
 
85
                         * before unlink */
 
86
                        dput(dentry);
 
87
                } else {
 
88
-                       spin_unlock(&dentry->d_lock);
 
89
+                       seq_spin_unlock(&dentry->d_lock);
 
90
                }
 
91
        }
 
92
        shrink_dcache_parent(dir);
 
93
Index: linux-3.2/drivers/infiniband/hw/ipath/ipath_fs.c
 
94
===================================================================
 
95
--- linux-3.2.orig/drivers/infiniband/hw/ipath/ipath_fs.c
 
96
+++ linux-3.2/drivers/infiniband/hw/ipath/ipath_fs.c
 
97
@@ -277,14 +277,14 @@ static int remove_file(struct dentry *pa
 
98
                goto bail;
 
99
        }
 
100
 
 
101
-       spin_lock(&tmp->d_lock);
 
102
+       seq_spin_lock(&tmp->d_lock);
 
103
        if (!(d_unhashed(tmp) && tmp->d_inode)) {
 
104
                dget_dlock(tmp);
 
105
                __d_drop(tmp);
 
106
-               spin_unlock(&tmp->d_lock);
 
107
+               seq_spin_unlock(&tmp->d_lock);
 
108
                simple_unlink(parent->d_inode, tmp);
 
109
        } else
 
110
-               spin_unlock(&tmp->d_lock);
 
111
+               seq_spin_unlock(&tmp->d_lock);
 
112
 
 
113
        ret = 0;
 
114
 bail:
 
115
Index: linux-3.2/drivers/infiniband/hw/qib/qib_fs.c
 
116
===================================================================
 
117
--- linux-3.2.orig/drivers/infiniband/hw/qib/qib_fs.c
 
118
+++ linux-3.2/drivers/infiniband/hw/qib/qib_fs.c
 
119
@@ -453,14 +453,14 @@ static int remove_file(struct dentry *pa
 
120
                goto bail;
 
121
        }
 
122
 
 
123
-       spin_lock(&tmp->d_lock);
 
124
+       seq_spin_lock(&tmp->d_lock);
 
125
        if (!(d_unhashed(tmp) && tmp->d_inode)) {
 
126
                dget_dlock(tmp);
 
127
                __d_drop(tmp);
 
128
-               spin_unlock(&tmp->d_lock);
 
129
+               seq_spin_unlock(&tmp->d_lock);
 
130
                simple_unlink(parent->d_inode, tmp);
 
131
        } else {
 
132
-               spin_unlock(&tmp->d_lock);
 
133
+               seq_spin_unlock(&tmp->d_lock);
 
134
        }
 
135
 
 
136
        ret = 0;
 
137
Index: linux-3.2/drivers/usb/core/inode.c
 
138
===================================================================
 
139
--- linux-3.2.orig/drivers/usb/core/inode.c
 
140
+++ linux-3.2/drivers/usb/core/inode.c
 
141
@@ -343,19 +343,19 @@ static int usbfs_empty (struct dentry *d
 
142
 {
 
143
        struct list_head *list;
 
144
 
 
145
-       spin_lock(&dentry->d_lock);
 
146
+       seq_spin_lock(&dentry->d_lock);
 
147
        list_for_each(list, &dentry->d_subdirs) {
 
148
                struct dentry *de = list_entry(list, struct dentry, d_u.d_child);
 
149
 
 
150
-               spin_lock_nested(&de->d_lock, DENTRY_D_LOCK_NESTED);
 
151
+               seq_spin_lock_nested(&de->d_lock, DENTRY_D_LOCK_NESTED);
 
152
                if (usbfs_positive(de)) {
 
153
-                       spin_unlock(&de->d_lock);
 
154
-                       spin_unlock(&dentry->d_lock);
 
155
+                       seq_spin_unlock(&de->d_lock);
 
156
+                       seq_spin_unlock(&dentry->d_lock);
 
157
                        return 0;
 
158
                }
 
159
-               spin_unlock(&de->d_lock);
 
160
+               seq_spin_unlock(&de->d_lock);
 
161
        }
 
162
-       spin_unlock(&dentry->d_lock);
 
163
+       seq_spin_unlock(&dentry->d_lock);
 
164
        return 1;
 
165
 }
 
166
 
 
167
Index: linux-3.2/fs/9p/vfs_dir.c
 
168
===================================================================
 
169
--- linux-3.2.orig/fs/9p/vfs_dir.c
 
170
+++ linux-3.2/fs/9p/vfs_dir.c
 
171
@@ -107,7 +107,7 @@ static int v9fs_alloc_rdir_buf(struct fi
 
172
                        err = -ENOMEM;
 
173
                        goto exit;
 
174
                }
 
175
-               spin_lock(&filp->f_dentry->d_lock);
 
176
+               seq_spin_lock(&filp->f_dentry->d_lock);
 
177
                if (!fid->rdir) {
 
178
                        rdir->buf = (uint8_t *)rdir + sizeof(struct p9_rdir);
 
179
                        mutex_init(&rdir->mutex);
 
180
@@ -115,7 +115,7 @@ static int v9fs_alloc_rdir_buf(struct fi
 
181
                        fid->rdir = (void *) rdir;
 
182
                        rdir = NULL;
 
183
                }
 
184
-               spin_unlock(&filp->f_dentry->d_lock);
 
185
+               seq_spin_unlock(&filp->f_dentry->d_lock);
 
186
                kfree(rdir);
 
187
        }
 
188
 exit:
 
189
Index: linux-3.2/fs/afs/dir.c
 
190
===================================================================
 
191
--- linux-3.2.orig/fs/afs/dir.c
 
192
+++ linux-3.2/fs/afs/dir.c
 
193
@@ -705,9 +705,9 @@ out_skip:
 
194
 
 
195
        /* the dirent, if it exists, now points to a different vnode */
 
196
 not_found:
 
197
-       spin_lock(&dentry->d_lock);
 
198
+       seq_spin_lock(&dentry->d_lock);
 
199
        dentry->d_flags |= DCACHE_NFSFS_RENAMED;
 
200
-       spin_unlock(&dentry->d_lock);
 
201
+       seq_spin_unlock(&dentry->d_lock);
 
202
 
 
203
 out_bad:
 
204
        if (dentry->d_inode) {
 
205
Index: linux-3.2/fs/autofs4/autofs_i.h
 
206
===================================================================
 
207
--- linux-3.2.orig/fs/autofs4/autofs_i.h
 
208
+++ linux-3.2/fs/autofs4/autofs_i.h
 
209
@@ -197,9 +197,9 @@ static inline void __managed_dentry_set_
 
210
 
 
211
 static inline void managed_dentry_set_automount(struct dentry *dentry)
 
212
 {
 
213
-       spin_lock(&dentry->d_lock);
 
214
+       seq_spin_lock(&dentry->d_lock);
 
215
        __managed_dentry_set_automount(dentry);
 
216
-       spin_unlock(&dentry->d_lock);
 
217
+       seq_spin_unlock(&dentry->d_lock);
 
218
 }
 
219
 
 
220
 static inline void __managed_dentry_clear_automount(struct dentry *dentry)
 
221
@@ -209,9 +209,9 @@ static inline void __managed_dentry_clea
 
222
 
 
223
 static inline void managed_dentry_clear_automount(struct dentry *dentry)
 
224
 {
 
225
-       spin_lock(&dentry->d_lock);
 
226
+       seq_spin_lock(&dentry->d_lock);
 
227
        __managed_dentry_clear_automount(dentry);
 
228
-       spin_unlock(&dentry->d_lock);
 
229
+       seq_spin_unlock(&dentry->d_lock);
 
230
 }
 
231
 
 
232
 static inline void __managed_dentry_set_transit(struct dentry *dentry)
 
233
@@ -221,9 +221,9 @@ static inline void __managed_dentry_set_
 
234
 
 
235
 static inline void managed_dentry_set_transit(struct dentry *dentry)
 
236
 {
 
237
-       spin_lock(&dentry->d_lock);
 
238
+       seq_spin_lock(&dentry->d_lock);
 
239
        __managed_dentry_set_transit(dentry);
 
240
-       spin_unlock(&dentry->d_lock);
 
241
+       seq_spin_unlock(&dentry->d_lock);
 
242
 }
 
243
 
 
244
 static inline void __managed_dentry_clear_transit(struct dentry *dentry)
 
245
@@ -233,9 +233,9 @@ static inline void __managed_dentry_clea
 
246
 
 
247
 static inline void managed_dentry_clear_transit(struct dentry *dentry)
 
248
 {
 
249
-       spin_lock(&dentry->d_lock);
 
250
+       seq_spin_lock(&dentry->d_lock);
 
251
        __managed_dentry_clear_transit(dentry);
 
252
-       spin_unlock(&dentry->d_lock);
 
253
+       seq_spin_unlock(&dentry->d_lock);
 
254
 }
 
255
 
 
256
 static inline void __managed_dentry_set_managed(struct dentry *dentry)
 
257
@@ -245,9 +245,9 @@ static inline void __managed_dentry_set_
 
258
 
 
259
 static inline void managed_dentry_set_managed(struct dentry *dentry)
 
260
 {
 
261
-       spin_lock(&dentry->d_lock);
 
262
+       seq_spin_lock(&dentry->d_lock);
 
263
        __managed_dentry_set_managed(dentry);
 
264
-       spin_unlock(&dentry->d_lock);
 
265
+       seq_spin_unlock(&dentry->d_lock);
 
266
 }
 
267
 
 
268
 static inline void __managed_dentry_clear_managed(struct dentry *dentry)
 
269
@@ -257,9 +257,9 @@ static inline void __managed_dentry_clea
 
270
 
 
271
 static inline void managed_dentry_clear_managed(struct dentry *dentry)
 
272
 {
 
273
-       spin_lock(&dentry->d_lock);
 
274
+       seq_spin_lock(&dentry->d_lock);
 
275
        __managed_dentry_clear_managed(dentry);
 
276
-       spin_unlock(&dentry->d_lock);
 
277
+       seq_spin_unlock(&dentry->d_lock);
 
278
 }
 
279
 
 
280
 /* Initializing function */
 
281
Index: linux-3.2/fs/autofs4/expire.c
 
282
===================================================================
 
283
--- linux-3.2.orig/fs/autofs4/expire.c
 
284
+++ linux-3.2/fs/autofs4/expire.c
 
285
@@ -99,7 +99,7 @@ static struct dentry *get_next_positive_
 
286
        spin_lock(&sbi->lookup_lock);
 
287
 
 
288
        if (prev == NULL) {
 
289
-               spin_lock(&root->d_lock);
 
290
+               seq_spin_lock(&root->d_lock);
 
291
                prev = dget_dlock(root);
 
292
                next = prev->d_subdirs.next;
 
293
                p = prev;
 
294
@@ -107,12 +107,12 @@ static struct dentry *get_next_positive_
 
295
        }
 
296
 
 
297
        p = prev;
 
298
-       spin_lock(&p->d_lock);
 
299
+       seq_spin_lock(&p->d_lock);
 
300
 again:
 
301
        next = p->d_u.d_child.next;
 
302
 start:
 
303
        if (next == &root->d_subdirs) {
 
304
-               spin_unlock(&p->d_lock);
 
305
+               seq_spin_unlock(&p->d_lock);
 
306
                spin_unlock(&sbi->lookup_lock);
 
307
                dput(prev);
 
308
                return NULL;
 
309
@@ -120,16 +120,16 @@ start:
 
310
 
 
311
        q = list_entry(next, struct dentry, d_u.d_child);
 
312
 
 
313
-       spin_lock_nested(&q->d_lock, DENTRY_D_LOCK_NESTED);
 
314
+       seq_spin_lock_nested(&q->d_lock, DENTRY_D_LOCK_NESTED);
 
315
        /* Negative dentry - try next */
 
316
        if (!simple_positive(q)) {
 
317
-               spin_unlock(&p->d_lock);
 
318
+               seq_spin_unlock(&p->d_lock);
 
319
                p = q;
 
320
                goto again;
 
321
        }
 
322
        dget_dlock(q);
 
323
-       spin_unlock(&q->d_lock);
 
324
-       spin_unlock(&p->d_lock);
 
325
+       seq_spin_unlock(&q->d_lock);
 
326
+       seq_spin_unlock(&p->d_lock);
 
327
        spin_unlock(&sbi->lookup_lock);
 
328
 
 
329
        dput(prev);
 
330
@@ -153,7 +153,7 @@ static struct dentry *get_next_positive_
 
331
        spin_lock(&sbi->lookup_lock);
 
332
 relock:
 
333
        p = prev;
 
334
-       spin_lock(&p->d_lock);
 
335
+       seq_spin_lock(&p->d_lock);
 
336
 again:
 
337
        next = p->d_subdirs.next;
 
338
        if (next == &p->d_subdirs) {
 
339
@@ -161,19 +161,19 @@ again:
 
340
                        struct dentry *parent;
 
341
 
 
342
                        if (p == root) {
 
343
-                               spin_unlock(&p->d_lock);
 
344
+                               seq_spin_unlock(&p->d_lock);
 
345
                                spin_unlock(&sbi->lookup_lock);
 
346
                                dput(prev);
 
347
                                return NULL;
 
348
                        }
 
349
 
 
350
                        parent = p->d_parent;
 
351
-                       if (!spin_trylock(&parent->d_lock)) {
 
352
-                               spin_unlock(&p->d_lock);
 
353
+                       if (!seq_spin_trylock(&parent->d_lock)) {
 
354
+                               seq_spin_unlock(&p->d_lock);
 
355
                                cpu_relax();
 
356
                                goto relock;
 
357
                        }
 
358
-                       spin_unlock(&p->d_lock);
 
359
+                       seq_spin_unlock(&p->d_lock);
 
360
                        next = p->d_u.d_child.next;
 
361
                        p = parent;
 
362
                        if (next != &parent->d_subdirs)
 
363
@@ -182,16 +182,16 @@ again:
 
364
        }
 
365
        ret = list_entry(next, struct dentry, d_u.d_child);
 
366
 
 
367
-       spin_lock_nested(&ret->d_lock, DENTRY_D_LOCK_NESTED);
 
368
+       seq_spin_lock_nested(&ret->d_lock, DENTRY_D_LOCK_NESTED);
 
369
        /* Negative dentry - try next */
 
370
        if (!simple_positive(ret)) {
 
371
-               spin_unlock(&p->d_lock);
 
372
+               seq_spin_unlock(&p->d_lock);
 
373
                p = ret;
 
374
                goto again;
 
375
        }
 
376
        dget_dlock(ret);
 
377
-       spin_unlock(&ret->d_lock);
 
378
-       spin_unlock(&p->d_lock);
 
379
+       seq_spin_unlock(&ret->d_lock);
 
380
+       seq_spin_unlock(&p->d_lock);
 
381
        spin_unlock(&sbi->lookup_lock);
 
382
 
 
383
        dput(prev);
 
384
@@ -462,11 +462,11 @@ found:
 
385
        init_completion(&ino->expire_complete);
 
386
        spin_unlock(&sbi->fs_lock);
 
387
        spin_lock(&sbi->lookup_lock);
 
388
-       spin_lock(&expired->d_parent->d_lock);
 
389
-       spin_lock_nested(&expired->d_lock, DENTRY_D_LOCK_NESTED);
 
390
+       seq_spin_lock(&expired->d_parent->d_lock);
 
391
+       seq_spin_lock_nested(&expired->d_lock, DENTRY_D_LOCK_NESTED);
 
392
        list_move(&expired->d_parent->d_subdirs, &expired->d_u.d_child);
 
393
-       spin_unlock(&expired->d_lock);
 
394
-       spin_unlock(&expired->d_parent->d_lock);
 
395
+       seq_spin_unlock(&expired->d_lock);
 
396
+       seq_spin_unlock(&expired->d_parent->d_lock);
 
397
        spin_unlock(&sbi->lookup_lock);
 
398
        return expired;
 
399
 }
 
400
@@ -556,7 +556,7 @@ int autofs4_do_expire_multi(struct super
 
401
 
 
402
                spin_lock(&sbi->fs_lock);
 
403
                ino->flags &= ~AUTOFS_INF_EXPIRING;
 
404
-               spin_lock(&dentry->d_lock);
 
405
+               seq_spin_lock(&dentry->d_lock);
 
406
                if (!ret) {
 
407
                        if ((IS_ROOT(dentry) ||
 
408
                            (autofs_type_indirect(sbi->type) &&
 
409
@@ -564,7 +564,7 @@ int autofs4_do_expire_multi(struct super
 
410
                            !(dentry->d_flags & DCACHE_NEED_AUTOMOUNT))
 
411
                                __managed_dentry_set_automount(dentry);
 
412
                }
 
413
-               spin_unlock(&dentry->d_lock);
 
414
+               seq_spin_unlock(&dentry->d_lock);
 
415
                complete_all(&ino->expire_complete);
 
416
                spin_unlock(&sbi->fs_lock);
 
417
                dput(dentry);
 
418
Index: linux-3.2/fs/autofs4/root.c
 
419
===================================================================
 
420
--- linux-3.2.orig/fs/autofs4/root.c
 
421
+++ linux-3.2/fs/autofs4/root.c
 
422
@@ -124,13 +124,13 @@ static int autofs4_dir_open(struct inode
 
423
         * it.
 
424
         */
 
425
        spin_lock(&sbi->lookup_lock);
 
426
-       spin_lock(&dentry->d_lock);
 
427
+       seq_spin_lock(&dentry->d_lock);
 
428
        if (!d_mountpoint(dentry) && list_empty(&dentry->d_subdirs)) {
 
429
-               spin_unlock(&dentry->d_lock);
 
430
+               seq_spin_unlock(&dentry->d_lock);
 
431
                spin_unlock(&sbi->lookup_lock);
 
432
                return -ENOENT;
 
433
        }
 
434
-       spin_unlock(&dentry->d_lock);
 
435
+       seq_spin_unlock(&dentry->d_lock);
 
436
        spin_unlock(&sbi->lookup_lock);
 
437
 
 
438
 out:
 
439
@@ -179,7 +179,7 @@ static struct dentry *autofs4_lookup_act
 
440
                ino = list_entry(p, struct autofs_info, active);
 
441
                active = ino->dentry;
 
442
 
 
443
-               spin_lock(&active->d_lock);
 
444
+               seq_spin_lock(&active->d_lock);
 
445
 
 
446
                /* Already gone? */
 
447
                if (active->d_count == 0)
 
448
@@ -199,12 +199,12 @@ static struct dentry *autofs4_lookup_act
 
449
 
 
450
                if (d_unhashed(active)) {
 
451
                        dget_dlock(active);
 
452
-                       spin_unlock(&active->d_lock);
 
453
+                       seq_spin_unlock(&active->d_lock);
 
454
                        spin_unlock(&sbi->lookup_lock);
 
455
                        return active;
 
456
                }
 
457
 next:
 
458
-               spin_unlock(&active->d_lock);
 
459
+               seq_spin_unlock(&active->d_lock);
 
460
        }
 
461
        spin_unlock(&sbi->lookup_lock);
 
462
 
 
463
@@ -231,7 +231,7 @@ static struct dentry *autofs4_lookup_exp
 
464
                ino = list_entry(p, struct autofs_info, expiring);
 
465
                expiring = ino->dentry;
 
466
 
 
467
-               spin_lock(&expiring->d_lock);
 
468
+               seq_spin_lock(&expiring->d_lock);
 
469
 
 
470
                /* Bad luck, we've already been dentry_iput */
 
471
                if (!expiring->d_inode)
 
472
@@ -251,12 +251,12 @@ static struct dentry *autofs4_lookup_exp
 
473
 
 
474
                if (d_unhashed(expiring)) {
 
475
                        dget_dlock(expiring);
 
476
-                       spin_unlock(&expiring->d_lock);
 
477
+                       seq_spin_unlock(&expiring->d_lock);
 
478
                        spin_unlock(&sbi->lookup_lock);
 
479
                        return expiring;
 
480
                }
 
481
 next:
 
482
-               spin_unlock(&expiring->d_lock);
 
483
+               seq_spin_unlock(&expiring->d_lock);
 
484
        }
 
485
        spin_unlock(&sbi->lookup_lock);
 
486
 
 
487
@@ -382,12 +382,12 @@ static struct vfsmount *autofs4_d_automo
 
488
                        if (have_submounts(dentry))
 
489
                                goto done;
 
490
                } else {
 
491
-                       spin_lock(&dentry->d_lock);
 
492
+                       seq_spin_lock(&dentry->d_lock);
 
493
                        if (!list_empty(&dentry->d_subdirs)) {
 
494
-                               spin_unlock(&dentry->d_lock);
 
495
+                               seq_spin_unlock(&dentry->d_lock);
 
496
                                goto done;
 
497
                        }
 
498
-                       spin_unlock(&dentry->d_lock);
 
499
+                       seq_spin_unlock(&dentry->d_lock);
 
500
                }
 
501
                ino->flags |= AUTOFS_INF_PENDING;
 
502
                spin_unlock(&sbi->fs_lock);
 
503
@@ -410,12 +410,12 @@ done:
 
504
                 * an actual mount so ->d_automount() won't be called during
 
505
                 * the follow.
 
506
                 */
 
507
-               spin_lock(&dentry->d_lock);
 
508
+               seq_spin_lock(&dentry->d_lock);
 
509
                if ((!d_mountpoint(dentry) &&
 
510
                    !list_empty(&dentry->d_subdirs)) ||
 
511
                    (dentry->d_inode && S_ISLNK(dentry->d_inode->i_mode)))
 
512
                        __managed_dentry_clear_automount(dentry);
 
513
-               spin_unlock(&dentry->d_lock);
 
514
+               seq_spin_unlock(&dentry->d_lock);
 
515
        }
 
516
        spin_unlock(&sbi->fs_lock);
 
517
 
 
518
@@ -597,9 +597,9 @@ static int autofs4_dir_unlink(struct ino
 
519
 
 
520
        spin_lock(&sbi->lookup_lock);
 
521
        __autofs4_add_expiring(dentry);
 
522
-       spin_lock(&dentry->d_lock);
 
523
+       seq_spin_lock(&dentry->d_lock);
 
524
        __d_drop(dentry);
 
525
-       spin_unlock(&dentry->d_lock);
 
526
+       seq_spin_unlock(&dentry->d_lock);
 
527
        spin_unlock(&sbi->lookup_lock);
 
528
 
 
529
        return 0;
 
530
@@ -670,15 +670,15 @@ static int autofs4_dir_rmdir(struct inod
 
531
                return -EACCES;
 
532
 
 
533
        spin_lock(&sbi->lookup_lock);
 
534
-       spin_lock(&dentry->d_lock);
 
535
+       seq_spin_lock(&dentry->d_lock);
 
536
        if (!list_empty(&dentry->d_subdirs)) {
 
537
-               spin_unlock(&dentry->d_lock);
 
538
+               seq_spin_unlock(&dentry->d_lock);
 
539
                spin_unlock(&sbi->lookup_lock);
 
540
                return -ENOTEMPTY;
 
541
        }
 
542
        __autofs4_add_expiring(dentry);
 
543
        __d_drop(dentry);
 
544
-       spin_unlock(&dentry->d_lock);
 
545
+       seq_spin_unlock(&dentry->d_lock);
 
546
        spin_unlock(&sbi->lookup_lock);
 
547
 
 
548
        if (sbi->version < 5)
 
549
Index: linux-3.2/fs/btrfs/export.c
 
550
===================================================================
 
551
--- linux-3.2.orig/fs/btrfs/export.c
 
552
+++ linux-3.2/fs/btrfs/export.c
 
553
@@ -40,14 +40,14 @@ static int btrfs_encode_fh(struct dentry
 
554
                struct inode *parent;
 
555
                u64 parent_root_id;
 
556
 
 
557
-               spin_lock(&dentry->d_lock);
 
558
+               seq_spin_lock(&dentry->d_lock);
 
559
 
 
560
                parent = dentry->d_parent->d_inode;
 
561
                fid->parent_objectid = BTRFS_I(parent)->location.objectid;
 
562
                fid->parent_gen = parent->i_generation;
 
563
                parent_root_id = BTRFS_I(parent)->root->objectid;
 
564
 
 
565
-               spin_unlock(&dentry->d_lock);
 
566
+               seq_spin_unlock(&dentry->d_lock);
 
567
 
 
568
                if (parent_root_id != fid->root_objectid) {
 
569
                        fid->parent_root_objectid = parent_root_id;
 
570
Index: linux-3.2/fs/btrfs/inode.c
 
571
===================================================================
 
572
--- linux-3.2.orig/fs/btrfs/inode.c
 
573
+++ linux-3.2/fs/btrfs/inode.c
 
574
@@ -4002,9 +4002,9 @@ static struct dentry *btrfs_lookup(struc
 
575
 
 
576
        ret = d_splice_alias(btrfs_lookup_dentry(dir, dentry), dentry);
 
577
        if (unlikely(d_need_lookup(dentry))) {
 
578
-               spin_lock(&dentry->d_lock);
 
579
+               seq_spin_lock(&dentry->d_lock);
 
580
                dentry->d_flags &= ~DCACHE_NEED_LOOKUP;
 
581
-               spin_unlock(&dentry->d_lock);
 
582
+               seq_spin_unlock(&dentry->d_lock);
 
583
        }
 
584
        return ret;
 
585
 }
 
586
Index: linux-3.2/fs/ceph/caps.c
 
587
===================================================================
 
588
--- linux-3.2.orig/fs/ceph/caps.c
 
589
+++ linux-3.2/fs/ceph/caps.c
 
590
@@ -3066,14 +3066,14 @@ int ceph_encode_dentry_release(void **p,
 
591
         * doesn't have to be perfect; the mds will revoke anything we don't
 
592
         * release.
 
593
         */
 
594
-       spin_lock(&dentry->d_lock);
 
595
+       seq_spin_lock(&dentry->d_lock);
 
596
        if (di->lease_session && di->lease_session->s_mds == mds)
 
597
                force = 1;
 
598
-       spin_unlock(&dentry->d_lock);
 
599
+       seq_spin_unlock(&dentry->d_lock);
 
600
 
 
601
        ret = ceph_encode_inode_release(p, dir, mds, drop, unless, force);
 
602
 
 
603
-       spin_lock(&dentry->d_lock);
 
604
+       seq_spin_lock(&dentry->d_lock);
 
605
        if (ret && di->lease_session && di->lease_session->s_mds == mds) {
 
606
                dout("encode_dentry_release %p mds%d seq %d\n",
 
607
                     dentry, mds, (int)di->lease_seq);
 
608
@@ -3083,6 +3083,6 @@ int ceph_encode_dentry_release(void **p,
 
609
                rel->dname_seq = cpu_to_le32(di->lease_seq);
 
610
                __ceph_mdsc_drop_dentry_lease(dentry);
 
611
        }
 
612
-       spin_unlock(&dentry->d_lock);
 
613
+       seq_spin_unlock(&dentry->d_lock);
 
614
        return ret;
 
615
 }
 
616
Index: linux-3.2/fs/ceph/debugfs.c
 
617
===================================================================
 
618
--- linux-3.2.orig/fs/ceph/debugfs.c
 
619
+++ linux-3.2/fs/ceph/debugfs.c
 
620
@@ -82,13 +82,13 @@ static int mdsc_show(struct seq_file *s,
 
621
                                                    &pathbase, 0);
 
622
                        if (IS_ERR(path))
 
623
                                path = NULL;
 
624
-                       spin_lock(&req->r_dentry->d_lock);
 
625
+                       seq_spin_lock(&req->r_dentry->d_lock);
 
626
                        seq_printf(s, " #%llx/%.*s (%s)",
 
627
                                   ceph_ino(req->r_dentry->d_parent->d_inode),
 
628
                                   req->r_dentry->d_name.len,
 
629
                                   req->r_dentry->d_name.name,
 
630
                                   path ? path : "");
 
631
-                       spin_unlock(&req->r_dentry->d_lock);
 
632
+                       seq_spin_unlock(&req->r_dentry->d_lock);
 
633
                        kfree(path);
 
634
                } else if (req->r_path1) {
 
635
                        seq_printf(s, " #%llx/%s", req->r_ino1.ino,
 
636
@@ -100,13 +100,13 @@ static int mdsc_show(struct seq_file *s,
 
637
                                                    &pathbase, 0);
 
638
                        if (IS_ERR(path))
 
639
                                path = NULL;
 
640
-                       spin_lock(&req->r_old_dentry->d_lock);
 
641
+                       seq_spin_lock(&req->r_old_dentry->d_lock);
 
642
                        seq_printf(s, " #%llx/%.*s (%s)",
 
643
                           ceph_ino(req->r_old_dentry_dir),
 
644
                                   req->r_old_dentry->d_name.len,
 
645
                                   req->r_old_dentry->d_name.name,
 
646
                                   path ? path : "");
 
647
-                       spin_unlock(&req->r_old_dentry->d_lock);
 
648
+                       seq_spin_unlock(&req->r_old_dentry->d_lock);
 
649
                        kfree(path);
 
650
                } else if (req->r_path2) {
 
651
                        if (req->r_ino2.ino)
 
652
Index: linux-3.2/fs/ceph/dir.c
 
653
===================================================================
 
654
--- linux-3.2.orig/fs/ceph/dir.c
 
655
+++ linux-3.2/fs/ceph/dir.c
 
656
@@ -44,7 +44,7 @@ int ceph_init_dentry(struct dentry *dent
 
657
        if (!di)
 
658
                return -ENOMEM;          /* oh well */
 
659
 
 
660
-       spin_lock(&dentry->d_lock);
 
661
+       seq_spin_lock(&dentry->d_lock);
 
662
        if (dentry->d_fsdata) {
 
663
                /* lost a race */
 
664
                kmem_cache_free(ceph_dentry_cachep, di);
 
665
@@ -67,7 +67,7 @@ int ceph_init_dentry(struct dentry *dent
 
666
        dentry->d_fsdata = di;
 
667
        ceph_dentry_lru_add(dentry);
 
668
 out_unlock:
 
669
-       spin_unlock(&dentry->d_lock);
 
670
+       seq_spin_unlock(&dentry->d_lock);
 
671
        return 0;
 
672
 }
 
673
 
 
674
@@ -78,12 +78,12 @@ struct inode *ceph_get_dentry_parent_ino
 
675
        if (!dentry)
 
676
                return NULL;
 
677
 
 
678
-       spin_lock(&dentry->d_lock);
 
679
+       seq_spin_lock(&dentry->d_lock);
 
680
        if (dentry->d_parent) {
 
681
                inode = dentry->d_parent->d_inode;
 
682
                ihold(inode);
 
683
        }
 
684
-       spin_unlock(&dentry->d_lock);
 
685
+       seq_spin_unlock(&dentry->d_lock);
 
686
        return inode;
 
687
 }
 
688
 
 
689
@@ -130,7 +130,7 @@ static int __dcache_readdir(struct file 
 
690
        dout("__dcache_readdir %p at %llu (last %p)\n", dir, filp->f_pos,
 
691
             last);
 
692
 
 
693
-       spin_lock(&parent->d_lock);
 
694
+       seq_spin_lock(&parent->d_lock);
 
695
 
 
696
        /* start at beginning? */
 
697
        if (filp->f_pos == 2 || last == NULL ||
 
698
@@ -154,7 +154,7 @@ more:
 
699
                        fi->flags |= CEPH_F_ATEND;
 
700
                        goto out_unlock;
 
701
                }
 
702
-               spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
 
703
+               seq_spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
 
704
                if (!d_unhashed(dentry) && dentry->d_inode &&
 
705
                    ceph_snap(dentry->d_inode) != CEPH_SNAPDIR &&
 
706
                    ceph_ino(dentry->d_inode) != CEPH_INO_CEPH &&
 
707
@@ -164,15 +164,15 @@ more:
 
708
                     dentry->d_name.len, dentry->d_name.name, di->offset,
 
709
                     filp->f_pos, d_unhashed(dentry) ? " unhashed" : "",
 
710
                     !dentry->d_inode ? " null" : "");
 
711
-               spin_unlock(&dentry->d_lock);
 
712
+               seq_spin_unlock(&dentry->d_lock);
 
713
                p = p->prev;
 
714
                dentry = list_entry(p, struct dentry, d_u.d_child);
 
715
                di = ceph_dentry(dentry);
 
716
        }
 
717
 
 
718
        dget_dlock(dentry);
 
719
-       spin_unlock(&dentry->d_lock);
 
720
-       spin_unlock(&parent->d_lock);
 
721
+       seq_spin_unlock(&dentry->d_lock);
 
722
+       seq_spin_unlock(&parent->d_lock);
 
723
 
 
724
        dout(" %llu (%llu) dentry %p %.*s %p\n", di->offset, filp->f_pos,
 
725
             dentry, dentry->d_name.len, dentry->d_name.name, dentry->d_inode);
 
726
@@ -205,12 +205,12 @@ more:
 
727
                goto out;
 
728
        }
 
729
 
 
730
-       spin_lock(&parent->d_lock);
 
731
+       seq_spin_lock(&parent->d_lock);
 
732
        p = p->prev;    /* advance to next dentry */
 
733
        goto more;
 
734
 
 
735
 out_unlock:
 
736
-       spin_unlock(&parent->d_lock);
 
737
+       seq_spin_unlock(&parent->d_lock);
 
738
 out:
 
739
        if (last)
 
740
                dput(last);
 
741
@@ -950,10 +950,10 @@ static int ceph_rename(struct inode *old
 
742
  */
 
743
 void ceph_invalidate_dentry_lease(struct dentry *dentry)
 
744
 {
 
745
-       spin_lock(&dentry->d_lock);
 
746
+       seq_spin_lock(&dentry->d_lock);
 
747
        dentry->d_time = jiffies;
 
748
        ceph_dentry(dentry)->lease_shared_gen = 0;
 
749
-       spin_unlock(&dentry->d_lock);
 
750
+       seq_spin_unlock(&dentry->d_lock);
 
751
 }
 
752
 
 
753
 /*
 
754
@@ -971,7 +971,7 @@ static int dentry_lease_is_valid(struct 
 
755
        struct inode *dir = NULL;
 
756
        u32 seq = 0;
 
757
 
 
758
-       spin_lock(&dentry->d_lock);
 
759
+       seq_spin_lock(&dentry->d_lock);
 
760
        di = ceph_dentry(dentry);
 
761
        if (di && di->lease_session) {
 
762
                s = di->lease_session;
 
763
@@ -995,7 +995,7 @@ static int dentry_lease_is_valid(struct 
 
764
                        }
 
765
                }
 
766
        }
 
767
-       spin_unlock(&dentry->d_lock);
 
768
+       seq_spin_unlock(&dentry->d_lock);
 
769
 
 
770
        if (session) {
 
771
                ceph_mdsc_lease_send_msg(session, dir, dentry,
 
772
Index: linux-3.2/fs/ceph/export.c
 
773
===================================================================
 
774
--- linux-3.2.orig/fs/ceph/export.c
 
775
+++ linux-3.2/fs/ceph/export.c
 
776
@@ -55,9 +55,9 @@ static int ceph_encode_fh(struct dentry 
 
777
        if (ceph_snap(inode) != CEPH_NOSNAP)
 
778
                return -EINVAL;
 
779
 
 
780
-       spin_lock(&dentry->d_lock);
 
781
+       seq_spin_lock(&dentry->d_lock);
 
782
        parent = dget(dentry->d_parent);
 
783
-       spin_unlock(&dentry->d_lock);
 
784
+       seq_spin_unlock(&dentry->d_lock);
 
785
 
 
786
        if (*max_len >= connected_handle_length) {
 
787
                dout("encode_fh %p connectable\n", dentry);
 
788
Index: linux-3.2/fs/ceph/inode.c
 
789
===================================================================
 
790
--- linux-3.2.orig/fs/ceph/inode.c
 
791
+++ linux-3.2/fs/ceph/inode.c
 
792
@@ -809,7 +809,7 @@ static void update_dentry_lease(struct d
 
793
        if (dentry->d_op != &ceph_dentry_ops)
 
794
                return;
 
795
 
 
796
-       spin_lock(&dentry->d_lock);
 
797
+       seq_spin_lock(&dentry->d_lock);
 
798
        dout("update_dentry_lease %p duration %lu ms ttl %lu\n",
 
799
             dentry, duration, ttl);
 
800
 
 
801
@@ -837,7 +837,7 @@ static void update_dentry_lease(struct d
 
802
        di->lease_renew_from = 0;
 
803
        dentry->d_time = ttl;
 
804
 out_unlock:
 
805
-       spin_unlock(&dentry->d_lock);
 
806
+       seq_spin_unlock(&dentry->d_lock);
 
807
        return;
 
808
 }
 
809
 
 
810
@@ -866,13 +866,13 @@ static void ceph_set_dentry_offset(struc
 
811
        di->offset = ceph_inode(inode)->i_max_offset++;
 
812
        spin_unlock(&ci->i_ceph_lock);
 
813
 
 
814
-       spin_lock(&dir->d_lock);
 
815
-       spin_lock_nested(&dn->d_lock, DENTRY_D_LOCK_NESTED);
 
816
+       seq_spin_lock(&dir->d_lock);
 
817
+       seq_spin_lock_nested(&dn->d_lock, DENTRY_D_LOCK_NESTED);
 
818
        list_move(&dn->d_u.d_child, &dir->d_subdirs);
 
819
        dout("set_dentry_offset %p %lld (%p %p)\n", dn, di->offset,
 
820
             dn->d_u.d_child.prev, dn->d_u.d_child.next);
 
821
-       spin_unlock(&dn->d_lock);
 
822
-       spin_unlock(&dir->d_lock);
 
823
+       seq_spin_unlock(&dn->d_lock);
 
824
+       seq_spin_unlock(&dir->d_lock);
 
825
 }
 
826
 
 
827
 /*
 
828
@@ -1254,11 +1254,11 @@ retry_lookup:
 
829
                        goto retry_lookup;
 
830
                } else {
 
831
                        /* reorder parent's d_subdirs */
 
832
-                       spin_lock(&parent->d_lock);
 
833
-                       spin_lock_nested(&dn->d_lock, DENTRY_D_LOCK_NESTED);
 
834
+                       seq_spin_lock(&parent->d_lock);
 
835
+                       seq_spin_lock_nested(&dn->d_lock, DENTRY_D_LOCK_NESTED);
 
836
                        list_move(&dn->d_u.d_child, &parent->d_subdirs);
 
837
-                       spin_unlock(&dn->d_lock);
 
838
-                       spin_unlock(&parent->d_lock);
 
839
+                       seq_spin_unlock(&dn->d_lock);
 
840
+                       seq_spin_unlock(&parent->d_lock);
 
841
                }
 
842
 
 
843
                di = dn->d_fsdata;
 
844
Index: linux-3.2/fs/ceph/mds_client.c
 
845
===================================================================
 
846
--- linux-3.2.orig/fs/ceph/mds_client.c
 
847
+++ linux-3.2/fs/ceph/mds_client.c
 
848
@@ -1488,25 +1488,25 @@ retry:
 
849
        for (temp = dentry; !IS_ROOT(temp) && pos != 0; ) {
 
850
                struct inode *inode;
 
851
 
 
852
-               spin_lock(&temp->d_lock);
 
853
+               seq_spin_lock(&temp->d_lock);
 
854
                inode = temp->d_inode;
 
855
                if (inode && ceph_snap(inode) == CEPH_SNAPDIR) {
 
856
                        dout("build_path path+%d: %p SNAPDIR\n",
 
857
                             pos, temp);
 
858
                } else if (stop_on_nosnap && inode &&
 
859
                           ceph_snap(inode) == CEPH_NOSNAP) {
 
860
-                       spin_unlock(&temp->d_lock);
 
861
+                       seq_spin_unlock(&temp->d_lock);
 
862
                        break;
 
863
                } else {
 
864
                        pos -= temp->d_name.len;
 
865
                        if (pos < 0) {
 
866
-                               spin_unlock(&temp->d_lock);
 
867
+                               seq_spin_unlock(&temp->d_lock);
 
868
                                break;
 
869
                        }
 
870
                        strncpy(path + pos, temp->d_name.name,
 
871
                                temp->d_name.len);
 
872
                }
 
873
-               spin_unlock(&temp->d_lock);
 
874
+               seq_spin_unlock(&temp->d_lock);
 
875
                if (pos)
 
876
                        path[--pos] = '/';
 
877
                temp = temp->d_parent;
 
878
@@ -2768,7 +2768,7 @@ static void handle_lease(struct ceph_mds
 
879
        if (!dentry)
 
880
                goto release;
 
881
 
 
882
-       spin_lock(&dentry->d_lock);
 
883
+       seq_spin_lock(&dentry->d_lock);
 
884
        di = ceph_dentry(dentry);
 
885
        switch (h->action) {
 
886
        case CEPH_MDS_LEASE_REVOKE:
 
887
@@ -2796,7 +2796,7 @@ static void handle_lease(struct ceph_mds
 
888
                }
 
889
                break;
 
890
        }
 
891
-       spin_unlock(&dentry->d_lock);
 
892
+       seq_spin_unlock(&dentry->d_lock);
 
893
        dput(dentry);
 
894
 
 
895
        if (!release)
 
896
@@ -2869,7 +2869,7 @@ void ceph_mdsc_lease_release(struct ceph
 
897
        BUG_ON(dentry == NULL);
 
898
 
 
899
        /* is dentry lease valid? */
 
900
-       spin_lock(&dentry->d_lock);
 
901
+       seq_spin_lock(&dentry->d_lock);
 
902
        di = ceph_dentry(dentry);
 
903
        if (!di || !di->lease_session ||
 
904
            di->lease_session->s_mds < 0 ||
 
905
@@ -2878,7 +2878,7 @@ void ceph_mdsc_lease_release(struct ceph
 
906
                dout("lease_release inode %p dentry %p -- "
 
907
                     "no lease\n",
 
908
                     inode, dentry);
 
909
-               spin_unlock(&dentry->d_lock);
 
910
+               seq_spin_unlock(&dentry->d_lock);
 
911
                return;
 
912
        }
 
913
 
 
914
@@ -2886,7 +2886,7 @@ void ceph_mdsc_lease_release(struct ceph
 
915
        session = ceph_get_mds_session(di->lease_session);
 
916
        seq = di->lease_seq;
 
917
        __ceph_mdsc_drop_dentry_lease(dentry);
 
918
-       spin_unlock(&dentry->d_lock);
 
919
+       seq_spin_unlock(&dentry->d_lock);
 
920
 
 
921
        dout("lease_release inode %p dentry %p to mds%d\n",
 
922
             inode, dentry, session->s_mds);
 
923
Index: linux-3.2/fs/cifs/dir.c
 
924
===================================================================
 
925
--- linux-3.2.orig/fs/cifs/dir.c
 
926
+++ linux-3.2/fs/cifs/dir.c
 
927
@@ -83,10 +83,10 @@ cifs_bp_rename_retry:
 
928
        full_path[namelen] = 0; /* trailing null */
 
929
        rcu_read_lock();
 
930
        for (temp = direntry; !IS_ROOT(temp);) {
 
931
-               spin_lock(&temp->d_lock);
 
932
+               seq_spin_lock(&temp->d_lock);
 
933
                namelen -= 1 + temp->d_name.len;
 
934
                if (namelen < 0) {
 
935
-                       spin_unlock(&temp->d_lock);
 
936
+                       seq_spin_unlock(&temp->d_lock);
 
937
                        break;
 
938
                } else {
 
939
                        full_path[namelen] = dirsep;
 
940
@@ -94,7 +94,7 @@ cifs_bp_rename_retry:
 
941
                                temp->d_name.len);
 
942
                        cFYI(0, "name: %s", full_path + namelen);
 
943
                }
 
944
-               spin_unlock(&temp->d_lock);
 
945
+               seq_spin_unlock(&temp->d_lock);
 
946
                temp = temp->d_parent;
 
947
                if (temp == NULL) {
 
948
                        cERROR(1, "corrupt dentry");
 
949
Index: linux-3.2/fs/coda/cache.c
 
950
===================================================================
 
951
--- linux-3.2.orig/fs/coda/cache.c
 
952
+++ linux-3.2/fs/coda/cache.c
 
953
@@ -92,7 +92,7 @@ static void coda_flag_children(struct de
 
954
        struct list_head *child;
 
955
        struct dentry *de;
 
956
 
 
957
-       spin_lock(&parent->d_lock);
 
958
+       seq_spin_lock(&parent->d_lock);
 
959
        list_for_each(child, &parent->d_subdirs)
 
960
        {
 
961
                de = list_entry(child, struct dentry, d_u.d_child);
 
962
@@ -101,7 +101,7 @@ static void coda_flag_children(struct de
 
963
                        continue;
 
964
                coda_flag_inode(de->d_inode, flag);
 
965
        }
 
966
-       spin_unlock(&parent->d_lock);
 
967
+       seq_spin_unlock(&parent->d_lock);
 
968
        return; 
 
969
 }
 
970
 
 
971
Index: linux-3.2/fs/configfs/configfs_internal.h
 
972
===================================================================
 
973
--- linux-3.2.orig/fs/configfs/configfs_internal.h
 
974
+++ linux-3.2/fs/configfs/configfs_internal.h
 
975
@@ -121,7 +121,7 @@ static inline struct config_item *config
 
976
 {
 
977
        struct config_item * item = NULL;
 
978
 
 
979
-       spin_lock(&dentry->d_lock);
 
980
+       seq_spin_lock(&dentry->d_lock);
 
981
        if (!d_unhashed(dentry)) {
 
982
                struct configfs_dirent * sd = dentry->d_fsdata;
 
983
                if (sd->s_type & CONFIGFS_ITEM_LINK) {
 
984
@@ -130,7 +130,7 @@ static inline struct config_item *config
 
985
                } else
 
986
                        item = config_item_get(sd->s_element);
 
987
        }
 
988
-       spin_unlock(&dentry->d_lock);
 
989
+       seq_spin_unlock(&dentry->d_lock);
 
990
 
 
991
        return item;
 
992
 }
 
993
Index: linux-3.2/fs/configfs/inode.c
 
994
===================================================================
 
995
--- linux-3.2.orig/fs/configfs/inode.c
 
996
+++ linux-3.2/fs/configfs/inode.c
 
997
@@ -251,14 +251,14 @@ void configfs_drop_dentry(struct configf
 
998
        struct dentry * dentry = sd->s_dentry;
 
999
 
 
1000
        if (dentry) {
 
1001
-               spin_lock(&dentry->d_lock);
 
1002
+               seq_spin_lock(&dentry->d_lock);
 
1003
                if (!(d_unhashed(dentry) && dentry->d_inode)) {
 
1004
                        dget_dlock(dentry);
 
1005
                        __d_drop(dentry);
 
1006
-                       spin_unlock(&dentry->d_lock);
 
1007
+                       seq_spin_unlock(&dentry->d_lock);
 
1008
                        simple_unlink(parent->d_inode, dentry);
 
1009
                } else
 
1010
-                       spin_unlock(&dentry->d_lock);
 
1011
+                       seq_spin_unlock(&dentry->d_lock);
 
1012
        }
 
1013
 }
 
1014
 
 
1015
Index: linux-3.2/fs/dcache.c
 
1016
===================================================================
 
1017
--- linux-3.2.orig/fs/dcache.c
 
1018
+++ linux-3.2/fs/dcache.c
 
1019
@@ -172,9 +172,9 @@ static void d_free(struct dentry *dentry
 
1020
  */
 
1021
 static inline void dentry_rcuwalk_barrier(struct dentry *dentry)
 
1022
 {
 
1023
-       assert_spin_locked(&dentry->d_lock);
 
1024
+       assert_seq_spin_locked(&dentry->d_lock);
 
1025
        /* Go through a barrier */
 
1026
-       write_seqcount_barrier(&dentry->d_seq);
 
1027
+       write_seqlock_barrier(&dentry->d_lock);
 
1028
 }
 
1029
 
 
1030
 /*
 
1031
@@ -190,7 +190,7 @@ static void dentry_iput(struct dentry * 
 
1032
        if (inode) {
 
1033
                dentry->d_inode = NULL;
 
1034
                list_del_init(&dentry->d_alias);
 
1035
-               spin_unlock(&dentry->d_lock);
 
1036
+               seq_spin_unlock(&dentry->d_lock);
 
1037
                spin_unlock(&inode->i_lock);
 
1038
                if (!inode->i_nlink)
 
1039
                        fsnotify_inoderemove(inode);
 
1040
@@ -199,7 +199,7 @@ static void dentry_iput(struct dentry * 
 
1041
                else
 
1042
                        iput(inode);
 
1043
        } else {
 
1044
-               spin_unlock(&dentry->d_lock);
 
1045
+               seq_spin_unlock(&dentry->d_lock);
 
1046
        }
 
1047
 }
 
1048
 
 
1049
@@ -215,7 +215,7 @@ static void dentry_unlink_inode(struct d
 
1050
        dentry->d_inode = NULL;
 
1051
        list_del_init(&dentry->d_alias);
 
1052
        dentry_rcuwalk_barrier(dentry);
 
1053
-       spin_unlock(&dentry->d_lock);
 
1054
+       seq_spin_unlock(&dentry->d_lock);
 
1055
        spin_unlock(&inode->i_lock);
 
1056
        if (!inode->i_nlink)
 
1057
                fsnotify_inoderemove(inode);
 
1058
@@ -313,7 +313,7 @@ static struct dentry *d_kill(struct dent
 
1059
         */
 
1060
        dentry->d_flags |= DCACHE_DISCONNECTED;
 
1061
        if (parent)
 
1062
-               spin_unlock(&parent->d_lock);
 
1063
+               seq_spin_unlock(&parent->d_lock);
 
1064
        dentry_iput(dentry);
 
1065
        /*
 
1066
         * dentry_iput drops the locks, at which point nobody (except
 
1067
@@ -370,9 +370,9 @@ EXPORT_SYMBOL(__d_drop);
 
1068
 
 
1069
 void d_drop(struct dentry *dentry)
 
1070
 {
 
1071
-       spin_lock(&dentry->d_lock);
 
1072
+       seq_spin_lock(&dentry->d_lock);
 
1073
        __d_drop(dentry);
 
1074
-       spin_unlock(&dentry->d_lock);
 
1075
+       seq_spin_unlock(&dentry->d_lock);
 
1076
 }
 
1077
 EXPORT_SYMBOL(d_drop);
 
1078
 
 
1079
@@ -387,10 +387,10 @@ EXPORT_SYMBOL(d_drop);
 
1080
  */
 
1081
 void d_clear_need_lookup(struct dentry *dentry)
 
1082
 {
 
1083
-       spin_lock(&dentry->d_lock);
 
1084
+       seq_spin_lock(&dentry->d_lock);
 
1085
        __d_drop(dentry);
 
1086
        dentry->d_flags &= ~DCACHE_NEED_LOOKUP;
 
1087
-       spin_unlock(&dentry->d_lock);
 
1088
+       seq_spin_unlock(&dentry->d_lock);
 
1089
 }
 
1090
 EXPORT_SYMBOL(d_clear_need_lookup);
 
1091
 
 
1092
@@ -409,7 +409,7 @@ static inline struct dentry *dentry_kill
 
1093
        inode = dentry->d_inode;
 
1094
        if (inode && !spin_trylock(&inode->i_lock)) {
 
1095
 relock:
 
1096
-               spin_unlock(&dentry->d_lock);
 
1097
+               seq_spin_unlock(&dentry->d_lock);
 
1098
                cpu_relax();
 
1099
                return dentry; /* try again with same dentry */
 
1100
        }
 
1101
@@ -417,7 +417,7 @@ relock:
 
1102
                parent = NULL;
 
1103
        else
 
1104
                parent = dentry->d_parent;
 
1105
-       if (parent && !spin_trylock(&parent->d_lock)) {
 
1106
+       if (parent && !seq_spin_trylock(&parent->d_lock)) {
 
1107
                if (inode)
 
1108
                        spin_unlock(&inode->i_lock);
 
1109
                goto relock;
 
1110
@@ -470,11 +470,11 @@ void dput(struct dentry *dentry)
 
1111
 repeat:
 
1112
        if (dentry->d_count == 1)
 
1113
                might_sleep();
 
1114
-       spin_lock(&dentry->d_lock);
 
1115
+       seq_spin_lock(&dentry->d_lock);
 
1116
        BUG_ON(!dentry->d_count);
 
1117
        if (dentry->d_count > 1) {
 
1118
                dentry->d_count--;
 
1119
-               spin_unlock(&dentry->d_lock);
 
1120
+               seq_spin_unlock(&dentry->d_lock);
 
1121
                return;
 
1122
        }
 
1123
 
 
1124
@@ -497,7 +497,7 @@ repeat:
 
1125
        dentry_lru_add(dentry);
 
1126
 
 
1127
        dentry->d_count--;
 
1128
-       spin_unlock(&dentry->d_lock);
 
1129
+       seq_spin_unlock(&dentry->d_lock);
 
1130
        return;
 
1131
 
 
1132
 kill_it:
 
1133
@@ -524,9 +524,9 @@ int d_invalidate(struct dentry * dentry)
 
1134
        /*
 
1135
         * If it's already been dropped, return OK.
 
1136
         */
 
1137
-       spin_lock(&dentry->d_lock);
 
1138
+       seq_spin_lock(&dentry->d_lock);
 
1139
        if (d_unhashed(dentry)) {
 
1140
-               spin_unlock(&dentry->d_lock);
 
1141
+               seq_spin_unlock(&dentry->d_lock);
 
1142
                return 0;
 
1143
        }
 
1144
        /*
 
1145
@@ -534,9 +534,9 @@ int d_invalidate(struct dentry * dentry)
 
1146
         * to get rid of unused child entries.
 
1147
         */
 
1148
        if (!list_empty(&dentry->d_subdirs)) {
 
1149
-               spin_unlock(&dentry->d_lock);
 
1150
+               seq_spin_unlock(&dentry->d_lock);
 
1151
                shrink_dcache_parent(dentry);
 
1152
-               spin_lock(&dentry->d_lock);
 
1153
+               seq_spin_lock(&dentry->d_lock);
 
1154
        }
 
1155
 
 
1156
        /*
 
1157
@@ -553,13 +553,13 @@ int d_invalidate(struct dentry * dentry)
 
1158
         */
 
1159
        if (dentry->d_count > 1 && dentry->d_inode) {
 
1160
                if (S_ISDIR(dentry->d_inode->i_mode) || d_mountpoint(dentry)) {
 
1161
-                       spin_unlock(&dentry->d_lock);
 
1162
+                       seq_spin_unlock(&dentry->d_lock);
 
1163
                        return -EBUSY;
 
1164
                }
 
1165
        }
 
1166
 
 
1167
        __d_drop(dentry);
 
1168
-       spin_unlock(&dentry->d_lock);
 
1169
+       seq_spin_unlock(&dentry->d_lock);
 
1170
        return 0;
 
1171
 }
 
1172
 EXPORT_SYMBOL(d_invalidate);
 
1173
@@ -572,9 +572,9 @@ static inline void __dget_dlock(struct d
 
1174
 
 
1175
 static inline void __dget(struct dentry *dentry)
 
1176
 {
 
1177
-       spin_lock(&dentry->d_lock);
 
1178
+       seq_spin_lock(&dentry->d_lock);
 
1179
        __dget_dlock(dentry);
 
1180
-       spin_unlock(&dentry->d_lock);
 
1181
+       seq_spin_unlock(&dentry->d_lock);
 
1182
 }
 
1183
 
 
1184
 struct dentry *dget_parent(struct dentry *dentry)
 
1185
@@ -588,16 +588,16 @@ repeat:
 
1186
         */
 
1187
        rcu_read_lock();
 
1188
        ret = dentry->d_parent;
 
1189
-       spin_lock(&ret->d_lock);
 
1190
+       seq_spin_lock(&ret->d_lock);
 
1191
        if (unlikely(ret != dentry->d_parent)) {
 
1192
-               spin_unlock(&ret->d_lock);
 
1193
+               seq_spin_unlock(&ret->d_lock);
 
1194
                rcu_read_unlock();
 
1195
                goto repeat;
 
1196
        }
 
1197
        rcu_read_unlock();
 
1198
        BUG_ON(!ret->d_count);
 
1199
        ret->d_count++;
 
1200
-       spin_unlock(&ret->d_lock);
 
1201
+       seq_spin_unlock(&ret->d_lock);
 
1202
        return ret;
 
1203
 }
 
1204
 EXPORT_SYMBOL(dget_parent);
 
1205
@@ -625,31 +625,31 @@ static struct dentry *__d_find_alias(str
 
1206
 again:
 
1207
        discon_alias = NULL;
 
1208
        list_for_each_entry(alias, &inode->i_dentry, d_alias) {
 
1209
-               spin_lock(&alias->d_lock);
 
1210
+               seq_spin_lock(&alias->d_lock);
 
1211
                if (S_ISDIR(inode->i_mode) || !d_unhashed(alias)) {
 
1212
                        if (IS_ROOT(alias) &&
 
1213
                            (alias->d_flags & DCACHE_DISCONNECTED)) {
 
1214
                                discon_alias = alias;
 
1215
                        } else if (!want_discon) {
 
1216
                                __dget_dlock(alias);
 
1217
-                               spin_unlock(&alias->d_lock);
 
1218
+                               seq_spin_unlock(&alias->d_lock);
 
1219
                                return alias;
 
1220
                        }
 
1221
                }
 
1222
-               spin_unlock(&alias->d_lock);
 
1223
+               seq_spin_unlock(&alias->d_lock);
 
1224
        }
 
1225
        if (discon_alias) {
 
1226
                alias = discon_alias;
 
1227
-               spin_lock(&alias->d_lock);
 
1228
+               seq_spin_lock(&alias->d_lock);
 
1229
                if (S_ISDIR(inode->i_mode) || !d_unhashed(alias)) {
 
1230
                        if (IS_ROOT(alias) &&
 
1231
                            (alias->d_flags & DCACHE_DISCONNECTED)) {
 
1232
                                __dget_dlock(alias);
 
1233
-                               spin_unlock(&alias->d_lock);
 
1234
+                               seq_spin_unlock(&alias->d_lock);
 
1235
                                return alias;
 
1236
                        }
 
1237
                }
 
1238
-               spin_unlock(&alias->d_lock);
 
1239
+               seq_spin_unlock(&alias->d_lock);
 
1240
                goto again;
 
1241
        }
 
1242
        return NULL;
 
1243
@@ -678,16 +678,16 @@ void d_prune_aliases(struct inode *inode
 
1244
 restart:
 
1245
        spin_lock(&inode->i_lock);
 
1246
        list_for_each_entry(dentry, &inode->i_dentry, d_alias) {
 
1247
-               spin_lock(&dentry->d_lock);
 
1248
+               seq_spin_lock(&dentry->d_lock);
 
1249
                if (!dentry->d_count) {
 
1250
                        __dget_dlock(dentry);
 
1251
                        __d_drop(dentry);
 
1252
-                       spin_unlock(&dentry->d_lock);
 
1253
+                       seq_spin_unlock(&dentry->d_lock);
 
1254
                        spin_unlock(&inode->i_lock);
 
1255
                        dput(dentry);
 
1256
                        goto restart;
 
1257
                }
 
1258
-               spin_unlock(&dentry->d_lock);
 
1259
+               seq_spin_unlock(&dentry->d_lock);
 
1260
        }
 
1261
        spin_unlock(&inode->i_lock);
 
1262
 }
 
1263
@@ -724,10 +724,10 @@ static void try_prune_one_dentry(struct 
 
1264
        /* Prune ancestors. */
 
1265
        dentry = parent;
 
1266
        while (dentry) {
 
1267
-               spin_lock(&dentry->d_lock);
 
1268
+               seq_spin_lock(&dentry->d_lock);
 
1269
                if (dentry->d_count > 1) {
 
1270
                        dentry->d_count--;
 
1271
-                       spin_unlock(&dentry->d_lock);
 
1272
+                       seq_spin_unlock(&dentry->d_lock);
 
1273
                        return;
 
1274
                }
 
1275
                dentry = dentry_kill(dentry, 1);
 
1276
@@ -743,9 +743,9 @@ static void shrink_dentry_list(struct li
 
1277
                dentry = list_entry_rcu(list->prev, struct dentry, d_lru);
 
1278
                if (&dentry->d_lru == list)
 
1279
                        break; /* empty */
 
1280
-               spin_lock(&dentry->d_lock);
 
1281
+               seq_spin_lock(&dentry->d_lock);
 
1282
                if (dentry != list_entry(list->prev, struct dentry, d_lru)) {
 
1283
-                       spin_unlock(&dentry->d_lock);
 
1284
+                       seq_spin_unlock(&dentry->d_lock);
 
1285
                        continue;
 
1286
                }
 
1287
 
 
1288
@@ -756,7 +756,7 @@ static void shrink_dentry_list(struct li
 
1289
                 */
 
1290
                if (dentry->d_count) {
 
1291
                        dentry_lru_del(dentry);
 
1292
-                       spin_unlock(&dentry->d_lock);
 
1293
+                       seq_spin_unlock(&dentry->d_lock);
 
1294
                        continue;
 
1295
                }
 
1296
 
 
1297
@@ -794,7 +794,7 @@ relock:
 
1298
                                struct dentry, d_lru);
 
1299
                BUG_ON(dentry->d_sb != sb);
 
1300
 
 
1301
-               if (!spin_trylock(&dentry->d_lock)) {
 
1302
+               if (!seq_spin_trylock(&dentry->d_lock)) {
 
1303
                        spin_unlock(&dcache_lru_lock);
 
1304
                        cpu_relax();
 
1305
                        goto relock;
 
1306
@@ -803,11 +803,11 @@ relock:
 
1307
                if (dentry->d_flags & DCACHE_REFERENCED) {
 
1308
                        dentry->d_flags &= ~DCACHE_REFERENCED;
 
1309
                        list_move(&dentry->d_lru, &referenced);
 
1310
-                       spin_unlock(&dentry->d_lock);
 
1311
+                       seq_spin_unlock(&dentry->d_lock);
 
1312
                } else {
 
1313
                        list_move_tail(&dentry->d_lru, &tmp);
 
1314
                        dentry->d_flags |= DCACHE_SHRINK_LIST;
 
1315
-                       spin_unlock(&dentry->d_lock);
 
1316
+                       seq_spin_unlock(&dentry->d_lock);
 
1317
                        if (!--count)
 
1318
                                break;
 
1319
                }
 
1320
@@ -960,8 +960,8 @@ static struct dentry *try_to_ascend(stru
 
1321
        struct dentry *new = old->d_parent;
 
1322
 
 
1323
        rcu_read_lock();
 
1324
-       spin_unlock(&old->d_lock);
 
1325
-       spin_lock(&new->d_lock);
 
1326
+       seq_spin_unlock(&old->d_lock);
 
1327
+       seq_spin_lock(&new->d_lock);
 
1328
 
 
1329
        /*
 
1330
         * might go back up the wrong parent if we have had a rename
 
1331
@@ -970,7 +970,7 @@ static struct dentry *try_to_ascend(stru
 
1332
        if (new != old->d_parent ||
 
1333
                 (old->d_flags & DCACHE_DISCONNECTED) ||
 
1334
                 (!locked && read_seqretry(&rename_lock, seq))) {
 
1335
-               spin_unlock(&new->d_lock);
 
1336
+               seq_spin_unlock(&new->d_lock);
 
1337
                new = NULL;
 
1338
        }
 
1339
        rcu_read_unlock();
 
1340
@@ -1004,7 +1004,7 @@ again:
 
1341
 
 
1342
        if (d_mountpoint(parent))
 
1343
                goto positive;
 
1344
-       spin_lock(&this_parent->d_lock);
 
1345
+       seq_spin_lock(&this_parent->d_lock);
 
1346
 repeat:
 
1347
        next = this_parent->d_subdirs.next;
 
1348
 resume:
 
1349
@@ -1013,21 +1013,21 @@ resume:
 
1350
                struct dentry *dentry = list_entry(tmp, struct dentry, d_u.d_child);
 
1351
                next = tmp->next;
 
1352
 
 
1353
-               spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
 
1354
+               seq_spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
 
1355
                /* Have we found a mount point ? */
 
1356
                if (d_mountpoint(dentry)) {
 
1357
-                       spin_unlock(&dentry->d_lock);
 
1358
-                       spin_unlock(&this_parent->d_lock);
 
1359
+                       seq_spin_unlock(&dentry->d_lock);
 
1360
+                       seq_spin_unlock(&this_parent->d_lock);
 
1361
                        goto positive;
 
1362
                }
 
1363
                if (!list_empty(&dentry->d_subdirs)) {
 
1364
-                       spin_unlock(&this_parent->d_lock);
 
1365
-                       spin_release(&dentry->d_lock.dep_map, 1, _RET_IP_);
 
1366
+                       seq_spin_unlock(&this_parent->d_lock);
 
1367
+                       spin_release(&dentry->d_lock.lock.dep_map, 1, _RET_IP_);
 
1368
                        this_parent = dentry;
 
1369
-                       spin_acquire(&this_parent->d_lock.dep_map, 0, 1, _RET_IP_);
 
1370
+                       spin_acquire(&this_parent->d_lock.lock.dep_map, 0, 1, _RET_IP_);
 
1371
                        goto repeat;
 
1372
                }
 
1373
-               spin_unlock(&dentry->d_lock);
 
1374
+               seq_spin_unlock(&dentry->d_lock);
 
1375
        }
 
1376
        /*
 
1377
         * All done at this level ... ascend and resume the search.
 
1378
@@ -1040,7 +1040,7 @@ resume:
 
1379
                next = child->d_u.d_child.next;
 
1380
                goto resume;
 
1381
        }
 
1382
-       spin_unlock(&this_parent->d_lock);
 
1383
+       seq_spin_unlock(&this_parent->d_lock);
 
1384
        if (!locked && read_seqretry(&rename_lock, seq))
 
1385
                goto rename_retry;
 
1386
        if (locked)
 
1387
@@ -1085,7 +1085,7 @@ static int select_parent(struct dentry *
 
1388
        seq = read_seqbegin(&rename_lock);
 
1389
 again:
 
1390
        this_parent = parent;
 
1391
-       spin_lock(&this_parent->d_lock);
 
1392
+       seq_spin_lock(&this_parent->d_lock);
 
1393
 repeat:
 
1394
        next = this_parent->d_subdirs.next;
 
1395
 resume:
 
1396
@@ -1094,7 +1094,7 @@ resume:
 
1397
                struct dentry *dentry = list_entry(tmp, struct dentry, d_u.d_child);
 
1398
                next = tmp->next;
 
1399
 
 
1400
-               spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
 
1401
+               seq_spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
 
1402
 
 
1403
                /*
 
1404
                 * move only zero ref count dentries to the dispose list.
 
1405
@@ -1117,7 +1117,7 @@ resume:
 
1406
                 * the rest.
 
1407
                 */
 
1408
                if (found && need_resched()) {
 
1409
-                       spin_unlock(&dentry->d_lock);
 
1410
+                       seq_spin_unlock(&dentry->d_lock);
 
1411
                        goto out;
 
1412
                }
 
1413
 
 
1414
@@ -1125,14 +1125,14 @@ resume:
 
1415
                 * Descend a level if the d_subdirs list is non-empty.
 
1416
                 */
 
1417
                if (!list_empty(&dentry->d_subdirs)) {
 
1418
-                       spin_unlock(&this_parent->d_lock);
 
1419
-                       spin_release(&dentry->d_lock.dep_map, 1, _RET_IP_);
 
1420
+                       seq_spin_unlock(&this_parent->d_lock);
 
1421
+                       spin_release(&dentry->d_lock.lock.dep_map, 1, _RET_IP_);
 
1422
                        this_parent = dentry;
 
1423
-                       spin_acquire(&this_parent->d_lock.dep_map, 0, 1, _RET_IP_);
 
1424
+                       spin_acquire(&this_parent->d_lock.lock.dep_map, 0, 1, _RET_IP_);
 
1425
                        goto repeat;
 
1426
                }
 
1427
 
 
1428
-               spin_unlock(&dentry->d_lock);
 
1429
+               seq_spin_unlock(&dentry->d_lock);
 
1430
        }
 
1431
        /*
 
1432
         * All done at this level ... ascend and resume the search.
 
1433
@@ -1146,7 +1146,7 @@ resume:
 
1434
                goto resume;
 
1435
        }
 
1436
 out:
 
1437
-       spin_unlock(&this_parent->d_lock);
 
1438
+       seq_spin_unlock(&this_parent->d_lock);
 
1439
        if (!locked && read_seqretry(&rename_lock, seq))
 
1440
                goto rename_retry;
 
1441
        if (locked)
 
1442
@@ -1214,8 +1214,7 @@ struct dentry *__d_alloc(struct super_bl
 
1443
 
 
1444
        dentry->d_count = 1;
 
1445
        dentry->d_flags = 0;
 
1446
-       spin_lock_init(&dentry->d_lock);
 
1447
-       seqcount_init(&dentry->d_seq);
 
1448
+       seqlock_init(&dentry->d_lock);
 
1449
        dentry->d_inode = NULL;
 
1450
        dentry->d_parent = dentry;
 
1451
        dentry->d_sb = sb;
 
1452
@@ -1248,7 +1247,7 @@ struct dentry *d_alloc(struct dentry * p
 
1453
        if (!dentry)
 
1454
                return NULL;
 
1455
 
 
1456
-       spin_lock(&parent->d_lock);
 
1457
+       seq_spin_lock(&parent->d_lock);
 
1458
        /*
 
1459
         * don't need child lock because it is not subject
 
1460
         * to concurrency here
 
1461
@@ -1256,7 +1255,7 @@ struct dentry *d_alloc(struct dentry * p
 
1462
        __dget_dlock(parent);
 
1463
        dentry->d_parent = parent;
 
1464
        list_add(&dentry->d_u.d_child, &parent->d_subdirs);
 
1465
-       spin_unlock(&parent->d_lock);
 
1466
+       seq_spin_unlock(&parent->d_lock);
 
1467
 
 
1468
        return dentry;
 
1469
 }
 
1470
@@ -1308,7 +1307,7 @@ EXPORT_SYMBOL(d_set_d_op);
 
1471
 
 
1472
 static void __d_instantiate(struct dentry *dentry, struct inode *inode)
 
1473
 {
 
1474
-       spin_lock(&dentry->d_lock);
 
1475
+       seq_spin_lock(&dentry->d_lock);
 
1476
        if (inode) {
 
1477
                if (unlikely(IS_AUTOMOUNT(inode)))
 
1478
                        dentry->d_flags |= DCACHE_NEED_AUTOMOUNT;
 
1479
@@ -1316,7 +1315,7 @@ static void __d_instantiate(struct dentr
 
1480
        }
 
1481
        dentry->d_inode = inode;
 
1482
        dentry_rcuwalk_barrier(dentry);
 
1483
-       spin_unlock(&dentry->d_lock);
 
1484
+       seq_spin_unlock(&dentry->d_lock);
 
1485
        fsnotify_d_instantiate(dentry, inode);
 
1486
 }
 
1487
 
 
1488
@@ -1516,14 +1515,14 @@ struct dentry *d_obtain_alias(struct ino
 
1489
        }
 
1490
 
 
1491
        /* attach a disconnected dentry */
 
1492
-       spin_lock(&tmp->d_lock);
 
1493
+       seq_spin_lock(&tmp->d_lock);
 
1494
        tmp->d_inode = inode;
 
1495
        tmp->d_flags |= DCACHE_DISCONNECTED;
 
1496
        list_add(&tmp->d_alias, &inode->i_dentry);
 
1497
        hlist_bl_lock(&tmp->d_sb->s_anon);
 
1498
        hlist_bl_add_head(&tmp->d_hash, &tmp->d_sb->s_anon);
 
1499
        hlist_bl_unlock(&tmp->d_sb->s_anon);
 
1500
-       spin_unlock(&tmp->d_lock);
 
1501
+       seq_spin_unlock(&tmp->d_lock);
 
1502
        spin_unlock(&inode->i_lock);
 
1503
        security_d_instantiate(tmp, inode);
 
1504
 
 
1505
@@ -1731,7 +1730,7 @@ struct dentry *__d_lookup_rcu(struct den
 
1506
                        continue;
 
1507
 
 
1508
 seqretry:
 
1509
-               *seq = read_seqcount_begin(&dentry->d_seq);
 
1510
+               *seq = read_seqbegin(&dentry->d_lock);
 
1511
                if (dentry->d_parent != parent)
 
1512
                        continue;
 
1513
                if (d_unhashed(dentry))
 
1514
@@ -1746,7 +1745,7 @@ seqretry:
 
1515
                 * edge of memory when walking. If we could load this
 
1516
                 * atomically some other way, we could drop this check.
 
1517
                 */
 
1518
-               if (read_seqcount_retry(&dentry->d_seq, *seq))
 
1519
+               if (read_seqretry(&dentry->d_lock, *seq))
 
1520
                        goto seqretry;
 
1521
                if (unlikely(parent->d_flags & DCACHE_OP_COMPARE)) {
 
1522
                        if (parent->d_op->d_compare(parent, *inode,
 
1523
@@ -1849,7 +1848,7 @@ struct dentry *__d_lookup(struct dentry 
 
1524
                if (dentry->d_name.hash != hash)
 
1525
                        continue;
 
1526
 
 
1527
-               spin_lock(&dentry->d_lock);
 
1528
+               seq_spin_lock(&dentry->d_lock);
 
1529
                if (dentry->d_parent != parent)
 
1530
                        goto next;
 
1531
                if (d_unhashed(dentry))
 
1532
@@ -1873,10 +1872,10 @@ struct dentry *__d_lookup(struct dentry 
 
1533
 
 
1534
                dentry->d_count++;
 
1535
                found = dentry;
 
1536
-               spin_unlock(&dentry->d_lock);
 
1537
+               seq_spin_unlock(&dentry->d_lock);
 
1538
                break;
 
1539
 next:
 
1540
-               spin_unlock(&dentry->d_lock);
 
1541
+               seq_spin_unlock(&dentry->d_lock);
 
1542
        }
 
1543
        rcu_read_unlock();
 
1544
 
 
1545
@@ -1924,17 +1923,17 @@ int d_validate(struct dentry *dentry, st
 
1546
 {
 
1547
        struct dentry *child;
 
1548
 
 
1549
-       spin_lock(&dparent->d_lock);
 
1550
+       seq_spin_lock(&dparent->d_lock);
 
1551
        list_for_each_entry(child, &dparent->d_subdirs, d_u.d_child) {
 
1552
                if (dentry == child) {
 
1553
-                       spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
 
1554
+                       seq_spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
 
1555
                        __dget_dlock(dentry);
 
1556
-                       spin_unlock(&dentry->d_lock);
 
1557
-                       spin_unlock(&dparent->d_lock);
 
1558
+                       seq_spin_unlock(&dentry->d_lock);
 
1559
+                       seq_spin_unlock(&dparent->d_lock);
 
1560
                        return 1;
 
1561
                }
 
1562
        }
 
1563
-       spin_unlock(&dparent->d_lock);
 
1564
+       seq_spin_unlock(&dparent->d_lock);
 
1565
 
 
1566
        return 0;
 
1567
 }
 
1568
@@ -1969,12 +1968,12 @@ void d_delete(struct dentry * dentry)
 
1569
         * Are we the only user?
 
1570
         */
 
1571
 again:
 
1572
-       spin_lock(&dentry->d_lock);
 
1573
+       seq_spin_lock(&dentry->d_lock);
 
1574
        inode = dentry->d_inode;
 
1575
        isdir = S_ISDIR(inode->i_mode);
 
1576
        if (dentry->d_count == 1) {
 
1577
                if (inode && !spin_trylock(&inode->i_lock)) {
 
1578
-                       spin_unlock(&dentry->d_lock);
 
1579
+                       seq_spin_unlock(&dentry->d_lock);
 
1580
                        cpu_relax();
 
1581
                        goto again;
 
1582
                }
 
1583
@@ -1987,7 +1986,7 @@ again:
 
1584
        if (!d_unhashed(dentry))
 
1585
                __d_drop(dentry);
 
1586
 
 
1587
-       spin_unlock(&dentry->d_lock);
 
1588
+       seq_spin_unlock(&dentry->d_lock);
 
1589
 
 
1590
        fsnotify_nameremove(dentry, isdir);
 
1591
 }
 
1592
@@ -2016,9 +2015,9 @@ static void _d_rehash(struct dentry * en
 
1593
  
 
1594
 void d_rehash(struct dentry * entry)
 
1595
 {
 
1596
-       spin_lock(&entry->d_lock);
 
1597
+       seq_spin_lock(&entry->d_lock);
 
1598
        _d_rehash(entry);
 
1599
-       spin_unlock(&entry->d_lock);
 
1600
+       seq_spin_unlock(&entry->d_lock);
 
1601
 }
 
1602
 EXPORT_SYMBOL(d_rehash);
 
1603
 
 
1604
@@ -2041,11 +2040,9 @@ void dentry_update_name_case(struct dent
 
1605
        BUG_ON(!mutex_is_locked(&dentry->d_parent->d_inode->i_mutex));
 
1606
        BUG_ON(dentry->d_name.len != name->len); /* d_lookup gives this */
 
1607
 
 
1608
-       spin_lock(&dentry->d_lock);
 
1609
-       write_seqcount_begin(&dentry->d_seq);
 
1610
+       write_seqlock(&dentry->d_lock);
 
1611
        memcpy((unsigned char *)dentry->d_name.name, name->name, name->len);
 
1612
-       write_seqcount_end(&dentry->d_seq);
 
1613
-       spin_unlock(&dentry->d_lock);
 
1614
+       write_sequnlock(&dentry->d_lock);
 
1615
 }
 
1616
 EXPORT_SYMBOL(dentry_update_name_case);
 
1617
 
 
1618
@@ -2096,24 +2093,24 @@ static void dentry_lock_for_move(struct 
 
1619
         * XXXX: do we really need to take target->d_lock?
 
1620
         */
 
1621
        if (IS_ROOT(dentry) || dentry->d_parent == target->d_parent)
 
1622
-               spin_lock(&target->d_parent->d_lock);
 
1623
+               seq_spin_lock(&target->d_parent->d_lock);
 
1624
        else {
 
1625
                if (d_ancestor(dentry->d_parent, target->d_parent)) {
 
1626
-                       spin_lock(&dentry->d_parent->d_lock);
 
1627
-                       spin_lock_nested(&target->d_parent->d_lock,
 
1628
-                                               DENTRY_D_LOCK_NESTED);
 
1629
+                       seq_spin_lock(&dentry->d_parent->d_lock);
 
1630
+                       seq_spin_lock_nested(&target->d_parent->d_lock,
 
1631
+                                           DENTRY_D_LOCK_NESTED);
 
1632
                } else {
 
1633
-                       spin_lock(&target->d_parent->d_lock);
 
1634
-                       spin_lock_nested(&dentry->d_parent->d_lock,
 
1635
-                                               DENTRY_D_LOCK_NESTED);
 
1636
+                       seq_spin_lock(&target->d_parent->d_lock);
 
1637
+                       seq_spin_lock_nested(&dentry->d_parent->d_lock,
 
1638
+                                           DENTRY_D_LOCK_NESTED);
 
1639
                }
 
1640
        }
 
1641
        if (target < dentry) {
 
1642
-               spin_lock_nested(&target->d_lock, 2);
 
1643
-               spin_lock_nested(&dentry->d_lock, 3);
 
1644
+               seq_spin_lock_nested(&target->d_lock, 2);
 
1645
+               seq_spin_lock_nested(&dentry->d_lock, 3);
 
1646
        } else {
 
1647
-               spin_lock_nested(&dentry->d_lock, 2);
 
1648
-               spin_lock_nested(&target->d_lock, 3);
 
1649
+               seq_spin_lock_nested(&dentry->d_lock, 2);
 
1650
+               seq_spin_lock_nested(&target->d_lock, 3);
 
1651
        }
 
1652
 }
 
1653
 
 
1654
@@ -2121,9 +2118,9 @@ static void dentry_unlock_parents_for_mo
 
1655
                                        struct dentry *target)
 
1656
 {
 
1657
        if (target->d_parent != dentry->d_parent)
 
1658
-               spin_unlock(&dentry->d_parent->d_lock);
 
1659
+               seq_spin_unlock(&dentry->d_parent->d_lock);
 
1660
        if (target->d_parent != target)
 
1661
-               spin_unlock(&target->d_parent->d_lock);
 
1662
+               seq_spin_unlock(&target->d_parent->d_lock);
 
1663
 }
 
1664
 
 
1665
 /*
 
1666
@@ -2157,8 +2154,8 @@ static void __d_move(struct dentry * den
 
1667
 
 
1668
        dentry_lock_for_move(dentry, target);
 
1669
 
 
1670
-       write_seqcount_begin(&dentry->d_seq);
 
1671
-       write_seqcount_begin(&target->d_seq);
 
1672
+       write_seqlock_begin(&dentry->d_lock);
 
1673
+       write_seqlock_begin(&target->d_lock);
 
1674
 
 
1675
        /* __d_drop does write_seqcount_barrier, but they're OK to nest. */
 
1676
 
 
1677
@@ -2193,13 +2190,13 @@ static void __d_move(struct dentry * den
 
1678
 
 
1679
        list_add(&dentry->d_u.d_child, &dentry->d_parent->d_subdirs);
 
1680
 
 
1681
-       write_seqcount_end(&target->d_seq);
 
1682
-       write_seqcount_end(&dentry->d_seq);
 
1683
+       write_seqlock_end(&target->d_lock);
 
1684
+       write_seqlock_end(&dentry->d_lock);
 
1685
 
 
1686
        dentry_unlock_parents_for_move(dentry, target);
 
1687
-       spin_unlock(&target->d_lock);
 
1688
+       seq_spin_unlock(&target->d_lock);
 
1689
        fsnotify_d_move(dentry);
 
1690
-       spin_unlock(&dentry->d_lock);
 
1691
+       seq_spin_unlock(&dentry->d_lock);
 
1692
 }
 
1693
 
 
1694
 /*
 
1695
@@ -2288,8 +2285,8 @@ static void __d_materialise_dentry(struc
 
1696
 
 
1697
        dentry_lock_for_move(anon, dentry);
 
1698
 
 
1699
-       write_seqcount_begin(&dentry->d_seq);
 
1700
-       write_seqcount_begin(&anon->d_seq);
 
1701
+       write_seqlock_begin(&dentry->d_lock);
 
1702
+       write_seqlock_begin(&anon->d_lock);
 
1703
 
 
1704
        dparent = dentry->d_parent;
 
1705
        aparent = anon->d_parent;
 
1706
@@ -2311,11 +2308,11 @@ static void __d_materialise_dentry(struc
 
1707
        else
 
1708
                INIT_LIST_HEAD(&anon->d_u.d_child);
 
1709
 
 
1710
-       write_seqcount_end(&dentry->d_seq);
 
1711
-       write_seqcount_end(&anon->d_seq);
 
1712
+       write_seqlock_end(&dentry->d_lock);
 
1713
+       write_seqlock_end(&anon->d_lock);
 
1714
 
 
1715
        dentry_unlock_parents_for_move(anon, dentry);
 
1716
-       spin_unlock(&dentry->d_lock);
 
1717
+       seq_spin_unlock(&dentry->d_lock);
 
1718
 
 
1719
        /* anon->d_lock still locked, returns locked */
 
1720
        anon->d_flags &= ~DCACHE_DISCONNECTED;
 
1721
@@ -2391,10 +2388,10 @@ struct dentry *d_materialise_unique(stru
 
1722
        else
 
1723
                BUG_ON(!d_unhashed(actual));
 
1724
 
 
1725
-       spin_lock(&actual->d_lock);
 
1726
+       seq_spin_lock(&actual->d_lock);
 
1727
 found:
 
1728
        _d_rehash(actual);
 
1729
-       spin_unlock(&actual->d_lock);
 
1730
+       seq_spin_unlock(&actual->d_lock);
 
1731
        spin_unlock(&inode->i_lock);
 
1732
 out_nolock:
 
1733
        if (actual == dentry) {
 
1734
@@ -2455,9 +2452,9 @@ static int prepend_path(const struct pat
 
1735
                }
 
1736
                parent = dentry->d_parent;
 
1737
                prefetch(parent);
 
1738
-               spin_lock(&dentry->d_lock);
 
1739
+               seq_spin_lock(&dentry->d_lock);
 
1740
                error = prepend_name(buffer, buflen, &dentry->d_name);
 
1741
-               spin_unlock(&dentry->d_lock);
 
1742
+               seq_spin_unlock(&dentry->d_lock);
 
1743
                if (!error)
 
1744
                        error = prepend(buffer, buflen, "/", 1);
 
1745
                if (error)
 
1746
@@ -2682,9 +2679,9 @@ static char *__dentry_path(struct dentry
 
1747
                int error;
 
1748
 
 
1749
                prefetch(parent);
 
1750
-               spin_lock(&dentry->d_lock);
 
1751
+               seq_spin_lock(&dentry->d_lock);
 
1752
                error = prepend_name(&end, &buflen, &dentry->d_name);
 
1753
-               spin_unlock(&dentry->d_lock);
 
1754
+               seq_spin_unlock(&dentry->d_lock);
 
1755
                if (error != 0 || prepend(&end, &buflen, "/", 1) != 0)
 
1756
                        goto Elong;
 
1757
 
 
1758
@@ -2874,7 +2871,7 @@ void d_genocide(struct dentry *root)
 
1759
        seq = read_seqbegin(&rename_lock);
 
1760
 again:
 
1761
        this_parent = root;
 
1762
-       spin_lock(&this_parent->d_lock);
 
1763
+       seq_spin_lock(&this_parent->d_lock);
 
1764
 repeat:
 
1765
        next = this_parent->d_subdirs.next;
 
1766
 resume:
 
1767
@@ -2883,23 +2880,23 @@ resume:
 
1768
                struct dentry *dentry = list_entry(tmp, struct dentry, d_u.d_child);
 
1769
                next = tmp->next;
 
1770
 
 
1771
-               spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
 
1772
+               seq_spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
 
1773
                if (d_unhashed(dentry) || !dentry->d_inode) {
 
1774
-                       spin_unlock(&dentry->d_lock);
 
1775
+                       seq_spin_unlock(&dentry->d_lock);
 
1776
                        continue;
 
1777
                }
 
1778
                if (!list_empty(&dentry->d_subdirs)) {
 
1779
-                       spin_unlock(&this_parent->d_lock);
 
1780
-                       spin_release(&dentry->d_lock.dep_map, 1, _RET_IP_);
 
1781
+                       seq_spin_unlock(&this_parent->d_lock);
 
1782
+                       spin_release(&dentry->d_lock.lock.dep_map, 1, _RET_IP_);
 
1783
                        this_parent = dentry;
 
1784
-                       spin_acquire(&this_parent->d_lock.dep_map, 0, 1, _RET_IP_);
 
1785
+                       spin_acquire(&this_parent->d_lock.lock.dep_map, 0, 1, _RET_IP_);
 
1786
                        goto repeat;
 
1787
                }
 
1788
                if (!(dentry->d_flags & DCACHE_GENOCIDE)) {
 
1789
                        dentry->d_flags |= DCACHE_GENOCIDE;
 
1790
                        dentry->d_count--;
 
1791
                }
 
1792
-               spin_unlock(&dentry->d_lock);
 
1793
+               seq_spin_unlock(&dentry->d_lock);
 
1794
        }
 
1795
        if (this_parent != root) {
 
1796
                struct dentry *child = this_parent;
 
1797
@@ -2913,7 +2910,7 @@ resume:
 
1798
                next = child->d_u.d_child.next;
 
1799
                goto resume;
 
1800
        }
 
1801
-       spin_unlock(&this_parent->d_lock);
 
1802
+       seq_spin_unlock(&this_parent->d_lock);
 
1803
        if (!locked && read_seqretry(&rename_lock, seq))
 
1804
                goto rename_retry;
 
1805
        if (locked)
 
1806
Index: linux-3.2/fs/dcookies.c
 
1807
===================================================================
 
1808
--- linux-3.2.orig/fs/dcookies.c
 
1809
+++ linux-3.2/fs/dcookies.c
 
1810
@@ -98,9 +98,9 @@ static struct dcookie_struct *alloc_dcoo
 
1811
                return NULL;
 
1812
 
 
1813
        d = path->dentry;
 
1814
-       spin_lock(&d->d_lock);
 
1815
+       seq_spin_lock(&d->d_lock);
 
1816
        d->d_flags |= DCACHE_COOKIE;
 
1817
-       spin_unlock(&d->d_lock);
 
1818
+       seq_spin_unlock(&d->d_lock);
 
1819
 
 
1820
        dcs->path = *path;
 
1821
        path_get(path);
 
1822
@@ -267,9 +267,9 @@ static void free_dcookie(struct dcookie_
 
1823
 {
 
1824
        struct dentry *d = dcs->path.dentry;
 
1825
 
 
1826
-       spin_lock(&d->d_lock);
 
1827
+       seq_spin_lock(&d->d_lock);
 
1828
        d->d_flags &= ~DCACHE_COOKIE;
 
1829
-       spin_unlock(&d->d_lock);
 
1830
+       seq_spin_unlock(&d->d_lock);
 
1831
 
 
1832
        path_put(&dcs->path);
 
1833
        kmem_cache_free(dcookie_cache, dcs);
 
1834
Index: linux-3.2/fs/exportfs/expfs.c
 
1835
===================================================================
 
1836
--- linux-3.2.orig/fs/exportfs/expfs.c
 
1837
+++ linux-3.2/fs/exportfs/expfs.c
 
1838
@@ -114,15 +114,15 @@ reconnect_path(struct vfsmount *mnt, str
 
1839
 
 
1840
                if (!IS_ROOT(pd)) {
 
1841
                        /* must have found a connected parent - great */
 
1842
-                       spin_lock(&pd->d_lock);
 
1843
+                       seq_spin_lock(&pd->d_lock);
 
1844
                        pd->d_flags &= ~DCACHE_DISCONNECTED;
 
1845
-                       spin_unlock(&pd->d_lock);
 
1846
+                       seq_spin_unlock(&pd->d_lock);
 
1847
                        noprogress = 0;
 
1848
                } else if (pd == mnt->mnt_sb->s_root) {
 
1849
                        printk(KERN_ERR "export: Eeek filesystem root is not connected, impossible\n");
 
1850
-                       spin_lock(&pd->d_lock);
 
1851
+                       seq_spin_lock(&pd->d_lock);
 
1852
                        pd->d_flags &= ~DCACHE_DISCONNECTED;
 
1853
-                       spin_unlock(&pd->d_lock);
 
1854
+                       seq_spin_unlock(&pd->d_lock);
 
1855
                        noprogress = 0;
 
1856
                } else {
 
1857
                        /*
 
1858
@@ -335,11 +335,11 @@ static int export_encode_fh(struct dentr
 
1859
        if (connectable && !S_ISDIR(inode->i_mode)) {
 
1860
                struct inode *parent;
 
1861
 
 
1862
-               spin_lock(&dentry->d_lock);
 
1863
+               seq_spin_lock(&dentry->d_lock);
 
1864
                parent = dentry->d_parent->d_inode;
 
1865
                fid->i32.parent_ino = parent->i_ino;
 
1866
                fid->i32.parent_gen = parent->i_generation;
 
1867
-               spin_unlock(&dentry->d_lock);
 
1868
+               seq_spin_unlock(&dentry->d_lock);
 
1869
                len = 4;
 
1870
                type = FILEID_INO32_GEN_PARENT;
 
1871
        }
 
1872
Index: linux-3.2/fs/fat/inode.c
 
1873
===================================================================
 
1874
--- linux-3.2.orig/fs/fat/inode.c
 
1875
+++ linux-3.2/fs/fat/inode.c
 
1876
@@ -772,9 +772,9 @@ fat_encode_fh(struct dentry *de, __u32 *
 
1877
        fh[1] = inode->i_generation;
 
1878
        fh[2] = ipos_h;
 
1879
        fh[3] = ipos_m | MSDOS_I(inode)->i_logstart;
 
1880
-       spin_lock(&de->d_lock);
 
1881
+       seq_spin_lock(&de->d_lock);
 
1882
        fh[4] = ipos_l | MSDOS_I(de->d_parent->d_inode)->i_logstart;
 
1883
-       spin_unlock(&de->d_lock);
 
1884
+       seq_spin_unlock(&de->d_lock);
 
1885
        return 3;
 
1886
 }
 
1887
 
 
1888
Index: linux-3.2/fs/fat/namei_vfat.c
 
1889
===================================================================
 
1890
--- linux-3.2.orig/fs/fat/namei_vfat.c
 
1891
+++ linux-3.2/fs/fat/namei_vfat.c
 
1892
@@ -34,10 +34,10 @@
 
1893
 static int vfat_revalidate_shortname(struct dentry *dentry)
 
1894
 {
 
1895
        int ret = 1;
 
1896
-       spin_lock(&dentry->d_lock);
 
1897
+       seq_spin_lock(&dentry->d_lock);
 
1898
        if (dentry->d_time != dentry->d_parent->d_inode->i_version)
 
1899
                ret = 0;
 
1900
-       spin_unlock(&dentry->d_lock);
 
1901
+       seq_spin_unlock(&dentry->d_lock);
 
1902
        return ret;
 
1903
 }
 
1904
 
 
1905
Index: linux-3.2/fs/fs-writeback.c
 
1906
===================================================================
 
1907
--- linux-3.2.orig/fs/fs-writeback.c
 
1908
+++ linux-3.2/fs/fs-writeback.c
 
1909
@@ -1010,7 +1010,7 @@ static noinline void block_dump___mark_i
 
1910
 
 
1911
                dentry = d_find_alias(inode);
 
1912
                if (dentry) {
 
1913
-                       spin_lock(&dentry->d_lock);
 
1914
+                       seq_spin_lock(&dentry->d_lock);
 
1915
                        name = (const char *) dentry->d_name.name;
 
1916
                }
 
1917
                printk(KERN_DEBUG
 
1918
@@ -1018,7 +1018,7 @@ static noinline void block_dump___mark_i
 
1919
                       current->comm, task_pid_nr(current), inode->i_ino,
 
1920
                       name, inode->i_sb->s_id);
 
1921
                if (dentry) {
 
1922
-                       spin_unlock(&dentry->d_lock);
 
1923
+                       seq_spin_unlock(&dentry->d_lock);
 
1924
                        dput(dentry);
 
1925
                }
 
1926
        }
 
1927
Index: linux-3.2/fs/fuse/inode.c
 
1928
===================================================================
 
1929
--- linux-3.2.orig/fs/fuse/inode.c
 
1930
+++ linux-3.2/fs/fuse/inode.c
 
1931
@@ -652,11 +652,11 @@ static int fuse_encode_fh(struct dentry 
 
1932
        if (encode_parent) {
 
1933
                struct inode *parent;
 
1934
 
 
1935
-               spin_lock(&dentry->d_lock);
 
1936
+               seq_spin_lock(&dentry->d_lock);
 
1937
                parent = dentry->d_parent->d_inode;
 
1938
                nodeid = get_fuse_inode(parent)->nodeid;
 
1939
                generation = parent->i_generation;
 
1940
-               spin_unlock(&dentry->d_lock);
 
1941
+               seq_spin_unlock(&dentry->d_lock);
 
1942
 
 
1943
                fh[3] = (u32)(nodeid >> 32);
 
1944
                fh[4] = (u32)(nodeid & 0xffffffff);
 
1945
Index: linux-3.2/fs/gfs2/export.c
 
1946
===================================================================
 
1947
--- linux-3.2.orig/fs/gfs2/export.c
 
1948
+++ linux-3.2/fs/gfs2/export.c
 
1949
@@ -53,11 +53,11 @@ static int gfs2_encode_fh(struct dentry 
 
1950
        if (!connectable || inode == sb->s_root->d_inode)
 
1951
                return *len;
 
1952
 
 
1953
-       spin_lock(&dentry->d_lock);
 
1954
+       seq_spin_lock(&dentry->d_lock);
 
1955
        inode = dentry->d_parent->d_inode;
 
1956
        ip = GFS2_I(inode);
 
1957
        igrab(inode);
 
1958
-       spin_unlock(&dentry->d_lock);
 
1959
+       seq_spin_unlock(&dentry->d_lock);
 
1960
 
 
1961
        fh[4] = cpu_to_be32(ip->i_no_formal_ino >> 32);
 
1962
        fh[5] = cpu_to_be32(ip->i_no_formal_ino & 0xFFFFFFFF);
 
1963
Index: linux-3.2/fs/isofs/export.c
 
1964
===================================================================
 
1965
--- linux-3.2.orig/fs/isofs/export.c
 
1966
+++ linux-3.2/fs/isofs/export.c
 
1967
@@ -139,13 +139,13 @@ isofs_export_encode_fh(struct dentry *de
 
1968
        if (connectable && !S_ISDIR(inode->i_mode)) {
 
1969
                struct inode *parent;
 
1970
                struct iso_inode_info *eparent;
 
1971
-               spin_lock(&dentry->d_lock);
 
1972
+               seq_spin_lock(&dentry->d_lock);
 
1973
                parent = dentry->d_parent->d_inode;
 
1974
                eparent = ISOFS_I(parent);
 
1975
                fh32[3] = eparent->i_iget5_block;
 
1976
                fh16[3] = (__u16)eparent->i_iget5_offset;  /* fh16 [sic] */
 
1977
                fh32[4] = parent->i_generation;
 
1978
-               spin_unlock(&dentry->d_lock);
 
1979
+               seq_spin_unlock(&dentry->d_lock);
 
1980
                len = 5;
 
1981
                type = 2;
 
1982
        }
 
1983
Index: linux-3.2/fs/libfs.c
 
1984
===================================================================
 
1985
--- linux-3.2.orig/fs/libfs.c
 
1986
+++ linux-3.2/fs/libfs.c
 
1987
@@ -102,21 +102,21 @@ loff_t dcache_dir_lseek(struct file *fil
 
1988
                        struct dentry *cursor = file->private_data;
 
1989
                        loff_t n = file->f_pos - 2;
 
1990
 
 
1991
-                       spin_lock(&dentry->d_lock);
 
1992
+                       seq_spin_lock(&dentry->d_lock);
 
1993
                        /* d_lock not required for cursor */
 
1994
                        list_del(&cursor->d_u.d_child);
 
1995
                        p = dentry->d_subdirs.next;
 
1996
                        while (n && p != &dentry->d_subdirs) {
 
1997
                                struct dentry *next;
 
1998
                                next = list_entry(p, struct dentry, d_u.d_child);
 
1999
-                               spin_lock_nested(&next->d_lock, DENTRY_D_LOCK_NESTED);
 
2000
+                               seq_spin_lock_nested(&next->d_lock, DENTRY_D_LOCK_NESTED);
 
2001
                                if (simple_positive(next))
 
2002
                                        n--;
 
2003
-                               spin_unlock(&next->d_lock);
 
2004
+                               seq_spin_unlock(&next->d_lock);
 
2005
                                p = p->next;
 
2006
                        }
 
2007
                        list_add_tail(&cursor->d_u.d_child, p);
 
2008
-                       spin_unlock(&dentry->d_lock);
 
2009
+                       seq_spin_unlock(&dentry->d_lock);
 
2010
                }
 
2011
        }
 
2012
        mutex_unlock(&dentry->d_inode->i_mutex);
 
2013
@@ -159,35 +159,35 @@ int dcache_readdir(struct file * filp, v
 
2014
                        i++;
 
2015
                        /* fallthrough */
 
2016
                default:
 
2017
-                       spin_lock(&dentry->d_lock);
 
2018
+                       seq_spin_lock(&dentry->d_lock);
 
2019
                        if (filp->f_pos == 2)
 
2020
                                list_move(q, &dentry->d_subdirs);
 
2021
 
 
2022
                        for (p=q->next; p != &dentry->d_subdirs; p=p->next) {
 
2023
                                struct dentry *next;
 
2024
                                next = list_entry(p, struct dentry, d_u.d_child);
 
2025
-                               spin_lock_nested(&next->d_lock, DENTRY_D_LOCK_NESTED);
 
2026
+                               seq_spin_lock_nested(&next->d_lock, DENTRY_D_LOCK_NESTED);
 
2027
                                if (!simple_positive(next)) {
 
2028
-                                       spin_unlock(&next->d_lock);
 
2029
+                                       seq_spin_unlock(&next->d_lock);
 
2030
                                        continue;
 
2031
                                }
 
2032
 
 
2033
-                               spin_unlock(&next->d_lock);
 
2034
-                               spin_unlock(&dentry->d_lock);
 
2035
+                               seq_spin_unlock(&next->d_lock);
 
2036
+                               seq_spin_unlock(&dentry->d_lock);
 
2037
                                if (filldir(dirent, next->d_name.name, 
 
2038
                                            next->d_name.len, filp->f_pos, 
 
2039
                                            next->d_inode->i_ino, 
 
2040
                                            dt_type(next->d_inode)) < 0)
 
2041
                                        return 0;
 
2042
-                               spin_lock(&dentry->d_lock);
 
2043
-                               spin_lock_nested(&next->d_lock, DENTRY_D_LOCK_NESTED);
 
2044
+                               seq_spin_lock(&dentry->d_lock);
 
2045
+                               seq_spin_lock_nested(&next->d_lock, DENTRY_D_LOCK_NESTED);
 
2046
                                /* next is still alive */
 
2047
                                list_move(q, p);
 
2048
-                               spin_unlock(&next->d_lock);
 
2049
+                               seq_spin_unlock(&next->d_lock);
 
2050
                                p = q;
 
2051
                                filp->f_pos++;
 
2052
                        }
 
2053
-                       spin_unlock(&dentry->d_lock);
 
2054
+                       seq_spin_unlock(&dentry->d_lock);
 
2055
        }
 
2056
        return 0;
 
2057
 }
 
2058
@@ -281,18 +281,18 @@ int simple_empty(struct dentry *dentry)
 
2059
        struct dentry *child;
 
2060
        int ret = 0;
 
2061
 
 
2062
-       spin_lock(&dentry->d_lock);
 
2063
+       seq_spin_lock(&dentry->d_lock);
 
2064
        list_for_each_entry(child, &dentry->d_subdirs, d_u.d_child) {
 
2065
-               spin_lock_nested(&child->d_lock, DENTRY_D_LOCK_NESTED);
 
2066
+               seq_spin_lock_nested(&child->d_lock, DENTRY_D_LOCK_NESTED);
 
2067
                if (simple_positive(child)) {
 
2068
-                       spin_unlock(&child->d_lock);
 
2069
+                       seq_spin_unlock(&child->d_lock);
 
2070
                        goto out;
 
2071
                }
 
2072
-               spin_unlock(&child->d_lock);
 
2073
+               seq_spin_unlock(&child->d_lock);
 
2074
        }
 
2075
        ret = 1;
 
2076
 out:
 
2077
-       spin_unlock(&dentry->d_lock);
 
2078
+       seq_spin_unlock(&dentry->d_lock);
 
2079
        return ret;
 
2080
 }
 
2081
 
 
2082
Index: linux-3.2/fs/namei.c
 
2083
===================================================================
 
2084
--- linux-3.2.orig/fs/namei.c
 
2085
+++ linux-3.2/fs/namei.c
 
2086
@@ -433,7 +433,7 @@ static int unlazy_walk(struct nameidata 
 
2087
                                nd->root.dentry != fs->root.dentry)
 
2088
                        goto err_root;
 
2089
        }
 
2090
-       spin_lock(&parent->d_lock);
 
2091
+       seq_spin_lock(&parent->d_lock);
 
2092
        if (!dentry) {
 
2093
                if (!__d_rcu_to_refcount(parent, nd->seq))
 
2094
                        goto err_parent;
 
2095
@@ -441,7 +441,7 @@ static int unlazy_walk(struct nameidata 
 
2096
        } else {
 
2097
                if (dentry->d_parent != parent)
 
2098
                        goto err_parent;
 
2099
-               spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
 
2100
+               seq_spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
 
2101
                if (!__d_rcu_to_refcount(dentry, nd->seq))
 
2102
                        goto err_child;
 
2103
                /*
 
2104
@@ -453,9 +453,9 @@ static int unlazy_walk(struct nameidata 
 
2105
                BUG_ON(!IS_ROOT(dentry) && dentry->d_parent != parent);
 
2106
                BUG_ON(!parent->d_count);
 
2107
                parent->d_count++;
 
2108
-               spin_unlock(&dentry->d_lock);
 
2109
+               seq_spin_unlock(&dentry->d_lock);
 
2110
        }
 
2111
-       spin_unlock(&parent->d_lock);
 
2112
+       seq_spin_unlock(&parent->d_lock);
 
2113
        if (want_root) {
 
2114
                path_get(&nd->root);
 
2115
                seq_spin_unlock(&fs->lock);
 
2116
@@ -468,9 +468,9 @@ static int unlazy_walk(struct nameidata 
 
2117
        return 0;
 
2118
 
 
2119
 err_child:
 
2120
-       spin_unlock(&dentry->d_lock);
 
2121
+       seq_spin_unlock(&dentry->d_lock);
 
2122
 err_parent:
 
2123
-       spin_unlock(&parent->d_lock);
 
2124
+       seq_spin_unlock(&parent->d_lock);
 
2125
 err_root:
 
2126
        if (want_root)
 
2127
                seq_spin_unlock(&fs->lock);
 
2128
@@ -517,15 +517,15 @@ static int complete_walk(struct nameidat
 
2129
                nd->flags &= ~LOOKUP_RCU;
 
2130
                if (!(nd->flags & LOOKUP_ROOT))
 
2131
                        nd->root.mnt = NULL;
 
2132
-               spin_lock(&dentry->d_lock);
 
2133
+               seq_spin_lock(&dentry->d_lock);
 
2134
                if (unlikely(!__d_rcu_to_refcount(dentry, nd->seq))) {
 
2135
-                       spin_unlock(&dentry->d_lock);
 
2136
+                       seq_spin_unlock(&dentry->d_lock);
 
2137
                        rcu_read_unlock();
 
2138
                        br_read_unlock(vfsmount_lock);
 
2139
                        return -ECHILD;
 
2140
                }
 
2141
                BUG_ON(nd->inode != dentry->d_inode);
 
2142
-               spin_unlock(&dentry->d_lock);
 
2143
+               seq_spin_unlock(&dentry->d_lock);
 
2144
                mntget(nd->path.mnt);
 
2145
                rcu_read_unlock();
 
2146
                br_read_unlock(vfsmount_lock);
 
2147
@@ -569,7 +569,7 @@ static __always_inline void set_root_rcu
 
2148
                do {
 
2149
                        seq = read_seqbegin(&fs->lock);
 
2150
                        nd->root = fs->root;
 
2151
-                       nd->seq = __read_seqcount_begin(&nd->root.dentry->d_seq);
 
2152
+                       nd->seq = __read_seqbegin(&nd->root.dentry->d_lock);
 
2153
                } while (read_seqretry(&fs->lock, seq));
 
2154
        }
 
2155
 }
 
2156
@@ -901,7 +901,7 @@ static bool __follow_mount_rcu(struct na
 
2157
                path->mnt = mounted;
 
2158
                path->dentry = mounted->mnt_root;
 
2159
                nd->flags |= LOOKUP_JUMPED;
 
2160
-               nd->seq = read_seqcount_begin(&path->dentry->d_seq);
 
2161
+               nd->seq = read_seqbegin(&path->dentry->d_lock);
 
2162
                /*
 
2163
                 * Update the inode too. We don't need to re-check the
 
2164
                 * dentry sequence number here after this d_inode read,
 
2165
@@ -921,7 +921,7 @@ static void follow_mount_rcu(struct name
 
2166
                        break;
 
2167
                nd->path.mnt = mounted;
 
2168
                nd->path.dentry = mounted->mnt_root;
 
2169
-               nd->seq = read_seqcount_begin(&nd->path.dentry->d_seq);
 
2170
+               nd->seq = read_seqbegin(&nd->path.dentry->d_lock);
 
2171
        }
 
2172
 }
 
2173
 
 
2174
@@ -939,8 +939,8 @@ static int follow_dotdot_rcu(struct name
 
2175
                        struct dentry *parent = old->d_parent;
 
2176
                        unsigned seq;
 
2177
 
 
2178
-                       seq = read_seqcount_begin(&parent->d_seq);
 
2179
-                       if (read_seqcount_retry(&old->d_seq, nd->seq))
 
2180
+                       seq = read_seqbegin(&parent->d_lock);
 
2181
+                       if (read_seqretry(&old->d_lock, nd->seq))
 
2182
                                goto failed;
 
2183
                        nd->path.dentry = parent;
 
2184
                        nd->seq = seq;
 
2185
@@ -948,7 +948,7 @@ static int follow_dotdot_rcu(struct name
 
2186
                }
 
2187
                if (!follow_up_rcu(&nd->path))
 
2188
                        break;
 
2189
-               nd->seq = read_seqcount_begin(&nd->path.dentry->d_seq);
 
2190
+               nd->seq = read_seqbegin(&nd->path.dentry->d_lock);
 
2191
        }
 
2192
        follow_mount_rcu(nd);
 
2193
        nd->inode = nd->path.dentry->d_inode;
 
2194
@@ -1134,7 +1134,7 @@ static int do_lookup(struct nameidata *n
 
2195
                        goto unlazy;
 
2196
 
 
2197
                /* Memory barrier in read_seqcount_begin of child is enough */
 
2198
-               if (__read_seqcount_retry(&parent->d_seq, nd->seq))
 
2199
+               if (__read_seqretry(&parent->d_lock, nd->seq))
 
2200
                        return -ECHILD;
 
2201
                nd->seq = seq;
 
2202
 
 
2203
@@ -1491,7 +1491,7 @@ static int path_init(int dfd, const char
 
2204
                if (flags & LOOKUP_RCU) {
 
2205
                        br_read_lock(vfsmount_lock);
 
2206
                        rcu_read_lock();
 
2207
-                       nd->seq = __read_seqcount_begin(&nd->path.dentry->d_seq);
 
2208
+                       nd->seq = __read_seqbegin(&nd->path.dentry->d_lock);
 
2209
                } else {
 
2210
                        path_get(&nd->path);
 
2211
                }
 
2212
@@ -1521,7 +1521,7 @@ static int path_init(int dfd, const char
 
2213
                        do {
 
2214
                                seq = read_seqbegin(&fs->lock);
 
2215
                                nd->path = fs->pwd;
 
2216
-                               nd->seq = __read_seqcount_begin(&nd->path.dentry->d_seq);
 
2217
+                               nd->seq = __read_seqbegin(&nd->path.dentry->d_lock);
 
2218
                        } while (read_seqretry(&fs->lock, seq));
 
2219
                } else {
 
2220
                        get_fs_pwd(current->fs, &nd->path);
 
2221
@@ -1550,7 +1550,7 @@ static int path_init(int dfd, const char
 
2222
                if (flags & LOOKUP_RCU) {
 
2223
                        if (fput_needed)
 
2224
                                *fp = file;
 
2225
-                       nd->seq = __read_seqcount_begin(&nd->path.dentry->d_seq);
 
2226
+                       nd->seq = __read_seqbegin(&nd->path.dentry->d_lock);
 
2227
                        br_read_lock(vfsmount_lock);
 
2228
                        rcu_read_lock();
 
2229
                } else {
 
2230
@@ -2615,10 +2615,10 @@ SYSCALL_DEFINE2(mkdir, const char __user
 
2231
 void dentry_unhash(struct dentry *dentry)
 
2232
 {
 
2233
        shrink_dcache_parent(dentry);
 
2234
-       spin_lock(&dentry->d_lock);
 
2235
+       seq_spin_lock(&dentry->d_lock);
 
2236
        if (dentry->d_count == 1)
 
2237
                __d_drop(dentry);
 
2238
-       spin_unlock(&dentry->d_lock);
 
2239
+       seq_spin_unlock(&dentry->d_lock);
 
2240
 }
 
2241
 
 
2242
 int vfs_rmdir(struct inode *dir, struct dentry *dentry)
 
2243
Index: linux-3.2/fs/namespace.c
 
2244
===================================================================
 
2245
--- linux-3.2.orig/fs/namespace.c
 
2246
+++ linux-3.2/fs/namespace.c
 
2247
@@ -560,9 +560,9 @@ static void dentry_reset_mounted(struct 
 
2248
                                return;
 
2249
                }
 
2250
        }
 
2251
-       spin_lock(&dentry->d_lock);
 
2252
+       seq_spin_lock(&dentry->d_lock);
 
2253
        dentry->d_flags &= ~DCACHE_MOUNTED;
 
2254
-       spin_unlock(&dentry->d_lock);
 
2255
+       seq_spin_unlock(&dentry->d_lock);
 
2256
 }
 
2257
 
 
2258
 /*
 
2259
@@ -587,9 +587,9 @@ void mnt_set_mountpoint(struct vfsmount 
 
2260
 {
 
2261
        child_mnt->mnt_parent = mntget(mnt);
 
2262
        child_mnt->mnt_mountpoint = dget(dentry);
 
2263
-       spin_lock(&dentry->d_lock);
 
2264
+       seq_spin_lock(&dentry->d_lock);
 
2265
        dentry->d_flags |= DCACHE_MOUNTED;
 
2266
-       spin_unlock(&dentry->d_lock);
 
2267
+       seq_spin_unlock(&dentry->d_lock);
 
2268
 }
 
2269
 
 
2270
 /*
 
2271
Index: linux-3.2/fs/ncpfs/dir.c
 
2272
===================================================================
 
2273
--- linux-3.2.orig/fs/ncpfs/dir.c
 
2274
+++ linux-3.2/fs/ncpfs/dir.c
 
2275
@@ -388,7 +388,7 @@ ncp_dget_fpos(struct dentry *dentry, str
 
2276
        }
 
2277
 
 
2278
        /* If a pointer is invalid, we search the dentry. */
 
2279
-       spin_lock(&parent->d_lock);
 
2280
+       seq_spin_lock(&parent->d_lock);
 
2281
        next = parent->d_subdirs.next;
 
2282
        while (next != &parent->d_subdirs) {
 
2283
                dent = list_entry(next, struct dentry, d_u.d_child);
 
2284
@@ -397,12 +397,12 @@ ncp_dget_fpos(struct dentry *dentry, str
 
2285
                                dget(dent);
 
2286
                        else
 
2287
                                dent = NULL;
 
2288
-                       spin_unlock(&parent->d_lock);
 
2289
+                       seq_spin_unlock(&parent->d_lock);
 
2290
                        goto out;
 
2291
                }
 
2292
                next = next->next;
 
2293
        }
 
2294
-       spin_unlock(&parent->d_lock);
 
2295
+       seq_spin_unlock(&parent->d_lock);
 
2296
        return NULL;
 
2297
 
 
2298
 out:
 
2299
Index: linux-3.2/fs/ncpfs/ncplib_kernel.h
 
2300
===================================================================
 
2301
--- linux-3.2.orig/fs/ncpfs/ncplib_kernel.h
 
2302
+++ linux-3.2/fs/ncpfs/ncplib_kernel.h
 
2303
@@ -191,7 +191,7 @@ ncp_renew_dentries(struct dentry *parent
 
2304
        struct list_head *next;
 
2305
        struct dentry *dentry;
 
2306
 
 
2307
-       spin_lock(&parent->d_lock);
 
2308
+       seq_spin_lock(&parent->d_lock);
 
2309
        next = parent->d_subdirs.next;
 
2310
        while (next != &parent->d_subdirs) {
 
2311
                dentry = list_entry(next, struct dentry, d_u.d_child);
 
2312
@@ -203,7 +203,7 @@ ncp_renew_dentries(struct dentry *parent
 
2313
 
 
2314
                next = next->next;
 
2315
        }
 
2316
-       spin_unlock(&parent->d_lock);
 
2317
+       seq_spin_unlock(&parent->d_lock);
 
2318
 }
 
2319
 
 
2320
 static inline void
 
2321
@@ -213,7 +213,7 @@ ncp_invalidate_dircache_entries(struct d
 
2322
        struct list_head *next;
 
2323
        struct dentry *dentry;
 
2324
 
 
2325
-       spin_lock(&parent->d_lock);
 
2326
+       seq_spin_lock(&parent->d_lock);
 
2327
        next = parent->d_subdirs.next;
 
2328
        while (next != &parent->d_subdirs) {
 
2329
                dentry = list_entry(next, struct dentry, d_u.d_child);
 
2330
@@ -221,7 +221,7 @@ ncp_invalidate_dircache_entries(struct d
 
2331
                ncp_age_dentry(server, dentry);
 
2332
                next = next->next;
 
2333
        }
 
2334
-       spin_unlock(&parent->d_lock);
 
2335
+       seq_spin_unlock(&parent->d_lock);
 
2336
 }
 
2337
 
 
2338
 struct ncp_cache_head {
 
2339
Index: linux-3.2/fs/nfs/dir.c
 
2340
===================================================================
 
2341
--- linux-3.2.orig/fs/nfs/dir.c
 
2342
+++ linux-3.2/fs/nfs/dir.c
 
2343
@@ -1823,9 +1823,9 @@ static int nfs_unlink(struct inode *dir,
 
2344
        dfprintk(VFS, "NFS: unlink(%s/%ld, %s)\n", dir->i_sb->s_id,
 
2345
                dir->i_ino, dentry->d_name.name);
 
2346
 
 
2347
-       spin_lock(&dentry->d_lock);
 
2348
+       seq_spin_lock(&dentry->d_lock);
 
2349
        if (dentry->d_count > 1) {
 
2350
-               spin_unlock(&dentry->d_lock);
 
2351
+               seq_spin_unlock(&dentry->d_lock);
 
2352
                /* Start asynchronous writeout of the inode */
 
2353
                write_inode_now(dentry->d_inode, 0);
 
2354
                error = nfs_sillyrename(dir, dentry);
 
2355
@@ -1835,7 +1835,7 @@ static int nfs_unlink(struct inode *dir,
 
2356
                __d_drop(dentry);
 
2357
                need_rehash = 1;
 
2358
        }
 
2359
-       spin_unlock(&dentry->d_lock);
 
2360
+       seq_spin_unlock(&dentry->d_lock);
 
2361
        error = nfs_safe_remove(dentry);
 
2362
        if (!error || error == -ENOENT) {
 
2363
                nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
 
2364
Index: linux-3.2/fs/nfs/getroot.c
 
2365
===================================================================
 
2366
--- linux-3.2.orig/fs/nfs/getroot.c
 
2367
+++ linux-3.2/fs/nfs/getroot.c
 
2368
@@ -64,9 +64,9 @@ static int nfs_superblock_set_dummy_root
 
2369
                 * Oops, since the test for IS_ROOT() will fail.
 
2370
                 */
 
2371
                spin_lock(&sb->s_root->d_inode->i_lock);
 
2372
-               spin_lock(&sb->s_root->d_lock);
 
2373
+               seq_spin_lock(&sb->s_root->d_lock);
 
2374
                list_del_init(&sb->s_root->d_alias);
 
2375
-               spin_unlock(&sb->s_root->d_lock);
 
2376
+               seq_spin_unlock(&sb->s_root->d_lock);
 
2377
                spin_unlock(&sb->s_root->d_inode->i_lock);
 
2378
        }
 
2379
        return 0;
 
2380
@@ -126,12 +126,12 @@ struct dentry *nfs_get_root(struct super
 
2381
        }
 
2382
 
 
2383
        security_d_instantiate(ret, inode);
 
2384
-       spin_lock(&ret->d_lock);
 
2385
+       seq_spin_lock(&ret->d_lock);
 
2386
        if (IS_ROOT(ret) && !(ret->d_flags & DCACHE_NFSFS_RENAMED)) {
 
2387
                ret->d_fsdata = name;
 
2388
                name = NULL;
 
2389
        }
 
2390
-       spin_unlock(&ret->d_lock);
 
2391
+       seq_spin_unlock(&ret->d_lock);
 
2392
 out:
 
2393
        if (name)
 
2394
                kfree(name);
 
2395
@@ -250,12 +250,12 @@ struct dentry *nfs4_get_root(struct supe
 
2396
        }
 
2397
 
 
2398
        security_d_instantiate(ret, inode);
 
2399
-       spin_lock(&ret->d_lock);
 
2400
+       seq_spin_lock(&ret->d_lock);
 
2401
        if (IS_ROOT(ret) && !(ret->d_flags & DCACHE_NFSFS_RENAMED)) {
 
2402
                ret->d_fsdata = name;
 
2403
                name = NULL;
 
2404
        }
 
2405
-       spin_unlock(&ret->d_lock);
 
2406
+       seq_spin_unlock(&ret->d_lock);
 
2407
 out:
 
2408
        if (name)
 
2409
                kfree(name);
 
2410
Index: linux-3.2/fs/nfs/namespace.c
 
2411
===================================================================
 
2412
--- linux-3.2.orig/fs/nfs/namespace.c
 
2413
+++ linux-3.2/fs/nfs/namespace.c
 
2414
@@ -60,7 +60,7 @@ rename_retry:
 
2415
        seq = read_seqbegin(&rename_lock);
 
2416
        rcu_read_lock();
 
2417
        while (1) {
 
2418
-               spin_lock(&dentry->d_lock);
 
2419
+               seq_spin_lock(&dentry->d_lock);
 
2420
                if (IS_ROOT(dentry))
 
2421
                        break;
 
2422
                namelen = dentry->d_name.len;
 
2423
@@ -70,17 +70,17 @@ rename_retry:
 
2424
                end -= namelen;
 
2425
                memcpy(end, dentry->d_name.name, namelen);
 
2426
                *--end = '/';
 
2427
-               spin_unlock(&dentry->d_lock);
 
2428
+               seq_spin_unlock(&dentry->d_lock);
 
2429
                dentry = dentry->d_parent;
 
2430
        }
 
2431
        if (read_seqretry(&rename_lock, seq)) {
 
2432
-               spin_unlock(&dentry->d_lock);
 
2433
+               seq_spin_unlock(&dentry->d_lock);
 
2434
                rcu_read_unlock();
 
2435
                goto rename_retry;
 
2436
        }
 
2437
        if (*end != '/') {
 
2438
                if (--buflen < 0) {
 
2439
-                       spin_unlock(&dentry->d_lock);
 
2440
+                       seq_spin_unlock(&dentry->d_lock);
 
2441
                        rcu_read_unlock();
 
2442
                        goto Elong;
 
2443
                }
 
2444
@@ -89,7 +89,7 @@ rename_retry:
 
2445
        *p = end;
 
2446
        base = dentry->d_fsdata;
 
2447
        if (!base) {
 
2448
-               spin_unlock(&dentry->d_lock);
 
2449
+               seq_spin_unlock(&dentry->d_lock);
 
2450
                rcu_read_unlock();
 
2451
                WARN_ON(1);
 
2452
                return end;
 
2453
@@ -100,17 +100,17 @@ rename_retry:
 
2454
                namelen--;
 
2455
        buflen -= namelen;
 
2456
        if (buflen < 0) {
 
2457
-               spin_unlock(&dentry->d_lock);
 
2458
+               seq_spin_unlock(&dentry->d_lock);
 
2459
                rcu_read_unlock();
 
2460
                goto Elong;
 
2461
        }
 
2462
        end -= namelen;
 
2463
        memcpy(end, base, namelen);
 
2464
-       spin_unlock(&dentry->d_lock);
 
2465
+       seq_spin_unlock(&dentry->d_lock);
 
2466
        rcu_read_unlock();
 
2467
        return end;
 
2468
 Elong_unlock:
 
2469
-       spin_unlock(&dentry->d_lock);
 
2470
+       seq_spin_unlock(&dentry->d_lock);
 
2471
        rcu_read_unlock();
 
2472
        if (read_seqretry(&rename_lock, seq))
 
2473
                goto rename_retry;
 
2474
Index: linux-3.2/fs/nfs/unlink.c
 
2475
===================================================================
 
2476
--- linux-3.2.orig/fs/nfs/unlink.c
 
2477
+++ linux-3.2/fs/nfs/unlink.c
 
2478
@@ -156,7 +156,7 @@ static int nfs_do_call_unlink(struct den
 
2479
                 */
 
2480
                nfs_free_dname(data);
 
2481
                ret = nfs_copy_dname(alias, data);
 
2482
-               spin_lock(&alias->d_lock);
 
2483
+               seq_spin_lock(&alias->d_lock);
 
2484
                if (ret == 0 && alias->d_inode != NULL &&
 
2485
                    !(alias->d_flags & DCACHE_NFSFS_RENAMED)) {
 
2486
                        devname_garbage = alias->d_fsdata;
 
2487
@@ -165,7 +165,7 @@ static int nfs_do_call_unlink(struct den
 
2488
                        ret = 1;
 
2489
                } else
 
2490
                        ret = 0;
 
2491
-               spin_unlock(&alias->d_lock);
 
2492
+               seq_spin_unlock(&alias->d_lock);
 
2493
                nfs_dec_sillycount(dir);
 
2494
                dput(alias);
 
2495
                /*
 
2496
@@ -274,13 +274,13 @@ nfs_async_unlink(struct inode *dir, stru
 
2497
        data->res.dir_attr = &data->dir_attr;
 
2498
 
 
2499
        status = -EBUSY;
 
2500
-       spin_lock(&dentry->d_lock);
 
2501
+       seq_spin_lock(&dentry->d_lock);
 
2502
        if (dentry->d_flags & DCACHE_NFSFS_RENAMED)
 
2503
                goto out_unlock;
 
2504
        dentry->d_flags |= DCACHE_NFSFS_RENAMED;
 
2505
        devname_garbage = dentry->d_fsdata;
 
2506
        dentry->d_fsdata = data;
 
2507
-       spin_unlock(&dentry->d_lock);
 
2508
+       seq_spin_unlock(&dentry->d_lock);
 
2509
        /*
 
2510
         * If we'd displaced old cached devname, free it.  At that
 
2511
         * point dentry is definitely not a root, so we won't need
 
2512
@@ -290,7 +290,7 @@ nfs_async_unlink(struct inode *dir, stru
 
2513
                kfree(devname_garbage);
 
2514
        return 0;
 
2515
 out_unlock:
 
2516
-       spin_unlock(&dentry->d_lock);
 
2517
+       seq_spin_unlock(&dentry->d_lock);
 
2518
        put_rpccred(data->cred);
 
2519
 out_free:
 
2520
        kfree(data);
 
2521
@@ -312,13 +312,13 @@ nfs_complete_unlink(struct dentry *dentr
 
2522
 {
 
2523
        struct nfs_unlinkdata   *data = NULL;
 
2524
 
 
2525
-       spin_lock(&dentry->d_lock);
 
2526
+       seq_spin_lock(&dentry->d_lock);
 
2527
        if (dentry->d_flags & DCACHE_NFSFS_RENAMED) {
 
2528
                dentry->d_flags &= ~DCACHE_NFSFS_RENAMED;
 
2529
                data = dentry->d_fsdata;
 
2530
                dentry->d_fsdata = NULL;
 
2531
        }
 
2532
-       spin_unlock(&dentry->d_lock);
 
2533
+       seq_spin_unlock(&dentry->d_lock);
 
2534
 
 
2535
        if (data != NULL && (NFS_STALE(inode) || !nfs_call_unlink(dentry, data)))
 
2536
                nfs_free_unlinkdata(data);
 
2537
@@ -328,17 +328,17 @@ nfs_complete_unlink(struct dentry *dentr
 
2538
 static void
 
2539
 nfs_cancel_async_unlink(struct dentry *dentry)
 
2540
 {
 
2541
-       spin_lock(&dentry->d_lock);
 
2542
+       seq_spin_lock(&dentry->d_lock);
 
2543
        if (dentry->d_flags & DCACHE_NFSFS_RENAMED) {
 
2544
                struct nfs_unlinkdata *data = dentry->d_fsdata;
 
2545
 
 
2546
                dentry->d_flags &= ~DCACHE_NFSFS_RENAMED;
 
2547
                dentry->d_fsdata = NULL;
 
2548
-               spin_unlock(&dentry->d_lock);
 
2549
+               seq_spin_unlock(&dentry->d_lock);
 
2550
                nfs_free_unlinkdata(data);
 
2551
                return;
 
2552
        }
 
2553
-       spin_unlock(&dentry->d_lock);
 
2554
+       seq_spin_unlock(&dentry->d_lock);
 
2555
 }
 
2556
 
 
2557
 struct nfs_renamedata {
 
2558
Index: linux-3.2/fs/nilfs2/namei.c
 
2559
===================================================================
 
2560
--- linux-3.2.orig/fs/nilfs2/namei.c
 
2561
+++ linux-3.2/fs/nilfs2/namei.c
 
2562
@@ -538,11 +538,11 @@ static int nilfs_encode_fh(struct dentry
 
2563
        if (connectable && !S_ISDIR(inode->i_mode)) {
 
2564
                struct inode *parent;
 
2565
 
 
2566
-               spin_lock(&dentry->d_lock);
 
2567
+               seq_spin_lock(&dentry->d_lock);
 
2568
                parent = dentry->d_parent->d_inode;
 
2569
                fid->parent_ino = parent->i_ino;
 
2570
                fid->parent_gen = parent->i_generation;
 
2571
-               spin_unlock(&dentry->d_lock);
 
2572
+               seq_spin_unlock(&dentry->d_lock);
 
2573
 
 
2574
                type = FILEID_NILFS_WITH_PARENT;
 
2575
                *lenp = NILFS_FID_SIZE_CONNECTABLE;
 
2576
Index: linux-3.2/fs/notify/fsnotify.c
 
2577
===================================================================
 
2578
--- linux-3.2.orig/fs/notify/fsnotify.c
 
2579
+++ linux-3.2/fs/notify/fsnotify.c
 
2580
@@ -68,19 +68,19 @@ void __fsnotify_update_child_dentry_flag
 
2581
                /* run all of the children of the original inode and fix their
 
2582
                 * d_flags to indicate parental interest (their parent is the
 
2583
                 * original inode) */
 
2584
-               spin_lock(&alias->d_lock);
 
2585
+               seq_spin_lock(&alias->d_lock);
 
2586
                list_for_each_entry(child, &alias->d_subdirs, d_u.d_child) {
 
2587
                        if (!child->d_inode)
 
2588
                                continue;
 
2589
 
 
2590
-                       spin_lock_nested(&child->d_lock, DENTRY_D_LOCK_NESTED);
 
2591
+                       seq_spin_lock_nested(&child->d_lock, DENTRY_D_LOCK_NESTED);
 
2592
                        if (watched)
 
2593
                                child->d_flags |= DCACHE_FSNOTIFY_PARENT_WATCHED;
 
2594
                        else
 
2595
                                child->d_flags &= ~DCACHE_FSNOTIFY_PARENT_WATCHED;
 
2596
-                       spin_unlock(&child->d_lock);
 
2597
+                       seq_spin_unlock(&child->d_lock);
 
2598
                }
 
2599
-               spin_unlock(&alias->d_lock);
 
2600
+               seq_spin_unlock(&alias->d_lock);
 
2601
        }
 
2602
        spin_unlock(&inode->i_lock);
 
2603
 }
 
2604
Index: linux-3.2/fs/notify/vfsmount_mark.c
 
2605
===================================================================
 
2606
--- linux-3.2.orig/fs/notify/vfsmount_mark.c
 
2607
+++ linux-3.2/fs/notify/vfsmount_mark.c
 
2608
@@ -35,13 +35,13 @@ void fsnotify_clear_marks_by_mount(struc
 
2609
        struct hlist_node *pos, *n;
 
2610
        LIST_HEAD(free_list);
 
2611
 
 
2612
-       spin_lock(&mnt->mnt_root->d_lock);
 
2613
+       seq_spin_lock(&mnt->mnt_root->d_lock);
 
2614
        hlist_for_each_entry_safe(mark, pos, n, &mnt->mnt_fsnotify_marks, m.m_list) {
 
2615
                list_add(&mark->m.free_m_list, &free_list);
 
2616
                hlist_del_init_rcu(&mark->m.m_list);
 
2617
                fsnotify_get_mark(mark);
 
2618
        }
 
2619
-       spin_unlock(&mnt->mnt_root->d_lock);
 
2620
+       seq_spin_unlock(&mnt->mnt_root->d_lock);
 
2621
 
 
2622
        list_for_each_entry_safe(mark, lmark, &free_list, m.free_m_list) {
 
2623
                fsnotify_destroy_mark(mark);
 
2624
@@ -63,7 +63,7 @@ static void fsnotify_recalc_vfsmount_mas
 
2625
        struct hlist_node *pos;
 
2626
        __u32 new_mask = 0;
 
2627
 
 
2628
-       assert_spin_locked(&mnt->mnt_root->d_lock);
 
2629
+       assert_seq_spin_locked(&mnt->mnt_root->d_lock);
 
2630
 
 
2631
        hlist_for_each_entry(mark, pos, &mnt->mnt_fsnotify_marks, m.m_list)
 
2632
                new_mask |= mark->mask;
 
2633
@@ -76,9 +76,9 @@ static void fsnotify_recalc_vfsmount_mas
 
2634
  */
 
2635
 void fsnotify_recalc_vfsmount_mask(struct vfsmount *mnt)
 
2636
 {
 
2637
-       spin_lock(&mnt->mnt_root->d_lock);
 
2638
+       seq_spin_lock(&mnt->mnt_root->d_lock);
 
2639
        fsnotify_recalc_vfsmount_mask_locked(mnt);
 
2640
-       spin_unlock(&mnt->mnt_root->d_lock);
 
2641
+       seq_spin_unlock(&mnt->mnt_root->d_lock);
 
2642
 }
 
2643
 
 
2644
 void fsnotify_destroy_vfsmount_mark(struct fsnotify_mark *mark)
 
2645
@@ -88,14 +88,14 @@ void fsnotify_destroy_vfsmount_mark(stru
 
2646
        assert_spin_locked(&mark->lock);
 
2647
        assert_spin_locked(&mark->group->mark_lock);
 
2648
 
 
2649
-       spin_lock(&mnt->mnt_root->d_lock);
 
2650
+       seq_spin_lock(&mnt->mnt_root->d_lock);
 
2651
 
 
2652
        hlist_del_init_rcu(&mark->m.m_list);
 
2653
        mark->m.mnt = NULL;
 
2654
 
 
2655
        fsnotify_recalc_vfsmount_mask_locked(mnt);
 
2656
 
 
2657
-       spin_unlock(&mnt->mnt_root->d_lock);
 
2658
+       seq_spin_unlock(&mnt->mnt_root->d_lock);
 
2659
 }
 
2660
 
 
2661
 static struct fsnotify_mark *fsnotify_find_vfsmount_mark_locked(struct fsnotify_group *group,
 
2662
@@ -104,7 +104,7 @@ static struct fsnotify_mark *fsnotify_fi
 
2663
        struct fsnotify_mark *mark;
 
2664
        struct hlist_node *pos;
 
2665
 
 
2666
-       assert_spin_locked(&mnt->mnt_root->d_lock);
 
2667
+       assert_seq_spin_locked(&mnt->mnt_root->d_lock);
 
2668
 
 
2669
        hlist_for_each_entry(mark, pos, &mnt->mnt_fsnotify_marks, m.m_list) {
 
2670
                if (mark->group == group) {
 
2671
@@ -124,9 +124,9 @@ struct fsnotify_mark *fsnotify_find_vfsm
 
2672
 {
 
2673
        struct fsnotify_mark *mark;
 
2674
 
 
2675
-       spin_lock(&mnt->mnt_root->d_lock);
 
2676
+       seq_spin_lock(&mnt->mnt_root->d_lock);
 
2677
        mark = fsnotify_find_vfsmount_mark_locked(group, mnt);
 
2678
-       spin_unlock(&mnt->mnt_root->d_lock);
 
2679
+       seq_spin_unlock(&mnt->mnt_root->d_lock);
 
2680
 
 
2681
        return mark;
 
2682
 }
 
2683
@@ -149,7 +149,7 @@ int fsnotify_add_vfsmount_mark(struct fs
 
2684
        assert_spin_locked(&mark->lock);
 
2685
        assert_spin_locked(&group->mark_lock);
 
2686
 
 
2687
-       spin_lock(&mnt->mnt_root->d_lock);
 
2688
+       seq_spin_lock(&mnt->mnt_root->d_lock);
 
2689
 
 
2690
        mark->m.mnt = mnt;
 
2691
 
 
2692
@@ -184,7 +184,7 @@ int fsnotify_add_vfsmount_mark(struct fs
 
2693
        hlist_add_after_rcu(last, &mark->m.m_list);
 
2694
 out:
 
2695
        fsnotify_recalc_vfsmount_mask_locked(mnt);
 
2696
-       spin_unlock(&mnt->mnt_root->d_lock);
 
2697
+       seq_spin_unlock(&mnt->mnt_root->d_lock);
 
2698
 
 
2699
        return ret;
 
2700
 }
 
2701
Index: linux-3.2/fs/ocfs2/dcache.c
 
2702
===================================================================
 
2703
--- linux-3.2.orig/fs/ocfs2/dcache.c
 
2704
+++ linux-3.2/fs/ocfs2/dcache.c
 
2705
@@ -177,16 +177,16 @@ struct dentry *ocfs2_find_local_alias(st
 
2706
        list_for_each(p, &inode->i_dentry) {
 
2707
                dentry = list_entry(p, struct dentry, d_alias);
 
2708
 
 
2709
-               spin_lock(&dentry->d_lock);
 
2710
+               seq_spin_lock(&dentry->d_lock);
 
2711
                if (ocfs2_match_dentry(dentry, parent_blkno, skip_unhashed)) {
 
2712
                        trace_ocfs2_find_local_alias(dentry->d_name.len,
 
2713
                                                     dentry->d_name.name);
 
2714
 
 
2715
                        dget_dlock(dentry);
 
2716
-                       spin_unlock(&dentry->d_lock);
 
2717
+                       seq_spin_unlock(&dentry->d_lock);
 
2718
                        break;
 
2719
                }
 
2720
-               spin_unlock(&dentry->d_lock);
 
2721
+               seq_spin_unlock(&dentry->d_lock);
 
2722
 
 
2723
                dentry = NULL;
 
2724
        }
 
2725
Index: linux-3.2/fs/ocfs2/export.c
 
2726
===================================================================
 
2727
--- linux-3.2.orig/fs/ocfs2/export.c
 
2728
+++ linux-3.2/fs/ocfs2/export.c
 
2729
@@ -214,7 +214,7 @@ static int ocfs2_encode_fh(struct dentry
 
2730
        if (connectable && !S_ISDIR(inode->i_mode)) {
 
2731
                struct inode *parent;
 
2732
 
 
2733
-               spin_lock(&dentry->d_lock);
 
2734
+               seq_spin_lock(&dentry->d_lock);
 
2735
 
 
2736
                parent = dentry->d_parent->d_inode;
 
2737
                blkno = OCFS2_I(parent)->ip_blkno;
 
2738
@@ -224,7 +224,7 @@ static int ocfs2_encode_fh(struct dentry
 
2739
                fh[4] = cpu_to_le32((u32)(blkno & 0xffffffff));
 
2740
                fh[5] = cpu_to_le32(generation);
 
2741
 
 
2742
-               spin_unlock(&dentry->d_lock);
 
2743
+               seq_spin_unlock(&dentry->d_lock);
 
2744
 
 
2745
                len = 6;
 
2746
                type = 2;
 
2747
Index: linux-3.2/fs/reiserfs/inode.c
 
2748
===================================================================
 
2749
--- linux-3.2.orig/fs/reiserfs/inode.c
 
2750
+++ linux-3.2/fs/reiserfs/inode.c
 
2751
@@ -1614,7 +1614,7 @@ int reiserfs_encode_fh(struct dentry *de
 
2752
        if (maxlen < 5 || !need_parent)
 
2753
                return 3;
 
2754
 
 
2755
-       spin_lock(&dentry->d_lock);
 
2756
+       seq_spin_lock(&dentry->d_lock);
 
2757
        inode = dentry->d_parent->d_inode;
 
2758
        data[3] = inode->i_ino;
 
2759
        data[4] = le32_to_cpu(INODE_PKEY(inode)->k_dir_id);
 
2760
@@ -1623,7 +1623,7 @@ int reiserfs_encode_fh(struct dentry *de
 
2761
                data[5] = inode->i_generation;
 
2762
                *lenp = 6;
 
2763
        }
 
2764
-       spin_unlock(&dentry->d_lock);
 
2765
+       seq_spin_unlock(&dentry->d_lock);
 
2766
        return *lenp;
 
2767
 }
 
2768
 
 
2769
Index: linux-3.2/fs/udf/namei.c
 
2770
===================================================================
 
2771
--- linux-3.2.orig/fs/udf/namei.c
 
2772
+++ linux-3.2/fs/udf/namei.c
 
2773
@@ -1296,13 +1296,13 @@ static int udf_encode_fh(struct dentry *
 
2774
        fid->udf.generation = inode->i_generation;
 
2775
 
 
2776
        if (connectable && !S_ISDIR(inode->i_mode)) {
 
2777
-               spin_lock(&de->d_lock);
 
2778
+               seq_spin_lock(&de->d_lock);
 
2779
                inode = de->d_parent->d_inode;
 
2780
                location = UDF_I(inode)->i_location;
 
2781
                fid->udf.parent_block = location.logicalBlockNum;
 
2782
                fid->udf.parent_partref = location.partitionReferenceNum;
 
2783
                fid->udf.parent_generation = inode->i_generation;
 
2784
-               spin_unlock(&de->d_lock);
 
2785
+               seq_spin_unlock(&de->d_lock);
 
2786
                *lenp = 5;
 
2787
                type = FILEID_UDF_WITH_PARENT;
 
2788
        }
 
2789
Index: linux-3.2/fs/xfs/xfs_export.c
 
2790
===================================================================
 
2791
--- linux-3.2.orig/fs/xfs/xfs_export.c
 
2792
+++ linux-3.2/fs/xfs/xfs_export.c
 
2793
@@ -97,20 +97,20 @@ xfs_fs_encode_fh(
 
2794
 
 
2795
        switch (fileid_type) {
 
2796
        case FILEID_INO32_GEN_PARENT:
 
2797
-               spin_lock(&dentry->d_lock);
 
2798
+               seq_spin_lock(&dentry->d_lock);
 
2799
                fid->i32.parent_ino = XFS_I(dentry->d_parent->d_inode)->i_ino;
 
2800
                fid->i32.parent_gen = dentry->d_parent->d_inode->i_generation;
 
2801
-               spin_unlock(&dentry->d_lock);
 
2802
+               seq_spin_unlock(&dentry->d_lock);
 
2803
                /*FALLTHRU*/
 
2804
        case FILEID_INO32_GEN:
 
2805
                fid->i32.ino = XFS_I(inode)->i_ino;
 
2806
                fid->i32.gen = inode->i_generation;
 
2807
                break;
 
2808
        case FILEID_INO32_GEN_PARENT | XFS_FILEID_TYPE_64FLAG:
 
2809
-               spin_lock(&dentry->d_lock);
 
2810
+               seq_spin_lock(&dentry->d_lock);
 
2811
                fid64->parent_ino = XFS_I(dentry->d_parent->d_inode)->i_ino;
 
2812
                fid64->parent_gen = dentry->d_parent->d_inode->i_generation;
 
2813
-               spin_unlock(&dentry->d_lock);
 
2814
+               seq_spin_unlock(&dentry->d_lock);
 
2815
                /*FALLTHRU*/
 
2816
        case FILEID_INO32_GEN | XFS_FILEID_TYPE_64FLAG:
 
2817
                fid64->ino = XFS_I(inode)->i_ino;
 
2818
Index: linux-3.2/include/linux/dcache.h
 
2819
===================================================================
 
2820
--- linux-3.2.orig/include/linux/dcache.h
 
2821
+++ linux-3.2/include/linux/dcache.h
 
2822
@@ -116,7 +116,7 @@ full_name_hash(const unsigned char *name
 
2823
 struct dentry {
 
2824
        /* RCU lookup touched fields */
 
2825
        unsigned int d_flags;           /* protected by d_lock */
 
2826
-       seqcount_t d_seq;               /* per dentry seqlock */
 
2827
+       seqlock_t d_lock;               /* per dentry seqlock */
 
2828
        struct hlist_bl_node d_hash;    /* lookup hash list */
 
2829
        struct dentry *d_parent;        /* parent directory */
 
2830
        struct qstr d_name;
 
2831
@@ -126,7 +126,6 @@ struct dentry {
 
2832
 
 
2833
        /* Ref lookup also touches following */
 
2834
        unsigned int d_count;           /* protected by d_lock */
 
2835
-       spinlock_t d_lock;              /* per dentry lock */
 
2836
        const struct dentry_operations *d_op;
 
2837
        struct super_block *d_sb;       /* The root of the dentry tree */
 
2838
        unsigned long d_time;           /* used by d_revalidate */
 
2839
@@ -323,8 +322,8 @@ static inline int __d_rcu_to_refcount(st
 
2840
 {
 
2841
        int ret = 0;
 
2842
 
 
2843
-       assert_spin_locked(&dentry->d_lock);
 
2844
-       if (!read_seqcount_retry(&dentry->d_seq, seq)) {
 
2845
+       assert_seq_spin_locked(&dentry->d_lock);
 
2846
+       if (!read_seqretry(&dentry->d_lock, seq)) {
 
2847
                ret = 1;
 
2848
                dentry->d_count++;
 
2849
        }
 
2850
@@ -367,9 +366,9 @@ static inline struct dentry *dget_dlock(
 
2851
 static inline struct dentry *dget(struct dentry *dentry)
 
2852
 {
 
2853
        if (dentry) {
 
2854
-               spin_lock(&dentry->d_lock);
 
2855
+               seq_spin_lock(&dentry->d_lock);
 
2856
                dget_dlock(dentry);
 
2857
-               spin_unlock(&dentry->d_lock);
 
2858
+               seq_spin_unlock(&dentry->d_lock);
 
2859
        }
 
2860
        return dentry;
 
2861
 }
 
2862
@@ -400,9 +399,9 @@ static inline int cant_mount(struct dent
 
2863
 
 
2864
 static inline void dont_mount(struct dentry *dentry)
 
2865
 {
 
2866
-       spin_lock(&dentry->d_lock);
 
2867
+       seq_spin_lock(&dentry->d_lock);
 
2868
        dentry->d_flags |= DCACHE_CANT_MOUNT;
 
2869
-       spin_unlock(&dentry->d_lock);
 
2870
+       seq_spin_unlock(&dentry->d_lock);
 
2871
 }
 
2872
 
 
2873
 extern void dput(struct dentry *);
 
2874
Index: linux-3.2/include/linux/fs.h
 
2875
===================================================================
 
2876
--- linux-3.2.orig/include/linux/fs.h
 
2877
+++ linux-3.2/include/linux/fs.h
 
2878
@@ -2603,9 +2603,9 @@ static inline ino_t parent_ino(struct de
 
2879
         * Don't strictly need d_lock here? If the parent ino could change
 
2880
         * then surely we'd have a deeper race in the caller?
 
2881
         */
 
2882
-       spin_lock(&dentry->d_lock);
 
2883
+       seq_spin_lock(&dentry->d_lock);
 
2884
        res = dentry->d_parent->d_inode->i_ino;
 
2885
-       spin_unlock(&dentry->d_lock);
 
2886
+       seq_spin_unlock(&dentry->d_lock);
 
2887
        return res;
 
2888
 }
 
2889
 
 
2890
Index: linux-3.2/include/linux/fsnotify_backend.h
 
2891
===================================================================
 
2892
--- linux-3.2.orig/include/linux/fsnotify_backend.h
 
2893
+++ linux-3.2/include/linux/fsnotify_backend.h
 
2894
@@ -329,7 +329,7 @@ static inline void __fsnotify_update_dca
 
2895
 {
 
2896
        struct dentry *parent;
 
2897
 
 
2898
-       assert_spin_locked(&dentry->d_lock);
 
2899
+       assert_seq_spin_locked(&dentry->d_lock);
 
2900
 
 
2901
        /*
 
2902
         * Serialisation of setting PARENT_WATCHED on the dentries is provided
 
2903
@@ -353,9 +353,9 @@ static inline void __fsnotify_d_instanti
 
2904
        if (!inode)
 
2905
                return;
 
2906
 
 
2907
-       spin_lock(&dentry->d_lock);
 
2908
+       seq_spin_lock(&dentry->d_lock);
 
2909
        __fsnotify_update_dcache_flags(dentry);
 
2910
-       spin_unlock(&dentry->d_lock);
 
2911
+       seq_spin_unlock(&dentry->d_lock);
 
2912
 }
 
2913
 
 
2914
 /* called from fsnotify listeners, such as fanotify or dnotify */
 
2915
Index: linux-3.2/kernel/cgroup.c
 
2916
===================================================================
 
2917
--- linux-3.2.orig/kernel/cgroup.c
 
2918
+++ linux-3.2/kernel/cgroup.c
 
2919
@@ -870,29 +870,29 @@ static void cgroup_clear_directory(struc
 
2920
        struct list_head *node;
 
2921
 
 
2922
        BUG_ON(!mutex_is_locked(&dentry->d_inode->i_mutex));
 
2923
-       spin_lock(&dentry->d_lock);
 
2924
+       seq_spin_lock(&dentry->d_lock);
 
2925
        node = dentry->d_subdirs.next;
 
2926
        while (node != &dentry->d_subdirs) {
 
2927
                struct dentry *d = list_entry(node, struct dentry, d_u.d_child);
 
2928
 
 
2929
-               spin_lock_nested(&d->d_lock, DENTRY_D_LOCK_NESTED);
 
2930
+               seq_spin_lock_nested(&d->d_lock, DENTRY_D_LOCK_NESTED);
 
2931
                list_del_init(node);
 
2932
                if (d->d_inode) {
 
2933
                        /* This should never be called on a cgroup
 
2934
                         * directory with child cgroups */
 
2935
                        BUG_ON(d->d_inode->i_mode & S_IFDIR);
 
2936
                        dget_dlock(d);
 
2937
-                       spin_unlock(&d->d_lock);
 
2938
-                       spin_unlock(&dentry->d_lock);
 
2939
+                       seq_spin_unlock(&d->d_lock);
 
2940
+                       seq_spin_unlock(&dentry->d_lock);
 
2941
                        d_delete(d);
 
2942
                        simple_unlink(dentry->d_inode, d);
 
2943
                        dput(d);
 
2944
-                       spin_lock(&dentry->d_lock);
 
2945
+                       seq_spin_lock(&dentry->d_lock);
 
2946
                } else
 
2947
-                       spin_unlock(&d->d_lock);
 
2948
+                       seq_spin_unlock(&d->d_lock);
 
2949
                node = dentry->d_subdirs.next;
 
2950
        }
 
2951
-       spin_unlock(&dentry->d_lock);
 
2952
+       seq_spin_unlock(&dentry->d_lock);
 
2953
 }
 
2954
 
 
2955
 /*
 
2956
@@ -905,11 +905,11 @@ static void cgroup_d_remove_dir(struct d
 
2957
        cgroup_clear_directory(dentry);
 
2958
 
 
2959
        parent = dentry->d_parent;
 
2960
-       spin_lock(&parent->d_lock);
 
2961
-       spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
 
2962
+       seq_spin_lock(&parent->d_lock);
 
2963
+       seq_spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
 
2964
        list_del_init(&dentry->d_u.d_child);
 
2965
-       spin_unlock(&dentry->d_lock);
 
2966
-       spin_unlock(&parent->d_lock);
 
2967
+       seq_spin_unlock(&dentry->d_lock);
 
2968
+       seq_spin_unlock(&parent->d_lock);
 
2969
        remove_dir(dentry);
 
2970
 }
 
2971
 
 
2972
Index: linux-3.2/net/sunrpc/rpc_pipe.c
 
2973
===================================================================
 
2974
--- linux-3.2.orig/net/sunrpc/rpc_pipe.c
 
2975
+++ linux-3.2/net/sunrpc/rpc_pipe.c
 
2976
@@ -397,14 +397,14 @@ rpc_info_open(struct inode *inode, struc
 
2977
        if (!ret) {
 
2978
                struct seq_file *m = file->private_data;
 
2979
 
 
2980
-               spin_lock(&file->f_path.dentry->d_lock);
 
2981
+               seq_spin_lock(&file->f_path.dentry->d_lock);
 
2982
                if (!d_unhashed(file->f_path.dentry))
 
2983
                        clnt = RPC_I(inode)->private;
 
2984
                if (clnt != NULL && atomic_inc_not_zero(&clnt->cl_count)) {
 
2985
-                       spin_unlock(&file->f_path.dentry->d_lock);
 
2986
+                       seq_spin_unlock(&file->f_path.dentry->d_lock);
 
2987
                        m->private = clnt;
 
2988
                } else {
 
2989
-                       spin_unlock(&file->f_path.dentry->d_lock);
 
2990
+                       seq_spin_unlock(&file->f_path.dentry->d_lock);
 
2991
                        single_release(inode, file);
 
2992
                        ret = -EINVAL;
 
2993
                }
 
2994
Index: linux-3.2/security/selinux/selinuxfs.c
 
2995
===================================================================
 
2996
--- linux-3.2.orig/security/selinux/selinuxfs.c
 
2997
+++ linux-3.2/security/selinux/selinuxfs.c
 
2998
@@ -1194,28 +1194,28 @@ static void sel_remove_entries(struct de
 
2999
 {
 
3000
        struct list_head *node;
 
3001
 
 
3002
-       spin_lock(&de->d_lock);
 
3003
+       seq_spin_lock(&de->d_lock);
 
3004
        node = de->d_subdirs.next;
 
3005
        while (node != &de->d_subdirs) {
 
3006
                struct dentry *d = list_entry(node, struct dentry, d_u.d_child);
 
3007
 
 
3008
-               spin_lock_nested(&d->d_lock, DENTRY_D_LOCK_NESTED);
 
3009
+               seq_spin_lock_nested(&d->d_lock, DENTRY_D_LOCK_NESTED);
 
3010
                list_del_init(node);
 
3011
 
 
3012
                if (d->d_inode) {
 
3013
                        dget_dlock(d);
 
3014
-                       spin_unlock(&de->d_lock);
 
3015
-                       spin_unlock(&d->d_lock);
 
3016
+                       seq_spin_unlock(&de->d_lock);
 
3017
+                       seq_spin_unlock(&d->d_lock);
 
3018
                        d_delete(d);
 
3019
                        simple_unlink(de->d_inode, d);
 
3020
                        dput(d);
 
3021
-                       spin_lock(&de->d_lock);
 
3022
+                       seq_spin_lock(&de->d_lock);
 
3023
                } else
 
3024
-                       spin_unlock(&d->d_lock);
 
3025
+                       seq_spin_unlock(&d->d_lock);
 
3026
                node = de->d_subdirs.next;
 
3027
        }
 
3028
 
 
3029
-       spin_unlock(&de->d_lock);
 
3030
+       seq_spin_unlock(&de->d_lock);
 
3031
 }
 
3032
 
 
3033
 #define BOOL_DIR_NAME "booleans"