summaryrefslogtreecommitdiffstats
path: root/fs/debugfs/inode.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/debugfs/inode.c')
-rw-r--r--fs/debugfs/inode.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
index b7fcc0de0b2f..bece948b363d 100644
--- a/fs/debugfs/inode.c
+++ b/fs/debugfs/inode.c
@@ -265,7 +265,7 @@ static struct dentry *start_creating(const char *name, struct dentry *parent)
265 if (!parent) 265 if (!parent)
266 parent = debugfs_mount->mnt_root; 266 parent = debugfs_mount->mnt_root;
267 267
268 mutex_lock(&d_inode(parent)->i_mutex); 268 inode_lock(d_inode(parent));
269 dentry = lookup_one_len(name, parent, strlen(name)); 269 dentry = lookup_one_len(name, parent, strlen(name));
270 if (!IS_ERR(dentry) && d_really_is_positive(dentry)) { 270 if (!IS_ERR(dentry) && d_really_is_positive(dentry)) {
271 dput(dentry); 271 dput(dentry);
@@ -273,7 +273,7 @@ static struct dentry *start_creating(const char *name, struct dentry *parent)
273 } 273 }
274 274
275 if (IS_ERR(dentry)) { 275 if (IS_ERR(dentry)) {
276 mutex_unlock(&d_inode(parent)->i_mutex); 276 inode_unlock(d_inode(parent));
277 simple_release_fs(&debugfs_mount, &debugfs_mount_count); 277 simple_release_fs(&debugfs_mount, &debugfs_mount_count);
278 } 278 }
279 279
@@ -282,7 +282,7 @@ static struct dentry *start_creating(const char *name, struct dentry *parent)
282 282
283static struct dentry *failed_creating(struct dentry *dentry) 283static struct dentry *failed_creating(struct dentry *dentry)
284{ 284{
285 mutex_unlock(&d_inode(dentry->d_parent)->i_mutex); 285 inode_unlock(d_inode(dentry->d_parent));
286 dput(dentry); 286 dput(dentry);
287 simple_release_fs(&debugfs_mount, &debugfs_mount_count); 287 simple_release_fs(&debugfs_mount, &debugfs_mount_count);
288 return NULL; 288 return NULL;
@@ -290,7 +290,7 @@ static struct dentry *failed_creating(struct dentry *dentry)
290 290
291static struct dentry *end_creating(struct dentry *dentry) 291static struct dentry *end_creating(struct dentry *dentry)
292{ 292{
293 mutex_unlock(&d_inode(dentry->d_parent)->i_mutex); 293 inode_unlock(d_inode(dentry->d_parent));
294 return dentry; 294 return dentry;
295} 295}
296 296
@@ -560,9 +560,9 @@ void debugfs_remove(struct dentry *dentry)
560 if (!parent || d_really_is_negative(parent)) 560 if (!parent || d_really_is_negative(parent))
561 return; 561 return;
562 562
563 mutex_lock(&d_inode(parent)->i_mutex); 563 inode_lock(d_inode(parent));
564 ret = __debugfs_remove(dentry, parent); 564 ret = __debugfs_remove(dentry, parent);
565 mutex_unlock(&d_inode(parent)->i_mutex); 565 inode_unlock(d_inode(parent));
566 if (!ret) 566 if (!ret)
567 simple_release_fs(&debugfs_mount, &debugfs_mount_count); 567 simple_release_fs(&debugfs_mount, &debugfs_mount_count);
568} 568}
@@ -594,7 +594,7 @@ void debugfs_remove_recursive(struct dentry *dentry)
594 594
595 parent = dentry; 595 parent = dentry;
596 down: 596 down:
597 mutex_lock(&d_inode(parent)->i_mutex); 597 inode_lock(d_inode(parent));
598 loop: 598 loop:
599 /* 599 /*
600 * The parent->d_subdirs is protected by the d_lock. Outside that 600 * The parent->d_subdirs is protected by the d_lock. Outside that
@@ -609,7 +609,7 @@ void debugfs_remove_recursive(struct dentry *dentry)
609 /* perhaps simple_empty(child) makes more sense */ 609 /* perhaps simple_empty(child) makes more sense */
610 if (!list_empty(&child->d_subdirs)) { 610 if (!list_empty(&child->d_subdirs)) {
611 spin_unlock(&parent->d_lock); 611 spin_unlock(&parent->d_lock);
612 mutex_unlock(&d_inode(parent)->i_mutex); 612 inode_unlock(d_inode(parent));
613 parent = child; 613 parent = child;
614 goto down; 614 goto down;
615 } 615 }
@@ -630,10 +630,10 @@ void debugfs_remove_recursive(struct dentry *dentry)
630 } 630 }
631 spin_unlock(&parent->d_lock); 631 spin_unlock(&parent->d_lock);
632 632
633 mutex_unlock(&d_inode(parent)->i_mutex); 633 inode_unlock(d_inode(parent));
634 child = parent; 634 child = parent;
635 parent = parent->d_parent; 635 parent = parent->d_parent;
636 mutex_lock(&d_inode(parent)->i_mutex); 636 inode_lock(d_inode(parent));
637 637
638 if (child != dentry) 638 if (child != dentry)
639 /* go up */ 639 /* go up */
@@ -641,7 +641,7 @@ void debugfs_remove_recursive(struct dentry *dentry)
641 641
642 if (!__debugfs_remove(child, parent)) 642 if (!__debugfs_remove(child, parent))
643 simple_release_fs(&debugfs_mount, &debugfs_mount_count); 643 simple_release_fs(&debugfs_mount, &debugfs_mount_count);
644 mutex_unlock(&d_inode(parent)->i_mutex); 644 inode_unlock(d_inode(parent));
645} 645}
646EXPORT_SYMBOL_GPL(debugfs_remove_recursive); 646EXPORT_SYMBOL_GPL(debugfs_remove_recursive);
647 647