@@ -876,9 +876,9 @@ static struct super_block *quotactl_block(const char __user *special, int cmd)
if (IS_ERR(bdev))
return ERR_CAST(bdev);
if (quotactl_cmd_onoff(cmd))
- sb = get_super_exclusive_thawed(bdev);
+ sb = get_super_thawed(bdev, true);
else if (quotactl_cmd_write(cmd))
- sb = get_super_thawed(bdev);
+ sb = get_super_thawed(bdev, false);
else
sb = get_super(bdev);
bdput(bdev);
@@ -789,8 +789,17 @@ struct super_block *get_super(struct block_device *bdev)
}
EXPORT_SYMBOL(get_super);
-static struct super_block *__get_super_thawed(struct block_device *bdev,
- bool excl)
+/**
+ * get_super_thawed - get thawed superblock of a device
+ * @bdev: device to get the superblock for
+ * @excl: lock s_umount exclusive if %true, else shared.
+ *
+ * Scans the superblock list and finds the superblock of the file system mounted
+ * on the device. The superblock is returned with s_umount held once it is
+ * thawed (or immediately if it was not frozen), or %NULL if no superblock was
+ * found.
+ */
+struct super_block *get_super_thawed(struct block_device *bdev, bool excl)
{
while (1) {
struct super_block *s = __get_super(bdev, excl);
@@ -805,37 +814,8 @@ static struct super_block *__get_super_thawed(struct block_device *bdev,
put_super(s);
}
}
-
-/**
- * get_super_thawed - get thawed superblock of a device
- * @bdev: device to get the superblock for
- *
- * Scans the superblock list and finds the superblock of the file system
- * mounted on the device. The superblock is returned once it is thawed
- * (or immediately if it was not frozen). %NULL is returned if no match
- * is found.
- */
-struct super_block *get_super_thawed(struct block_device *bdev)
-{
- return __get_super_thawed(bdev, false);
-}
EXPORT_SYMBOL(get_super_thawed);
-/**
- * get_super_exclusive_thawed - get thawed superblock of a device
- * @bdev: device to get the superblock for
- *
- * Scans the superblock list and finds the superblock of the file system
- * mounted on the device. The superblock is returned once it is thawed
- * (or immediately if it was not frozen) and s_umount semaphore is held
- * in exclusive mode. %NULL is returned if no match is found.
- */
-struct super_block *get_super_exclusive_thawed(struct block_device *bdev)
-{
- return __get_super_thawed(bdev, true);
-}
-EXPORT_SYMBOL(get_super_exclusive_thawed);
-
/**
* get_active_super - get an active reference to the superblock of a device
* @bdev: device to get the superblock for
@@ -3132,8 +3132,7 @@ extern struct file_system_type *get_filesystem(struct file_system_type *fs);
extern void put_filesystem(struct file_system_type *fs);
extern struct file_system_type *get_fs_type(const char *name);
extern struct super_block *get_super(struct block_device *);
-extern struct super_block *get_super_thawed(struct block_device *);
-extern struct super_block *get_super_exclusive_thawed(struct block_device *bdev);
+struct super_block *get_super_thawed(struct block_device *bdev, bool excl);
extern struct super_block *get_active_super(struct block_device *bdev);
extern void drop_super(struct super_block *sb);
extern void drop_super_exclusive(struct super_block *sb);
Merge get_super_thawed and get_super_exclusive_thawed into a single function. Signed-off-by: Christoph Hellwig <hch@lst.de> --- fs/quota/quota.c | 4 ++-- fs/super.c | 42 +++++++++++------------------------------- include/linux/fs.h | 3 +-- 3 files changed, 14 insertions(+), 35 deletions(-)