Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\super.c Create Date:2022-07-28 20:02:29
Last Modify:2022-05-24 06:42:17 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:get_tree_bdev - Get a superblock based on a single block device*@fc: The filesystem context holding the parameters*@fill_super: Helper to initialise a new superblock

Proto:int get_tree_bdev(struct fs_context *fc, int (*fill_super)(struct super_block *, struct fs_context *))

Type:int

Parameter:

TypeParameterName
struct fs_context *fc
int (*fill_super
1283  mode = le is open for reading | File is opened with O_EXCL (only set for block devices)
1284  error = 0
1286  If Not (sb_flags & Mount read-only ) Then mode |= le is open for writing
1289  If Not source Then Return valf - Store supplementary invalid argument error message*@fc: The context in which to log the error message*@fmt: The format string* Store the supplementary error message for the process if the process has* enabled the facility and return -EINVAL.(fc, "No source specified")
1292  bdev = blkdev_get_by_path(source, mode, fs_type)
1293  If IS_ERR(bdev) Then
1294  rf - Store supplementary error message*@fc: The context in which to log the error message*@fmt: The format string* Store the supplementary error message for the process if the process has* enabled the facility.(fc, "%s: Can't open blockdev", source)
1295  Return PTR_ERR(bdev)
1302  mutex_lock( & Mutex for freeze )
1303  If The counter of freeze processes > 0 Then
1304  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
1305  blkdev_put(bdev, mode)
1306  warnf - Store supplementary warning message*@fc: The context in which to log the error message*@fmt: The format string* Store the supplementary warning message for the process if the process has* enabled the facility.(fc, "%pg: Can't mount, blockdev is frozen", bdev)
1307  Return -EBUSY
1310  sb_flags |= SB_NOSEC
1311  sget_key = bdev
1312  s = sget_fc - Find or create a superblock*@fc: Filesystem context
1313  mutex_unlock - release the mutex*@lock: the mutex to be released* Unlock a mutex that has been locked by this task previously.* This function must not be used in interrupt context. Unlocking* of a not locked mutex is not allowed.
1314  If IS_ERR(s) Then
1315  blkdev_put(bdev, mode)
1316  Return PTR_ERR(s)
1319  If s_root Then
1321  If (sb_flags ^ s_flags) & Mount read-only Then
1324  blkdev_put(bdev, mode)
1325  Return -EBUSY
1335  lease a write lock
1336  blkdev_put(bdev, mode)
1337  lock for writing
1338  Else
1339  s_mode = mode
1340  snprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@size: The size of the buffer, including the trailing null space*@fmt: The format string to use*@
1341  sb_set_blocksize(s, block_size(bdev))
1342  error = fill_super(s, fc)
1343  If error Then
1345  Return error
1348  s_flags |= SB_ACTIVE
1349  bd_super = s
1352  BUG_ON(root)
1353  root = get a reference to a dentry
1354  Return 0