Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
f18a5f21
K
Kernel
项目概览
openeuler
/
Kernel
大约 1 年 前同步成功
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f18a5f21
编写于
8月 01, 2011
作者:
T
Theodore Ts'o
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ext4: use ext4_kvzalloc()/ext4_kvmalloc() for s_group_desc and s_group_info
Signed-off-by:
N
"Theodore Ts'o"
<
tytso@mit.edu
>
上级
9933fc0a
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
15 addition
and
13 deletion
+15
-13
fs/ext4/mballoc.c
fs/ext4/mballoc.c
+3
-3
fs/ext4/resize.c
fs/ext4/resize.c
+7
-6
fs/ext4/super.c
fs/ext4/super.c
+5
-4
未找到文件。
fs/ext4/mballoc.c
浏览文件 @
f18a5f21
...
...
@@ -2331,7 +2331,7 @@ static int ext4_mb_init_backend(struct super_block *sb)
/* An 8TB filesystem with 64-bit pointers requires a 4096 byte
* kmalloc. A 128kb malloc should suffice for a 256TB filesystem.
* So a two level scheme suffices for now. */
sbi
->
s_group_info
=
k
zalloc
(
array_size
,
GFP_KERNEL
);
sbi
->
s_group_info
=
ext4_kv
zalloc
(
array_size
,
GFP_KERNEL
);
if
(
sbi
->
s_group_info
==
NULL
)
{
printk
(
KERN_ERR
"EXT4-fs: can't allocate buddy meta group
\n
"
);
return
-
ENOMEM
;
...
...
@@ -2365,7 +2365,7 @@ static int ext4_mb_init_backend(struct super_block *sb)
kfree
(
sbi
->
s_group_info
[
i
]);
iput
(
sbi
->
s_buddy_cache
);
err_freesgi:
k
free
(
sbi
->
s_group_info
);
ext4_kv
free
(
sbi
->
s_group_info
);
return
-
ENOMEM
;
}
...
...
@@ -2559,7 +2559,7 @@ int ext4_mb_release(struct super_block *sb)
EXT4_DESC_PER_BLOCK_BITS
(
sb
);
for
(
i
=
0
;
i
<
num_meta_group_infos
;
i
++
)
kfree
(
sbi
->
s_group_info
[
i
]);
k
free
(
sbi
->
s_group_info
);
ext4_kv
free
(
sbi
->
s_group_info
);
}
kfree
(
sbi
->
s_mb_offsets
);
kfree
(
sbi
->
s_mb_maxs
);
...
...
fs/ext4/resize.c
浏览文件 @
f18a5f21
...
...
@@ -467,12 +467,13 @@ static int add_new_gdb(handle_t *handle, struct inode *inode,
if
(
unlikely
(
err
))
goto
exit_dindj
;
n_group_desc
=
kmalloc
((
gdb_num
+
1
)
*
sizeof
(
struct
buffer_head
*
),
GFP_NOFS
);
n_group_desc
=
ext4_kvmalloc
((
gdb_num
+
1
)
*
sizeof
(
struct
buffer_head
*
),
GFP_NOFS
);
if
(
!
n_group_desc
)
{
err
=
-
ENOMEM
;
ext4_warning
(
sb
,
"not enough memory for %lu groups"
,
gdb_num
+
1
);
ext4_warning
(
sb
,
"not enough memory for %lu groups"
,
gdb_num
+
1
);
goto
exit_inode
;
}
...
...
@@ -507,7 +508,7 @@ static int add_new_gdb(handle_t *handle, struct inode *inode,
n_group_desc
[
gdb_num
]
=
gdb_bh
;
EXT4_SB
(
sb
)
->
s_group_desc
=
n_group_desc
;
EXT4_SB
(
sb
)
->
s_gdb_count
++
;
k
free
(
o_group_desc
);
ext4_kv
free
(
o_group_desc
);
le16_add_cpu
(
&
es
->
s_reserved_gdt_blocks
,
-
1
);
err
=
ext4_handle_dirty_metadata
(
handle
,
NULL
,
EXT4_SB
(
sb
)
->
s_sbh
);
...
...
@@ -517,7 +518,7 @@ static int add_new_gdb(handle_t *handle, struct inode *inode,
return
err
;
exit_inode:
k
free
(
n_group_desc
);
ext4_kv
free
(
n_group_desc
);
/* ext4_handle_release_buffer(handle, iloc.bh); */
brelse
(
iloc
.
bh
);
exit_dindj:
...
...
fs/ext4/super.c
浏览文件 @
f18a5f21
...
...
@@ -819,7 +819,7 @@ static void ext4_put_super(struct super_block *sb)
for
(
i
=
0
;
i
<
sbi
->
s_gdb_count
;
i
++
)
brelse
(
sbi
->
s_group_desc
[
i
]);
k
free
(
sbi
->
s_group_desc
);
ext4_kv
free
(
sbi
->
s_group_desc
);
ext4_kvfree
(
sbi
->
s_flex_groups
);
percpu_counter_destroy
(
&
sbi
->
s_freeblocks_counter
);
percpu_counter_destroy
(
&
sbi
->
s_freeinodes_counter
);
...
...
@@ -3439,8 +3439,9 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
(
EXT4_MAX_BLOCK_FILE_PHYS
/
EXT4_BLOCKS_PER_GROUP
(
sb
)));
db_count
=
(
sbi
->
s_groups_count
+
EXT4_DESC_PER_BLOCK
(
sb
)
-
1
)
/
EXT4_DESC_PER_BLOCK
(
sb
);
sbi
->
s_group_desc
=
kmalloc
(
db_count
*
sizeof
(
struct
buffer_head
*
),
GFP_KERNEL
);
sbi
->
s_group_desc
=
ext4_kvmalloc
(
db_count
*
sizeof
(
struct
buffer_head
*
),
GFP_KERNEL
);
if
(
sbi
->
s_group_desc
==
NULL
)
{
ext4_msg
(
sb
,
KERN_ERR
,
"not enough memory"
);
goto
failed_mount
;
...
...
@@ -3783,7 +3784,7 @@ static int ext4_fill_super(struct super_block *sb, void *data, int silent)
failed_mount2:
for
(
i
=
0
;
i
<
db_count
;
i
++
)
brelse
(
sbi
->
s_group_desc
[
i
]);
k
free
(
sbi
->
s_group_desc
);
ext4_kv
free
(
sbi
->
s_group_desc
);
failed_mount:
if
(
sbi
->
s_proc
)
{
remove_proc_entry
(
sb
->
s_id
,
ext4_proc_root
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录