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:mount_bdev

Proto:struct dentry *mount_bdev(struct file_system_type *fs_type, int flags, const char *dev_name, void *data, int (*fill_super)(struct super_block *, void *, int ))

Type:struct dentry

Parameter:

TypeParameterName
struct file_system_type *fs_type
intflags
const char *dev_name
void *data
int (*fill_super
1369  mode = le is open for reading | File is opened with O_EXCL (only set for block devices)
1370  error = 0
1372  If Not (flags & Mount read-only ) Then mode |= le is open for writing
1375  bdev = blkdev_get_by_path(dev_name, mode, fs_type)
1376  If IS_ERR(bdev) Then Return ERR_CAST - Explicitly cast an error-valued pointer to another pointer type*@ptr: The pointer to cast.* Explicitly cast an error-valued pointer to another pointer type in such a* way as to make it clear that's what's going on.
1384  mutex_lock( & Mutex for freeze )
1385  If The counter of freeze processes > 0 Then
1386  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.
1387  error = -EBUSY
1388  Go to error_bdev
1390  s = find or create a superblock
1392  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.
1393  If IS_ERR(s) Then Go to error_s
1396  If s_root Then
1397  If (flags ^ s_flags) & Mount read-only Then
1399  error = -EBUSY
1400  Go to error_bdev
1410  lease a write lock
1411  blkdev_put(bdev, mode)
1412  lock for writing
1413  Else
1414  s_mode = mode
1415  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*@
1416  sb_set_blocksize(s, block_size(bdev))
1417  error = fill_super(s, data, flags & SB_SILENT ? 1 : 0)
1418  If error Then
1420  Go to error
1423  s_flags |= SB_ACTIVE
1424  bd_super = s
1427  Return get a reference to a dentry
1429  error_s :
1430  error = PTR_ERR(s)
1431  error_bdev :
1432  blkdev_put(bdev, mode)
1433  error :
1434  Return ERR_PTR(error)