Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xiphi1978
linux
提交
583e4a23
L
linux
项目概览
xiphi1978
/
linux
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
583e4a23
编写于
5月 06, 2020
作者:
D
David Sterba
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
btrfs: update documentation of set/get helpers
Signed-off-by:
N
David Sterba
<
dsterba@suse.com
>
上级
f472d3c2
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
17 addition
and
13 deletion
+17
-13
fs/btrfs/struct-funcs.c
fs/btrfs/struct-funcs.c
+17
-13
未找到文件。
fs/btrfs/struct-funcs.c
浏览文件 @
583e4a23
...
...
@@ -39,23 +39,27 @@ static bool check_setget_bounds(const struct extent_buffer *eb,
}
/*
* this is some deeply nasty code.
* Macro templates that define helpers to read/write extent buffer data of a
* given size, that are also used via ctree.h for access to item members by
* specialized helpers.
*
* The end result is that anyone who #includes ctree.h gets a
* declaration for the btrfs_set_foo functions and btrfs_foo functions,
* which are wrappers of btrfs_set_token_#bits functions and
* btrfs_get_token_#bits functions, which are defined in this file.
* Generic helpers:
* - btrfs_set_8 (for 8/16/32/64)
* - btrfs_get_8 (for 8/16/32/64)
*
* These setget functions do all the extent_buffer related mapping
* required to efficiently read and write specific fields in the extent
* buffers. Every pointer to metadata items in btrfs is really just
* an unsigned long offset into the extent buffer which has been
* cast to a specific type. This gives us all the gcc type checking.
* Generic helpers with a token (cached address of the most recently accessed
* page):
* - btrfs_set_token_8 (for 8/16/32/64)
* - btrfs_get_token_8 (for 8/16/32/64)
*
* The extent buffer api is used to do the page spanning work required to
* have a metadata blocksize different from the page size.
* The set/get functions handle data spanning two pages transparently, in case
* metadata block size is larger than page. Every pointer to metadata items is
* an offset into the extent buffer page array, cast to a specific type. This
* gives us all the type checking.
*
* There are 2 variants defined, one with a token pointer and one without.
* The extent buffer pages stored in the array pages do not form a contiguous
* phyusical range, but the API functions assume the linear offset to the range
* from 0 to metadata node size.
*/
#define DEFINE_BTRFS_SETGET_BITS(bits) \
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录