函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\swapfile.c Create Date:2022-07-27 16:49:52
Last Modify:2020-03-17 22:19:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:claim_swapfile

函数原型:static int claim_swapfile(struct swap_info_struct *p, struct inode *inode)

返回类型:int

参数:

类型参数名称
struct swap_info_struct *p
struct inode *inode
2878  如果S_ISBLK(i_mode)则
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  如果error小于0则
2884  返回: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  如果error小于0则返回:error
2895  如果blk_queue_is_zoned(bd_queue)则返回:负EINVAL
2897  SWP_USED etc: see above 或等于SWP_BLKDEV
2898  否则如果S_ISREG(i_mode)则
2899  swap device or bdev of swap file 等于s_bdev
2902  inode_lock(inode)
2903  如果IS_SWAPFILE(inode)则返回:负EBUSY
2906  返回:0
调用者
名称描述
SYSCALL_DEFINE2