Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\swapfile.c Create Date:2022-07-28 15:19:27
Last Modify:2020-03-17 22:19:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:claim_swapfile

Proto:static int claim_swapfile(struct swap_info_struct *p, struct inode *inode)

Type:int

Parameter:

TypeParameterName
struct swap_info_struct *p
struct inode *inode
2878  If S_ISBLK(i_mode) Then
2879  swap device or bdev of swap file = bdgrab(I_BDEV(inode))
2880  error = blkdev_get(swap device or bdev of swap file , le is open for reading | le is open for writing | File is opened with O_EXCL (only set for block devices) , p)
2882  If error < 0 Then
2884  Return error
2886  seldom referenced = block_size(swap device or bdev of swap file )
2887  error = set_blocksize(swap device or bdev of swap file , PAGE_SIZE)
2888  If error < 0 Then Return error
2895  If blk_queue_is_zoned(bd_queue) Then Return -EINVAL
2897  SWP_USED etc: see above |= SWP_BLKDEV
2898  Else if S_ISREG(i_mode) Then
2899  swap device or bdev of swap file = s_bdev
2902  inode_lock(inode)
2903  If IS_SWAPFILE(inode) Then Return -EBUSY
2906  Return 0
Caller
NameDescribe
SYSCALL_DEFINE2