函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:swapon tell device that all the old swap contents can be discarded,* to allow the swap device to optimize its wear-levelling.

函数原型:static int discard_swap(struct swap_info_struct *si)

返回类型:int

参数:

类型参数名称
struct swap_info_struct *si
176  err等于0
179  se等于first_se(si)
180  start_block等于start_block加1左移PAGE_SHIFT determines the page size 减9位
181  nr_blocks等于nr_pages减1左移PAGE_SHIFT determines the page size 减9位
182  如果nr_blocks
183  err等于blkdev_issue_discard(swap device or bdev of swap file , start_block, nr_blocks, GFP_KERNEL, 0)
185  如果err则返回:err
187  cond_resched()
190 se循环
191  start_block等于start_block左移PAGE_SHIFT determines the page size 减9位
192  nr_blocks等于nr_pages左移PAGE_SHIFT determines the page size 减9位
194  err等于blkdev_issue_discard(swap device or bdev of swap file , start_block, nr_blocks, GFP_KERNEL, 0)
196  如果err退出
199  cond_resched()
201  返回:err
调用者
名称描述
SYSCALL_DEFINE2