函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\aio.c Create Date:2022-07-29 10:53:19
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:aio_migratepage

函数原型:static int aio_migratepage(struct address_space *mapping, struct page *new, struct page *old, enum migrate_mode mode)

返回类型:int

参数:

类型参数名称
struct address_space *mapping
struct page *new
struct page *old
enum migrate_modemode
389  如果mode恒等于MIGRATE_SYNC_NO_COPY则返回:负EINVAL
392  rc等于0
395  加自旋锁
396  ctx等于private_data
397  如果非ctx
398  rc等于负EINVAL
399  转到:out
406  如果非mutex_trylock - try to acquire the mutex, without waiting*@lock: the mutex to be acquired* Try to acquire the mutex atomically
407  rc等于负EAGAIN
408  转到:out
411  idx等于 Our offset within mapping.
412  如果idx小于nr_pages
414  如果ring_pages[idx]不等于oldrc等于负EAGAIN
416  否则rc等于负EINVAL
419  如果rc不等于0则转到:out_unlock
423  BUG_ON(Only test-and-set exist for PG_writeback. The unconditional operators are* risky: they bypass page accounting.)
424  get_page(new)
426  rc等于Replace the page in the mapping.* The number of remaining references must be:* 1 for anonymous pages without a mapping* 2 for pages with a mapping* 3 for pages with a mapping and PagePrivate/PagePrivate2 set.
427  如果rc不等于Return values from addresss_space_operations.migratepage():* - negative errno on page migration failure;* - zero on page migration success;
428  Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
429  转到:out_unlock
436  spin_lock_irqsave( & completion_lock, flags)
437  migrate_page_copy(new, old)
438  BUG_ON(ring_pages[idx] != old)
439  ring_pages[idx]等于new
440  spin_unlock_irqrestore( & completion_lock, flags)
443  Perform a free_page(), also freeing any swap cache associated with* this page if it is the last user of the page.
445  out_unlock :
446  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.
447  out :
448  自旋锁解锁
449  返回:rc