diff options
author | Ingo Molnar <mingo@elte.hu> | 2006-07-03 03:25:33 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-07-03 18:27:10 -0400 |
commit | 663d440eaa496db903cc58be04b9b602ba45e43b (patch) | |
tree | 8af6967e175693f1c163a106a1d84be7a1bd0bfc /include/linux/fs.h | |
parent | 2b2d5493e10051694ae3a57ea6a153e3cb4d4488 (diff) |
[PATCH] lockdep: annotate blkdev nesting
Teach special (recursive) locking code to the lock validator.
Effects on non-lockdep kernels:
- the introduction of the following function variants:
extern struct block_device *open_partition_by_devnum(dev_t, unsigned);
extern int blkdev_put_partition(struct block_device *);
static int
blkdev_get_whole(struct block_device *bdev, mode_t mode, unsigned flags);
which on non-lockdep are the same as open_by_devnum(), blkdev_put()
and blkdev_get().
- a subclass parameter to do_open(). [unused on non-lockdep]
- a subclass parameter to __blkdev_put(), which is a new internal
function for the main blkdev_put*() functions. [parameter unused
on non-lockdep kernels, except for two sanity check WARN_ON()s]
these functions carry no semantical difference - they only express
object dependencies towards the lockdep subsystem.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Cc: Neil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index e26de68059af..134b32068246 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -436,6 +436,21 @@ struct block_device { | |||
436 | }; | 436 | }; |
437 | 437 | ||
438 | /* | 438 | /* |
439 | * bdev->bd_mutex nesting subclasses for the lock validator: | ||
440 | * | ||
441 | * 0: normal | ||
442 | * 1: 'whole' | ||
443 | * 2: 'partition' | ||
444 | */ | ||
445 | enum bdev_bd_mutex_lock_class | ||
446 | { | ||
447 | BD_MUTEX_NORMAL, | ||
448 | BD_MUTEX_WHOLE, | ||
449 | BD_MUTEX_PARTITION | ||
450 | }; | ||
451 | |||
452 | |||
453 | /* | ||
439 | * Radix-tree tags, for tagging dirty and writeback pages within the pagecache | 454 | * Radix-tree tags, for tagging dirty and writeback pages within the pagecache |
440 | * radix trees | 455 | * radix trees |
441 | */ | 456 | */ |
@@ -1425,6 +1440,7 @@ extern void bd_set_size(struct block_device *, loff_t size); | |||
1425 | extern void bd_forget(struct inode *inode); | 1440 | extern void bd_forget(struct inode *inode); |
1426 | extern void bdput(struct block_device *); | 1441 | extern void bdput(struct block_device *); |
1427 | extern struct block_device *open_by_devnum(dev_t, unsigned); | 1442 | extern struct block_device *open_by_devnum(dev_t, unsigned); |
1443 | extern struct block_device *open_partition_by_devnum(dev_t, unsigned); | ||
1428 | extern const struct file_operations def_blk_fops; | 1444 | extern const struct file_operations def_blk_fops; |
1429 | extern const struct address_space_operations def_blk_aops; | 1445 | extern const struct address_space_operations def_blk_aops; |
1430 | extern const struct file_operations def_chr_fops; | 1446 | extern const struct file_operations def_chr_fops; |
@@ -1435,6 +1451,7 @@ extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long); | |||
1435 | extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); | 1451 | extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); |
1436 | extern int blkdev_get(struct block_device *, mode_t, unsigned); | 1452 | extern int blkdev_get(struct block_device *, mode_t, unsigned); |
1437 | extern int blkdev_put(struct block_device *); | 1453 | extern int blkdev_put(struct block_device *); |
1454 | extern int blkdev_put_partition(struct block_device *); | ||
1438 | extern int bd_claim(struct block_device *, void *); | 1455 | extern int bd_claim(struct block_device *, void *); |
1439 | extern void bd_release(struct block_device *); | 1456 | extern void bd_release(struct block_device *); |
1440 | #ifdef CONFIG_SYSFS | 1457 | #ifdef CONFIG_SYSFS |