函数源码

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source File:include\linux\swapops.h Create Date:2022-07-27 11:02:01
首页 Copyright©Brick

132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
#else /* CONFIG_DEVICE_PRIVATE */
static inline swp_entry_t make_device_private_entry(struct page *page, bool write)
{
    return swp_entry(0, 0);
}
 
static inline void make_device_private_entry_read(swp_entry_t *entry)
{
}
 
static inline bool is_device_private_entry(swp_entry_t entry)
{
    return false;
}
 
static inline bool is_write_device_private_entry(swp_entry_t entry)
{
    return false;
}
 
static inline unsigned long device_private_entry_to_pfn(swp_entry_t entry)
{
    return 0;
}
 
static inline struct page *device_private_entry_to_page(swp_entry_t entry)
{
    return NULL;
}
#endif /* CONFIG_DEVICE_PRIVATE */
 
#ifdef CONFIG_MIGRATION
static inline swp_entry_t make_migration_entry(struct page *page, int write)
{
    BUG_ON(!PageLocked(compound_head(page)));
 
    return swp_entry(write ? SWP_MIGRATION_WRITE : SWP_MIGRATION_READ,
            page_to_pfn(page));
}