1
Subject: fs: dentry use seqlock
2
From: Thomas Gleixner <tglx@linutronix.de>
3
Date: Mon, 27 Feb 2012 18:08:46 +0100
5
Replace the open coded seqlock with a real seqlock, so RT can handle
8
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
9
Cc: stable-rt@vger.kernel.org
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 -
18
fs/autofs4/autofs_i.h | 24 +-
19
fs/autofs4/expire.c | 44 ++---
20
fs/autofs4/root.c | 38 ++--
25
fs/ceph/dir.c | 30 +--
27
fs/ceph/inode.c | 20 +-
28
fs/ceph/mds_client.c | 18 +-
31
fs/configfs/configfs_internal.h | 4
32
fs/configfs/inode.c | 6
33
fs/dcache.c | 253 ++++++++++++++----------------
35
fs/exportfs/expfs.c | 12 -
37
fs/fat/namei_vfat.c | 4
46
fs/ncpfs/ncplib_kernel.h | 8
48
fs/nfs/getroot.c | 12 -
49
fs/nfs/namespace.c | 16 -
50
fs/nfs/unlink.c | 20 +-
52
fs/notify/fsnotify.c | 8
53
fs/notify/vfsmount_mark.c | 24 +-
56
fs/reiserfs/inode.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(-)
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
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) {
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
88
- spin_unlock(&dentry->d_lock);
89
+ seq_spin_unlock(&dentry->d_lock);
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
101
- spin_lock(&tmp->d_lock);
102
+ seq_spin_lock(&tmp->d_lock);
103
if (!(d_unhashed(tmp) && tmp->d_inode)) {
106
- spin_unlock(&tmp->d_lock);
107
+ seq_spin_unlock(&tmp->d_lock);
108
simple_unlink(parent->d_inode, tmp);
110
- spin_unlock(&tmp->d_lock);
111
+ seq_spin_unlock(&tmp->d_lock);
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
123
- spin_lock(&tmp->d_lock);
124
+ seq_spin_lock(&tmp->d_lock);
125
if (!(d_unhashed(tmp) && tmp->d_inode)) {
128
- spin_unlock(&tmp->d_lock);
129
+ seq_spin_unlock(&tmp->d_lock);
130
simple_unlink(parent->d_inode, tmp);
132
- spin_unlock(&tmp->d_lock);
133
+ seq_spin_unlock(&tmp->d_lock);
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
143
struct list_head *list;
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);
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);
159
- spin_unlock(&de->d_lock);
160
+ seq_spin_unlock(&de->d_lock);
162
- spin_unlock(&dentry->d_lock);
163
+ seq_spin_unlock(&dentry->d_lock);
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
175
- spin_lock(&filp->f_dentry->d_lock);
176
+ seq_spin_lock(&filp->f_dentry->d_lock);
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;
184
- spin_unlock(&filp->f_dentry->d_lock);
185
+ seq_spin_unlock(&filp->f_dentry->d_lock);
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:
195
/* the dirent, if it exists, now points to a different vnode */
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);
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_
211
static inline void managed_dentry_set_automount(struct dentry *dentry)
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);
220
static inline void __managed_dentry_clear_automount(struct dentry *dentry)
221
@@ -209,9 +209,9 @@ static inline void __managed_dentry_clea
223
static inline void managed_dentry_clear_automount(struct dentry *dentry)
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);
232
static inline void __managed_dentry_set_transit(struct dentry *dentry)
233
@@ -221,9 +221,9 @@ static inline void __managed_dentry_set_
235
static inline void managed_dentry_set_transit(struct dentry *dentry)
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);
244
static inline void __managed_dentry_clear_transit(struct dentry *dentry)
245
@@ -233,9 +233,9 @@ static inline void __managed_dentry_clea
247
static inline void managed_dentry_clear_transit(struct dentry *dentry)
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);
256
static inline void __managed_dentry_set_managed(struct dentry *dentry)
257
@@ -245,9 +245,9 @@ static inline void __managed_dentry_set_
259
static inline void managed_dentry_set_managed(struct dentry *dentry)
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);
268
static inline void __managed_dentry_clear_managed(struct dentry *dentry)
269
@@ -257,9 +257,9 @@ static inline void __managed_dentry_clea
271
static inline void managed_dentry_clear_managed(struct dentry *dentry)
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);
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);
289
- spin_lock(&root->d_lock);
290
+ seq_spin_lock(&root->d_lock);
291
prev = dget_dlock(root);
292
next = prev->d_subdirs.next;
294
@@ -107,12 +107,12 @@ static struct dentry *get_next_positive_
298
- spin_lock(&p->d_lock);
299
+ seq_spin_lock(&p->d_lock);
301
next = p->d_u.d_child.next;
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);
309
@@ -120,16 +120,16 @@ start:
311
q = list_entry(next, struct dentry, d_u.d_child);
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);
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);
330
@@ -153,7 +153,7 @@ static struct dentry *get_next_positive_
331
spin_lock(&sbi->lookup_lock);
334
- spin_lock(&p->d_lock);
335
+ seq_spin_lock(&p->d_lock);
337
next = p->d_subdirs.next;
338
if (next == &p->d_subdirs) {
339
@@ -161,19 +161,19 @@ again:
340
struct dentry *parent;
343
- spin_unlock(&p->d_lock);
344
+ seq_spin_unlock(&p->d_lock);
345
spin_unlock(&sbi->lookup_lock);
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);
358
- spin_unlock(&p->d_lock);
359
+ seq_spin_unlock(&p->d_lock);
360
next = p->d_u.d_child.next;
362
if (next != &parent->d_subdirs)
363
@@ -182,16 +182,16 @@ again:
365
ret = list_entry(next, struct dentry, d_u.d_child);
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);
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);
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);
400
@@ -556,7 +556,7 @@ int autofs4_do_expire_multi(struct super
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);
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);
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);
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
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);
434
- spin_unlock(&dentry->d_lock);
435
+ seq_spin_unlock(&dentry->d_lock);
436
spin_unlock(&sbi->lookup_lock);
439
@@ -179,7 +179,7 @@ static struct dentry *autofs4_lookup_act
440
ino = list_entry(p, struct autofs_info, active);
441
active = ino->dentry;
443
- spin_lock(&active->d_lock);
444
+ seq_spin_lock(&active->d_lock);
447
if (active->d_count == 0)
448
@@ -199,12 +199,12 @@ static struct dentry *autofs4_lookup_act
450
if (d_unhashed(active)) {
452
- spin_unlock(&active->d_lock);
453
+ seq_spin_unlock(&active->d_lock);
454
spin_unlock(&sbi->lookup_lock);
458
- spin_unlock(&active->d_lock);
459
+ seq_spin_unlock(&active->d_lock);
461
spin_unlock(&sbi->lookup_lock);
463
@@ -231,7 +231,7 @@ static struct dentry *autofs4_lookup_exp
464
ino = list_entry(p, struct autofs_info, expiring);
465
expiring = ino->dentry;
467
- spin_lock(&expiring->d_lock);
468
+ seq_spin_lock(&expiring->d_lock);
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
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);
482
- spin_unlock(&expiring->d_lock);
483
+ seq_spin_unlock(&expiring->d_lock);
485
spin_unlock(&sbi->lookup_lock);
487
@@ -382,12 +382,12 @@ static struct vfsmount *autofs4_d_automo
488
if (have_submounts(dentry))
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);
498
- spin_unlock(&dentry->d_lock);
499
+ seq_spin_unlock(&dentry->d_lock);
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
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);
516
spin_unlock(&sbi->fs_lock);
518
@@ -597,9 +597,9 @@ static int autofs4_dir_unlink(struct ino
520
spin_lock(&sbi->lookup_lock);
521
__autofs4_add_expiring(dentry);
522
- spin_lock(&dentry->d_lock);
523
+ seq_spin_lock(&dentry->d_lock);
525
- spin_unlock(&dentry->d_lock);
526
+ seq_spin_unlock(&dentry->d_lock);
527
spin_unlock(&sbi->lookup_lock);
530
@@ -670,15 +670,15 @@ static int autofs4_dir_rmdir(struct inod
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);
542
__autofs4_add_expiring(dentry);
544
- spin_unlock(&dentry->d_lock);
545
+ seq_spin_unlock(&dentry->d_lock);
546
spin_unlock(&sbi->lookup_lock);
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;
557
- spin_lock(&dentry->d_lock);
558
+ seq_spin_lock(&dentry->d_lock);
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;
565
- spin_unlock(&dentry->d_lock);
566
+ seq_spin_unlock(&dentry->d_lock);
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
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);
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
594
- spin_lock(&dentry->d_lock);
595
+ seq_spin_lock(&dentry->d_lock);
596
if (di->lease_session && di->lease_session->s_mds == mds)
598
- spin_unlock(&dentry->d_lock);
599
+ seq_spin_unlock(&dentry->d_lock);
601
ret = ceph_encode_inode_release(p, dir, mds, drop, unless, force);
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);
612
- spin_unlock(&dentry->d_lock);
613
+ seq_spin_unlock(&dentry->d_lock);
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,
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,
631
- spin_unlock(&req->r_dentry->d_lock);
632
+ seq_spin_unlock(&req->r_dentry->d_lock);
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,
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,
647
- spin_unlock(&req->r_old_dentry->d_lock);
648
+ seq_spin_unlock(&req->r_old_dentry->d_lock);
650
} else if (req->r_path2) {
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
658
return -ENOMEM; /* oh well */
660
- spin_lock(&dentry->d_lock);
661
+ seq_spin_lock(&dentry->d_lock);
662
if (dentry->d_fsdata) {
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);
669
- spin_unlock(&dentry->d_lock);
670
+ seq_spin_unlock(&dentry->d_lock);
674
@@ -78,12 +78,12 @@ struct inode *ceph_get_dentry_parent_ino
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;
684
- spin_unlock(&dentry->d_lock);
685
+ seq_spin_unlock(&dentry->d_lock);
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,
693
- spin_lock(&parent->d_lock);
694
+ seq_spin_lock(&parent->d_lock);
696
/* start at beginning? */
697
if (filp->f_pos == 2 || last == NULL ||
698
@@ -154,7 +154,7 @@ more:
699
fi->flags |= CEPH_F_ATEND;
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);
714
dentry = list_entry(p, struct dentry, d_u.d_child);
715
di = ceph_dentry(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);
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:
730
- spin_lock(&parent->d_lock);
731
+ seq_spin_lock(&parent->d_lock);
732
p = p->prev; /* advance to next dentry */
736
- spin_unlock(&parent->d_lock);
737
+ seq_spin_unlock(&parent->d_lock);
741
@@ -950,10 +950,10 @@ static int ceph_rename(struct inode *old
743
void ceph_invalidate_dentry_lease(struct dentry *dentry)
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);
754
@@ -971,7 +971,7 @@ static int dentry_lease_is_valid(struct
755
struct inode *dir = NULL;
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
767
- spin_unlock(&dentry->d_lock);
768
+ seq_spin_unlock(&dentry->d_lock);
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)
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);
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)
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);
801
@@ -837,7 +837,7 @@ static void update_dentry_lease(struct d
802
di->lease_renew_from = 0;
803
dentry->d_time = ttl;
805
- spin_unlock(&dentry->d_lock);
806
+ seq_spin_unlock(&dentry->d_lock);
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);
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);
828
@@ -1254,11 +1254,11 @@ retry_lookup:
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);
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; ) {
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",
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);
864
pos -= temp->d_name.len;
866
- spin_unlock(&temp->d_lock);
867
+ seq_spin_unlock(&temp->d_lock);
870
strncpy(path + pos, temp->d_name.name,
873
- spin_unlock(&temp->d_lock);
874
+ seq_spin_unlock(&temp->d_lock);
877
temp = temp->d_parent;
878
@@ -2768,7 +2768,7 @@ static void handle_lease(struct ceph_mds
882
- spin_lock(&dentry->d_lock);
883
+ seq_spin_lock(&dentry->d_lock);
884
di = ceph_dentry(dentry);
886
case CEPH_MDS_LEASE_REVOKE:
887
@@ -2796,7 +2796,7 @@ static void handle_lease(struct ceph_mds
891
- spin_unlock(&dentry->d_lock);
892
+ seq_spin_unlock(&dentry->d_lock);
896
@@ -2869,7 +2869,7 @@ void ceph_mdsc_lease_release(struct ceph
897
BUG_ON(dentry == NULL);
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 -- "
909
- spin_unlock(&dentry->d_lock);
910
+ seq_spin_unlock(&dentry->d_lock);
914
@@ -2886,7 +2886,7 @@ void ceph_mdsc_lease_release(struct ceph
915
session = ceph_get_mds_session(di->lease_session);
917
__ceph_mdsc_drop_dentry_lease(dentry);
918
- spin_unlock(&dentry->d_lock);
919
+ seq_spin_unlock(&dentry->d_lock);
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 */
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;
935
- spin_unlock(&temp->d_lock);
936
+ seq_spin_unlock(&temp->d_lock);
939
full_path[namelen] = dirsep;
940
@@ -94,7 +94,7 @@ cifs_bp_rename_retry:
942
cFYI(0, "name: %s", full_path + namelen);
944
- spin_unlock(&temp->d_lock);
945
+ seq_spin_unlock(&temp->d_lock);
946
temp = temp->d_parent;
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;
957
- spin_lock(&parent->d_lock);
958
+ seq_spin_lock(&parent->d_lock);
959
list_for_each(child, &parent->d_subdirs)
961
de = list_entry(child, struct dentry, d_u.d_child);
962
@@ -101,7 +101,7 @@ static void coda_flag_children(struct de
964
coda_flag_inode(de->d_inode, flag);
966
- spin_unlock(&parent->d_lock);
967
+ seq_spin_unlock(&parent->d_lock);
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
977
struct config_item * item = NULL;
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
986
item = config_item_get(sd->s_element);
988
- spin_unlock(&dentry->d_lock);
989
+ seq_spin_unlock(&dentry->d_lock);
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;
1001
- spin_lock(&dentry->d_lock);
1002
+ seq_spin_lock(&dentry->d_lock);
1003
if (!(d_unhashed(dentry) && dentry->d_inode)) {
1006
- spin_unlock(&dentry->d_lock);
1007
+ seq_spin_unlock(&dentry->d_lock);
1008
simple_unlink(parent->d_inode, dentry);
1010
- spin_unlock(&dentry->d_lock);
1011
+ seq_spin_unlock(&dentry->d_lock);
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
1021
static inline void dentry_rcuwalk_barrier(struct dentry *dentry)
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);
1031
@@ -190,7 +190,7 @@ static void dentry_iput(struct dentry *
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 *
1044
- spin_unlock(&dentry->d_lock);
1045
+ seq_spin_unlock(&dentry->d_lock);
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
1060
dentry->d_flags |= DCACHE_DISCONNECTED;
1062
- spin_unlock(&parent->d_lock);
1063
+ seq_spin_unlock(&parent->d_lock);
1064
dentry_iput(dentry);
1066
* dentry_iput drops the locks, at which point nobody (except
1067
@@ -370,9 +370,9 @@ EXPORT_SYMBOL(__d_drop);
1069
void d_drop(struct dentry *dentry)
1071
- spin_lock(&dentry->d_lock);
1072
+ seq_spin_lock(&dentry->d_lock);
1074
- spin_unlock(&dentry->d_lock);
1075
+ seq_spin_unlock(&dentry->d_lock);
1077
EXPORT_SYMBOL(d_drop);
1079
@@ -387,10 +387,10 @@ EXPORT_SYMBOL(d_drop);
1081
void d_clear_need_lookup(struct dentry *dentry)
1083
- spin_lock(&dentry->d_lock);
1084
+ seq_spin_lock(&dentry->d_lock);
1086
dentry->d_flags &= ~DCACHE_NEED_LOOKUP;
1087
- spin_unlock(&dentry->d_lock);
1088
+ seq_spin_unlock(&dentry->d_lock);
1090
EXPORT_SYMBOL(d_clear_need_lookup);
1092
@@ -409,7 +409,7 @@ static inline struct dentry *dentry_kill
1093
inode = dentry->d_inode;
1094
if (inode && !spin_trylock(&inode->i_lock)) {
1096
- spin_unlock(&dentry->d_lock);
1097
+ seq_spin_unlock(&dentry->d_lock);
1099
return dentry; /* try again with same dentry */
1101
@@ -417,7 +417,7 @@ relock:
1104
parent = dentry->d_parent;
1105
- if (parent && !spin_trylock(&parent->d_lock)) {
1106
+ if (parent && !seq_spin_trylock(&parent->d_lock)) {
1108
spin_unlock(&inode->i_lock);
1110
@@ -470,11 +470,11 @@ void dput(struct dentry *dentry)
1112
if (dentry->d_count == 1)
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) {
1119
- spin_unlock(&dentry->d_lock);
1120
+ seq_spin_unlock(&dentry->d_lock);
1124
@@ -497,7 +497,7 @@ repeat:
1125
dentry_lru_add(dentry);
1128
- spin_unlock(&dentry->d_lock);
1129
+ seq_spin_unlock(&dentry->d_lock);
1133
@@ -524,9 +524,9 @@ int d_invalidate(struct dentry * dentry)
1135
* If it's already been dropped, return OK.
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);
1145
@@ -534,9 +534,9 @@ int d_invalidate(struct dentry * dentry)
1146
* to get rid of unused child entries.
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);
1157
@@ -553,13 +553,13 @@ int d_invalidate(struct dentry * dentry)
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);
1168
- spin_unlock(&dentry->d_lock);
1169
+ seq_spin_unlock(&dentry->d_lock);
1172
EXPORT_SYMBOL(d_invalidate);
1173
@@ -572,9 +572,9 @@ static inline void __dget_dlock(struct d
1175
static inline void __dget(struct dentry *dentry)
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);
1184
struct dentry *dget_parent(struct dentry *dentry)
1185
@@ -588,16 +588,16 @@ repeat:
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);
1198
BUG_ON(!ret->d_count);
1200
- spin_unlock(&ret->d_lock);
1201
+ seq_spin_unlock(&ret->d_lock);
1204
EXPORT_SYMBOL(dget_parent);
1205
@@ -625,31 +625,31 @@ static struct dentry *__d_find_alias(str
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);
1222
- spin_unlock(&alias->d_lock);
1223
+ seq_spin_unlock(&alias->d_lock);
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);
1238
- spin_unlock(&alias->d_lock);
1239
+ seq_spin_unlock(&alias->d_lock);
1243
@@ -678,16 +678,16 @@ void d_prune_aliases(struct inode *inode
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);
1252
- spin_unlock(&dentry->d_lock);
1253
+ seq_spin_unlock(&dentry->d_lock);
1254
spin_unlock(&inode->i_lock);
1258
- spin_unlock(&dentry->d_lock);
1259
+ seq_spin_unlock(&dentry->d_lock);
1261
spin_unlock(&inode->i_lock);
1263
@@ -724,10 +724,10 @@ static void try_prune_one_dentry(struct
1264
/* Prune ancestors. */
1267
- spin_lock(&dentry->d_lock);
1268
+ seq_spin_lock(&dentry->d_lock);
1269
if (dentry->d_count > 1) {
1271
- spin_unlock(&dentry->d_lock);
1272
+ seq_spin_unlock(&dentry->d_lock);
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)
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);
1288
@@ -756,7 +756,7 @@ static void shrink_dentry_list(struct li
1290
if (dentry->d_count) {
1291
dentry_lru_del(dentry);
1292
- spin_unlock(&dentry->d_lock);
1293
+ seq_spin_unlock(&dentry->d_lock);
1297
@@ -794,7 +794,7 @@ relock:
1298
struct dentry, d_lru);
1299
BUG_ON(dentry->d_sb != sb);
1301
- if (!spin_trylock(&dentry->d_lock)) {
1302
+ if (!seq_spin_trylock(&dentry->d_lock)) {
1303
spin_unlock(&dcache_lru_lock);
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);
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);
1320
@@ -960,8 +960,8 @@ static struct dentry *try_to_ascend(stru
1321
struct dentry *new = old->d_parent;
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);
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);
1340
@@ -1004,7 +1004,7 @@ again:
1342
if (d_mountpoint(parent))
1344
- spin_lock(&this_parent->d_lock);
1345
+ seq_spin_lock(&this_parent->d_lock);
1347
next = this_parent->d_subdirs.next;
1349
@@ -1013,21 +1013,21 @@ resume:
1350
struct dentry *dentry = list_entry(tmp, struct dentry, d_u.d_child);
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);
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_);
1373
- spin_unlock(&dentry->d_lock);
1374
+ seq_spin_unlock(&dentry->d_lock);
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;
1382
- spin_unlock(&this_parent->d_lock);
1383
+ seq_spin_unlock(&this_parent->d_lock);
1384
if (!locked && read_seqretry(&rename_lock, seq))
1387
@@ -1085,7 +1085,7 @@ static int select_parent(struct dentry *
1388
seq = read_seqbegin(&rename_lock);
1390
this_parent = parent;
1391
- spin_lock(&this_parent->d_lock);
1392
+ seq_spin_lock(&this_parent->d_lock);
1394
next = this_parent->d_subdirs.next;
1396
@@ -1094,7 +1094,7 @@ resume:
1397
struct dentry *dentry = list_entry(tmp, struct dentry, d_u.d_child);
1400
- spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
1401
+ seq_spin_lock_nested(&dentry->d_lock, DENTRY_D_LOCK_NESTED);
1404
* move only zero ref count dentries to the dispose list.
1405
@@ -1117,7 +1117,7 @@ resume:
1408
if (found && need_resched()) {
1409
- spin_unlock(&dentry->d_lock);
1410
+ seq_spin_unlock(&dentry->d_lock);
1414
@@ -1125,14 +1125,14 @@ resume:
1415
* Descend a level if the d_subdirs list is non-empty.
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_);
1428
- spin_unlock(&dentry->d_lock);
1429
+ seq_spin_unlock(&dentry->d_lock);
1432
* All done at this level ... ascend and resume the search.
1433
@@ -1146,7 +1146,7 @@ resume:
1437
- spin_unlock(&this_parent->d_lock);
1438
+ seq_spin_unlock(&this_parent->d_lock);
1439
if (!locked && read_seqretry(&rename_lock, seq))
1442
@@ -1214,8 +1214,7 @@ struct dentry *__d_alloc(struct super_bl
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;
1452
@@ -1248,7 +1247,7 @@ struct dentry *d_alloc(struct dentry * p
1456
- spin_lock(&parent->d_lock);
1457
+ seq_spin_lock(&parent->d_lock);
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);
1470
@@ -1308,7 +1307,7 @@ EXPORT_SYMBOL(d_set_d_op);
1472
static void __d_instantiate(struct dentry *dentry, struct inode *inode)
1474
- spin_lock(&dentry->d_lock);
1475
+ seq_spin_lock(&dentry->d_lock);
1477
if (unlikely(IS_AUTOMOUNT(inode)))
1478
dentry->d_flags |= DCACHE_NEED_AUTOMOUNT;
1479
@@ -1316,7 +1315,7 @@ static void __d_instantiate(struct dentr
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);
1488
@@ -1516,14 +1515,14 @@ struct dentry *d_obtain_alias(struct ino
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);
1505
@@ -1731,7 +1730,7 @@ struct dentry *__d_lookup_rcu(struct den
1509
- *seq = read_seqcount_begin(&dentry->d_seq);
1510
+ *seq = read_seqbegin(&dentry->d_lock);
1511
if (dentry->d_parent != parent)
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.
1518
- if (read_seqcount_retry(&dentry->d_seq, *seq))
1519
+ if (read_seqretry(&dentry->d_lock, *seq))
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)
1527
- spin_lock(&dentry->d_lock);
1528
+ seq_spin_lock(&dentry->d_lock);
1529
if (dentry->d_parent != parent)
1531
if (d_unhashed(dentry))
1532
@@ -1873,10 +1872,10 @@ struct dentry *__d_lookup(struct dentry
1536
- spin_unlock(&dentry->d_lock);
1537
+ seq_spin_unlock(&dentry->d_lock);
1540
- spin_unlock(&dentry->d_lock);
1541
+ seq_spin_unlock(&dentry->d_lock);
1545
@@ -1924,17 +1923,17 @@ int d_validate(struct dentry *dentry, st
1547
struct dentry *child;
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);
1563
- spin_unlock(&dparent->d_lock);
1564
+ seq_spin_unlock(&dparent->d_lock);
1568
@@ -1969,12 +1968,12 @@ void d_delete(struct dentry * dentry)
1569
* Are we the only user?
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);
1583
@@ -1987,7 +1986,7 @@ again:
1584
if (!d_unhashed(dentry))
1587
- spin_unlock(&dentry->d_lock);
1588
+ seq_spin_unlock(&dentry->d_lock);
1590
fsnotify_nameremove(dentry, isdir);
1592
@@ -2016,9 +2015,9 @@ static void _d_rehash(struct dentry * en
1594
void d_rehash(struct dentry * entry)
1596
- spin_lock(&entry->d_lock);
1597
+ seq_spin_lock(&entry->d_lock);
1599
- spin_unlock(&entry->d_lock);
1600
+ seq_spin_unlock(&entry->d_lock);
1602
EXPORT_SYMBOL(d_rehash);
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 */
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);
1616
EXPORT_SYMBOL(dentry_update_name_case);
1618
@@ -2096,24 +2093,24 @@ static void dentry_lock_for_move(struct
1619
* XXXX: do we really need to take target->d_lock?
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);
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);
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);
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);
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);
1654
@@ -2121,9 +2118,9 @@ static void dentry_unlock_parents_for_mo
1655
struct dentry *target)
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);
1666
@@ -2157,8 +2154,8 @@ static void __d_move(struct dentry * den
1668
dentry_lock_for_move(dentry, target);
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);
1675
/* __d_drop does write_seqcount_barrier, but they're OK to nest. */
1677
@@ -2193,13 +2190,13 @@ static void __d_move(struct dentry * den
1679
list_add(&dentry->d_u.d_child, &dentry->d_parent->d_subdirs);
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);
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);
1695
@@ -2288,8 +2285,8 @@ static void __d_materialise_dentry(struc
1697
dentry_lock_for_move(anon, dentry);
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);
1704
dparent = dentry->d_parent;
1705
aparent = anon->d_parent;
1706
@@ -2311,11 +2308,11 @@ static void __d_materialise_dentry(struc
1708
INIT_LIST_HEAD(&anon->d_u.d_child);
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);
1715
dentry_unlock_parents_for_move(anon, dentry);
1716
- spin_unlock(&dentry->d_lock);
1717
+ seq_spin_unlock(&dentry->d_lock);
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
1723
BUG_ON(!d_unhashed(actual));
1725
- spin_lock(&actual->d_lock);
1726
+ seq_spin_lock(&actual->d_lock);
1729
- spin_unlock(&actual->d_lock);
1730
+ seq_spin_unlock(&actual->d_lock);
1731
spin_unlock(&inode->i_lock);
1733
if (actual == dentry) {
1734
@@ -2455,9 +2452,9 @@ static int prepend_path(const struct pat
1736
parent = dentry->d_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);
1744
error = prepend(buffer, buflen, "/", 1);
1746
@@ -2682,9 +2679,9 @@ static char *__dentry_path(struct dentry
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)
1758
@@ -2874,7 +2871,7 @@ void d_genocide(struct dentry *root)
1759
seq = read_seqbegin(&rename_lock);
1762
- spin_lock(&this_parent->d_lock);
1763
+ seq_spin_lock(&this_parent->d_lock);
1765
next = this_parent->d_subdirs.next;
1767
@@ -2883,23 +2880,23 @@ resume:
1768
struct dentry *dentry = list_entry(tmp, struct dentry, d_u.d_child);
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);
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_);
1788
if (!(dentry->d_flags & DCACHE_GENOCIDE)) {
1789
dentry->d_flags |= DCACHE_GENOCIDE;
1792
- spin_unlock(&dentry->d_lock);
1793
+ seq_spin_unlock(&dentry->d_lock);
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;
1801
- spin_unlock(&this_parent->d_lock);
1802
+ seq_spin_unlock(&this_parent->d_lock);
1803
if (!locked && read_seqretry(&rename_lock, seq))
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
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);
1822
@@ -267,9 +267,9 @@ static void free_dcookie(struct dcookie_
1824
struct dentry *d = dcs->path.dentry;
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);
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
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);
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);
1858
@@ -335,11 +335,11 @@ static int export_encode_fh(struct dentr
1859
if (connectable && !S_ISDIR(inode->i_mode)) {
1860
struct inode *parent;
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);
1870
type = FILEID_INO32_GEN_PARENT;
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;
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);
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
1893
static int vfat_revalidate_shortname(struct dentry *dentry)
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)
1900
- spin_unlock(&dentry->d_lock);
1901
+ seq_spin_unlock(&dentry->d_lock);
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
1911
dentry = d_find_alias(inode);
1913
- spin_lock(&dentry->d_lock);
1914
+ seq_spin_lock(&dentry->d_lock);
1915
name = (const char *) dentry->d_name.name;
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);
1922
- spin_unlock(&dentry->d_lock);
1923
+ seq_spin_unlock(&dentry->d_lock);
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;
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);
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)
1953
- spin_lock(&dentry->d_lock);
1954
+ seq_spin_lock(&dentry->d_lock);
1955
inode = dentry->d_parent->d_inode;
1958
- spin_unlock(&dentry->d_lock);
1959
+ seq_spin_unlock(&dentry->d_lock);
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);
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;
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))
2003
- spin_unlock(&next->d_lock);
2004
+ seq_spin_unlock(&next->d_lock);
2007
list_add_tail(&cursor->d_u.d_child, p);
2008
- spin_unlock(&dentry->d_lock);
2009
+ seq_spin_unlock(&dentry->d_lock);
2012
mutex_unlock(&dentry->d_inode->i_mutex);
2013
@@ -159,35 +159,35 @@ int dcache_readdir(struct file * filp, v
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);
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);
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)
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 */
2048
- spin_unlock(&next->d_lock);
2049
+ seq_spin_unlock(&next->d_lock);
2053
- spin_unlock(&dentry->d_lock);
2054
+ seq_spin_unlock(&dentry->d_lock);
2058
@@ -281,18 +281,18 @@ int simple_empty(struct dentry *dentry)
2059
struct dentry *child;
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);
2072
- spin_unlock(&child->d_lock);
2073
+ seq_spin_unlock(&child->d_lock);
2077
- spin_unlock(&dentry->d_lock);
2078
+ seq_spin_unlock(&dentry->d_lock);
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)
2090
- spin_lock(&parent->d_lock);
2091
+ seq_spin_lock(&parent->d_lock);
2093
if (!__d_rcu_to_refcount(parent, nd->seq))
2095
@@ -441,7 +441,7 @@ static int unlazy_walk(struct nameidata
2097
if (dentry->d_parent != 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))
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);
2108
- spin_unlock(&dentry->d_lock);
2109
+ seq_spin_unlock(&dentry->d_lock);
2111
- spin_unlock(&parent->d_lock);
2112
+ seq_spin_unlock(&parent->d_lock);
2114
path_get(&nd->root);
2115
seq_spin_unlock(&fs->lock);
2116
@@ -468,9 +468,9 @@ static int unlazy_walk(struct nameidata
2120
- spin_unlock(&dentry->d_lock);
2121
+ seq_spin_unlock(&dentry->d_lock);
2123
- spin_unlock(&parent->d_lock);
2124
+ seq_spin_unlock(&parent->d_lock);
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);
2138
br_read_unlock(vfsmount_lock);
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);
2146
br_read_unlock(vfsmount_lock);
2147
@@ -569,7 +569,7 @@ static __always_inline void set_root_rcu
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));
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);
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
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);
2174
@@ -939,8 +939,8 @@ static int follow_dotdot_rcu(struct name
2175
struct dentry *parent = old->d_parent;
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))
2183
nd->path.dentry = parent;
2185
@@ -948,7 +948,7 @@ static int follow_dotdot_rcu(struct name
2187
if (!follow_up_rcu(&nd->path))
2189
- nd->seq = read_seqcount_begin(&nd->path.dentry->d_seq);
2190
+ nd->seq = read_seqbegin(&nd->path.dentry->d_lock);
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
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))
2203
@@ -1491,7 +1491,7 @@ static int path_init(int dfd, const char
2204
if (flags & LOOKUP_RCU) {
2205
br_read_lock(vfsmount_lock);
2207
- nd->seq = __read_seqcount_begin(&nd->path.dentry->d_seq);
2208
+ nd->seq = __read_seqbegin(&nd->path.dentry->d_lock);
2210
path_get(&nd->path);
2212
@@ -1521,7 +1521,7 @@ static int path_init(int dfd, const char
2214
seq = read_seqbegin(&fs->lock);
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));
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) {
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);
2230
@@ -2615,10 +2615,10 @@ SYSCALL_DEFINE2(mkdir, const char __user
2231
void dentry_unhash(struct dentry *dentry)
2233
shrink_dcache_parent(dentry);
2234
- spin_lock(&dentry->d_lock);
2235
+ seq_spin_lock(&dentry->d_lock);
2236
if (dentry->d_count == 1)
2238
- spin_unlock(&dentry->d_lock);
2239
+ seq_spin_unlock(&dentry->d_lock);
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
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);
2259
@@ -587,9 +587,9 @@ void mnt_set_mountpoint(struct vfsmount
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);
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
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
2288
- spin_unlock(&parent->d_lock);
2289
+ seq_spin_unlock(&parent->d_lock);
2294
- spin_unlock(&parent->d_lock);
2295
+ seq_spin_unlock(&parent->d_lock);
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;
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
2316
- spin_unlock(&parent->d_lock);
2317
+ seq_spin_unlock(&parent->d_lock);
2321
@@ -213,7 +213,7 @@ ncp_invalidate_dircache_entries(struct d
2322
struct list_head *next;
2323
struct dentry *dentry;
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);
2334
- spin_unlock(&parent->d_lock);
2335
+ seq_spin_unlock(&parent->d_lock);
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);
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,
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.
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);
2380
@@ -126,12 +126,12 @@ struct dentry *nfs_get_root(struct super
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;
2390
- spin_unlock(&ret->d_lock);
2391
+ seq_spin_unlock(&ret->d_lock);
2395
@@ -250,12 +250,12 @@ struct dentry *nfs4_get_root(struct supe
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;
2405
- spin_unlock(&ret->d_lock);
2406
+ seq_spin_unlock(&ret->d_lock);
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);
2418
- spin_lock(&dentry->d_lock);
2419
+ seq_spin_lock(&dentry->d_lock);
2420
if (IS_ROOT(dentry))
2422
namelen = dentry->d_name.len;
2423
@@ -70,17 +70,17 @@ rename_retry:
2425
memcpy(end, dentry->d_name.name, namelen);
2427
- spin_unlock(&dentry->d_lock);
2428
+ seq_spin_unlock(&dentry->d_lock);
2429
dentry = dentry->d_parent;
2431
if (read_seqretry(&rename_lock, seq)) {
2432
- spin_unlock(&dentry->d_lock);
2433
+ seq_spin_unlock(&dentry->d_lock);
2439
- spin_unlock(&dentry->d_lock);
2440
+ seq_spin_unlock(&dentry->d_lock);
2444
@@ -89,7 +89,7 @@ rename_retry:
2446
base = dentry->d_fsdata;
2448
- spin_unlock(&dentry->d_lock);
2449
+ seq_spin_unlock(&dentry->d_lock);
2453
@@ -100,17 +100,17 @@ rename_retry:
2457
- spin_unlock(&dentry->d_lock);
2458
+ seq_spin_unlock(&dentry->d_lock);
2463
memcpy(end, base, namelen);
2464
- spin_unlock(&dentry->d_lock);
2465
+ seq_spin_unlock(&dentry->d_lock);
2469
- spin_unlock(&dentry->d_lock);
2470
+ seq_spin_unlock(&dentry->d_lock);
2472
if (read_seqretry(&rename_lock, seq))
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
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
2491
- spin_unlock(&alias->d_lock);
2492
+ seq_spin_unlock(&alias->d_lock);
2493
nfs_dec_sillycount(dir);
2496
@@ -274,13 +274,13 @@ nfs_async_unlink(struct inode *dir, stru
2497
data->res.dir_attr = &data->dir_attr;
2500
- spin_lock(&dentry->d_lock);
2501
+ seq_spin_lock(&dentry->d_lock);
2502
if (dentry->d_flags & DCACHE_NFSFS_RENAMED)
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);
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);
2516
- spin_unlock(&dentry->d_lock);
2517
+ seq_spin_unlock(&dentry->d_lock);
2518
put_rpccred(data->cred);
2521
@@ -312,13 +312,13 @@ nfs_complete_unlink(struct dentry *dentr
2523
struct nfs_unlinkdata *data = NULL;
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;
2532
- spin_unlock(&dentry->d_lock);
2533
+ seq_spin_unlock(&dentry->d_lock);
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
2539
nfs_cancel_async_unlink(struct dentry *dentry)
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;
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);
2553
- spin_unlock(&dentry->d_lock);
2554
+ seq_spin_unlock(&dentry->d_lock);
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;
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);
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)
2590
- spin_lock_nested(&child->d_lock, DENTRY_D_LOCK_NESTED);
2591
+ seq_spin_lock_nested(&child->d_lock, DENTRY_D_LOCK_NESTED);
2593
child->d_flags |= DCACHE_FSNOTIFY_PARENT_WATCHED;
2595
child->d_flags &= ~DCACHE_FSNOTIFY_PARENT_WATCHED;
2596
- spin_unlock(&child->d_lock);
2597
+ seq_spin_unlock(&child->d_lock);
2599
- spin_unlock(&alias->d_lock);
2600
+ seq_spin_unlock(&alias->d_lock);
2602
spin_unlock(&inode->i_lock);
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);
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);
2619
- spin_unlock(&mnt->mnt_root->d_lock);
2620
+ seq_spin_unlock(&mnt->mnt_root->d_lock);
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;
2628
- assert_spin_locked(&mnt->mnt_root->d_lock);
2629
+ assert_seq_spin_locked(&mnt->mnt_root->d_lock);
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
2635
void fsnotify_recalc_vfsmount_mask(struct vfsmount *mnt)
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);
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);
2649
- spin_lock(&mnt->mnt_root->d_lock);
2650
+ seq_spin_lock(&mnt->mnt_root->d_lock);
2652
hlist_del_init_rcu(&mark->m.m_list);
2655
fsnotify_recalc_vfsmount_mask_locked(mnt);
2657
- spin_unlock(&mnt->mnt_root->d_lock);
2658
+ seq_spin_unlock(&mnt->mnt_root->d_lock);
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;
2666
- assert_spin_locked(&mnt->mnt_root->d_lock);
2667
+ assert_seq_spin_locked(&mnt->mnt_root->d_lock);
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
2673
struct fsnotify_mark *mark;
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);
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);
2687
- spin_lock(&mnt->mnt_root->d_lock);
2688
+ seq_spin_lock(&mnt->mnt_root->d_lock);
2692
@@ -184,7 +184,7 @@ int fsnotify_add_vfsmount_mark(struct fs
2693
hlist_add_after_rcu(last, &mark->m.m_list);
2695
fsnotify_recalc_vfsmount_mask_locked(mnt);
2696
- spin_unlock(&mnt->mnt_root->d_lock);
2697
+ seq_spin_unlock(&mnt->mnt_root->d_lock);
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);
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);
2716
- spin_unlock(&dentry->d_lock);
2717
+ seq_spin_unlock(&dentry->d_lock);
2720
- spin_unlock(&dentry->d_lock);
2721
+ seq_spin_unlock(&dentry->d_lock);
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;
2733
- spin_lock(&dentry->d_lock);
2734
+ seq_spin_lock(&dentry->d_lock);
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);
2742
- spin_unlock(&dentry->d_lock);
2743
+ seq_spin_unlock(&dentry->d_lock);
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)
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;
2764
- spin_unlock(&dentry->d_lock);
2765
+ seq_spin_unlock(&dentry->d_lock);
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;
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);
2787
type = FILEID_UDF_WITH_PARENT;
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(
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);
2804
case FILEID_INO32_GEN:
2805
fid->i32.ino = XFS_I(inode)->i_ino;
2806
fid->i32.gen = inode->i_generation;
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);
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
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 */
2831
@@ -126,7 +126,6 @@ struct dentry {
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
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)) {
2850
@@ -367,9 +366,9 @@ static inline struct dentry *dget_dlock(
2851
static inline struct dentry *dget(struct dentry *dentry)
2854
- spin_lock(&dentry->d_lock);
2855
+ seq_spin_lock(&dentry->d_lock);
2857
- spin_unlock(&dentry->d_lock);
2858
+ seq_spin_unlock(&dentry->d_lock);
2862
@@ -400,9 +399,9 @@ static inline int cant_mount(struct dent
2864
static inline void dont_mount(struct dentry *dentry)
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);
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?
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);
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
2896
struct dentry *parent;
2898
- assert_spin_locked(&dentry->d_lock);
2899
+ assert_seq_spin_locked(&dentry->d_lock);
2902
* Serialisation of setting PARENT_WATCHED on the dentries is provided
2903
@@ -353,9 +353,9 @@ static inline void __fsnotify_d_instanti
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);
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;
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);
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);
2933
/* This should never be called on a cgroup
2934
* directory with child cgroups */
2935
BUG_ON(d->d_inode->i_mode & S_IFDIR);
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);
2942
simple_unlink(dentry->d_inode, d);
2944
- spin_lock(&dentry->d_lock);
2945
+ seq_spin_lock(&dentry->d_lock);
2947
- spin_unlock(&d->d_lock);
2948
+ seq_spin_unlock(&d->d_lock);
2949
node = dentry->d_subdirs.next;
2951
- spin_unlock(&dentry->d_lock);
2952
+ seq_spin_unlock(&dentry->d_lock);
2956
@@ -905,11 +905,11 @@ static void cgroup_d_remove_dir(struct d
2957
cgroup_clear_directory(dentry);
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);
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
2978
struct seq_file *m = file->private_data;
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);
2989
- spin_unlock(&file->f_path.dentry->d_lock);
2990
+ seq_spin_unlock(&file->f_path.dentry->d_lock);
2991
single_release(inode, file);
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
3000
struct list_head *node;
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);
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);
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);
3019
simple_unlink(de->d_inode, d);
3021
- spin_lock(&de->d_lock);
3022
+ seq_spin_lock(&de->d_lock);
3024
- spin_unlock(&d->d_lock);
3025
+ seq_spin_unlock(&d->d_lock);
3026
node = de->d_subdirs.next;
3029
- spin_unlock(&de->d_lock);
3030
+ seq_spin_unlock(&de->d_lock);
3033
#define BOOL_DIR_NAME "booleans"