diff options
-rw-r--r-- | fs/nilfs2/bmap.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/nilfs2/bmap.c b/fs/nilfs2/bmap.c index 24638e059bf3..064279e33bbb 100644 --- a/fs/nilfs2/bmap.c +++ b/fs/nilfs2/bmap.c | |||
@@ -688,6 +688,8 @@ static const struct nilfs_bmap_ptr_operations nilfs_bmap_ptr_ops_gc = { | |||
688 | .bpop_translate = NULL, | 688 | .bpop_translate = NULL, |
689 | }; | 689 | }; |
690 | 690 | ||
691 | static struct lock_class_key nilfs_bmap_dat_lock_key; | ||
692 | |||
691 | /** | 693 | /** |
692 | * nilfs_bmap_read - read a bmap from an inode | 694 | * nilfs_bmap_read - read a bmap from an inode |
693 | * @bmap: bmap | 695 | * @bmap: bmap |
@@ -715,6 +717,7 @@ int nilfs_bmap_read(struct nilfs_bmap *bmap, struct nilfs_inode *raw_inode) | |||
715 | bmap->b_pops = &nilfs_bmap_ptr_ops_p; | 717 | bmap->b_pops = &nilfs_bmap_ptr_ops_p; |
716 | bmap->b_last_allocated_key = 0; /* XXX: use macro */ | 718 | bmap->b_last_allocated_key = 0; /* XXX: use macro */ |
717 | bmap->b_last_allocated_ptr = NILFS_BMAP_NEW_PTR_INIT; | 719 | bmap->b_last_allocated_ptr = NILFS_BMAP_NEW_PTR_INIT; |
720 | lockdep_set_class(&bmap->b_sem, &nilfs_bmap_dat_lock_key); | ||
718 | break; | 721 | break; |
719 | case NILFS_CPFILE_INO: | 722 | case NILFS_CPFILE_INO: |
720 | case NILFS_SUFILE_INO: | 723 | case NILFS_SUFILE_INO: |
@@ -772,6 +775,7 @@ void nilfs_bmap_init_gcdat(struct nilfs_bmap *gcbmap, struct nilfs_bmap *bmap) | |||
772 | { | 775 | { |
773 | memcpy(gcbmap, bmap, sizeof(union nilfs_bmap_union)); | 776 | memcpy(gcbmap, bmap, sizeof(union nilfs_bmap_union)); |
774 | init_rwsem(&gcbmap->b_sem); | 777 | init_rwsem(&gcbmap->b_sem); |
778 | lockdep_set_class(&bmap->b_sem, &nilfs_bmap_dat_lock_key); | ||
775 | gcbmap->b_inode = &NILFS_BMAP_I(gcbmap)->vfs_inode; | 779 | gcbmap->b_inode = &NILFS_BMAP_I(gcbmap)->vfs_inode; |
776 | } | 780 | } |
777 | 781 | ||
@@ -779,5 +783,6 @@ void nilfs_bmap_commit_gcdat(struct nilfs_bmap *gcbmap, struct nilfs_bmap *bmap) | |||
779 | { | 783 | { |
780 | memcpy(bmap, gcbmap, sizeof(union nilfs_bmap_union)); | 784 | memcpy(bmap, gcbmap, sizeof(union nilfs_bmap_union)); |
781 | init_rwsem(&bmap->b_sem); | 785 | init_rwsem(&bmap->b_sem); |
786 | lockdep_set_class(&bmap->b_sem, &nilfs_bmap_dat_lock_key); | ||
782 | bmap->b_inode = &NILFS_BMAP_I(bmap)->vfs_inode; | 787 | bmap->b_inode = &NILFS_BMAP_I(bmap)->vfs_inode; |
783 | } | 788 | } |