Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Linux-御风守护者
linux
提交
0ee5dc67
L
linux
项目概览
Linux-御风守护者
/
linux
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
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,发现更多精彩内容 >>
提交
0ee5dc67
编写于
7月 07, 2011
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
btrfs: kill magical embedded struct superblock
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
fb408e6c
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
31 addition
and
22 deletion
+31
-22
fs/btrfs/ctree.h
fs/btrfs/ctree.h
+1
-1
fs/btrfs/disk-io.c
fs/btrfs/disk-io.c
+4
-11
fs/btrfs/inode.c
fs/btrfs/inode.c
+1
-1
fs/super.c
fs/super.c
+23
-9
include/linux/fs.h
include/linux/fs.h
+2
-0
未找到文件。
fs/btrfs/ctree.h
浏览文件 @
0ee5dc67
...
...
@@ -1219,7 +1219,7 @@ struct btrfs_root {
* right now this just gets used so that a root has its own devid
* for stat. It may be used for more later
*/
struct
super_block
anon_super
;
dev_t
anon_dev
;
};
struct
btrfs_ioctl_defrag_range_args
{
...
...
fs/btrfs/disk-io.c
浏览文件 @
0ee5dc67
...
...
@@ -1077,12 +1077,7 @@ static int __setup_root(u32 nodesize, u32 leafsize, u32 sectorsize,
init_completion
(
&
root
->
kobj_unregister
);
root
->
defrag_running
=
0
;
root
->
root_key
.
objectid
=
objectid
;
root
->
anon_super
.
s_root
=
NULL
;
root
->
anon_super
.
s_dev
=
0
;
INIT_LIST_HEAD
(
&
root
->
anon_super
.
s_list
);
INIT_LIST_HEAD
(
&
root
->
anon_super
.
s_instances
);
init_rwsem
(
&
root
->
anon_super
.
s_umount
);
root
->
anon_dev
=
0
;
return
0
;
}
...
...
@@ -1311,7 +1306,7 @@ struct btrfs_root *btrfs_read_fs_root_no_name(struct btrfs_fs_info *fs_info,
spin_lock_init
(
&
root
->
cache_lock
);
init_waitqueue_head
(
&
root
->
cache_wait
);
ret
=
set_anon_super
(
&
root
->
anon_super
,
NULL
);
ret
=
get_anon_bdev
(
&
root
->
anon_dev
);
if
(
ret
)
goto
fail
;
...
...
@@ -2393,10 +2388,8 @@ static void free_fs_root(struct btrfs_root *root)
{
iput
(
root
->
cache_inode
);
WARN_ON
(
!
RB_EMPTY_ROOT
(
&
root
->
inode_tree
));
if
(
root
->
anon_super
.
s_dev
)
{
down_write
(
&
root
->
anon_super
.
s_umount
);
kill_anon_super
(
&
root
->
anon_super
);
}
if
(
root
->
anon_dev
)
free_anon_bdev
(
root
->
anon_dev
);
free_extent_buffer
(
root
->
node
);
free_extent_buffer
(
root
->
commit_root
);
kfree
(
root
->
free_ino_ctl
);
...
...
fs/btrfs/inode.c
浏览文件 @
0ee5dc67
...
...
@@ -6900,7 +6900,7 @@ static int btrfs_getattr(struct vfsmount *mnt,
{
struct
inode
*
inode
=
dentry
->
d_inode
;
generic_fillattr
(
inode
,
stat
);
stat
->
dev
=
BTRFS_I
(
inode
)
->
root
->
anon_
super
.
s_
dev
;
stat
->
dev
=
BTRFS_I
(
inode
)
->
root
->
anon_dev
;
stat
->
blksize
=
PAGE_CACHE_SIZE
;
stat
->
blocks
=
(
inode_get_bytes
(
inode
)
+
BTRFS_I
(
inode
)
->
delalloc_bytes
)
>>
9
;
...
...
fs/super.c
浏览文件 @
0ee5dc67
...
...
@@ -693,7 +693,7 @@ static DEFINE_IDA(unnamed_dev_ida);
static
DEFINE_SPINLOCK
(
unnamed_dev_lock
);
/* protects the above */
static
int
unnamed_dev_start
=
0
;
/* don't bother trying below it */
int
set_anon_super
(
struct
super_block
*
s
,
void
*
data
)
int
get_anon_bdev
(
dev_t
*
p
)
{
int
dev
;
int
error
;
...
...
@@ -720,24 +720,38 @@ int set_anon_super(struct super_block *s, void *data)
spin_unlock
(
&
unnamed_dev_lock
);
return
-
EMFILE
;
}
s
->
s_dev
=
MKDEV
(
0
,
dev
&
MINORMASK
);
s
->
s_bdi
=
&
noop_backing_dev_info
;
*
p
=
MKDEV
(
0
,
dev
&
MINORMASK
);
return
0
;
}
EXPORT_SYMBOL
(
get_anon_bdev
);
EXPORT_SYMBOL
(
set_anon_super
);
void
kill_anon_super
(
struct
super_block
*
sb
)
void
free_anon_bdev
(
dev_t
dev
)
{
int
slot
=
MINOR
(
sb
->
s_dev
);
generic_shutdown_super
(
sb
);
int
slot
=
MINOR
(
dev
);
spin_lock
(
&
unnamed_dev_lock
);
ida_remove
(
&
unnamed_dev_ida
,
slot
);
if
(
slot
<
unnamed_dev_start
)
unnamed_dev_start
=
slot
;
spin_unlock
(
&
unnamed_dev_lock
);
}
EXPORT_SYMBOL
(
free_anon_bdev
);
int
set_anon_super
(
struct
super_block
*
s
,
void
*
data
)
{
int
error
=
get_anon_bdev
(
&
s
->
s_dev
);
if
(
!
error
)
s
->
s_bdi
=
&
noop_backing_dev_info
;
return
error
;
}
EXPORT_SYMBOL
(
set_anon_super
);
void
kill_anon_super
(
struct
super_block
*
sb
)
{
dev_t
dev
=
sb
->
s_dev
;
generic_shutdown_super
(
sb
);
free_anon_bdev
(
dev
);
}
EXPORT_SYMBOL
(
kill_anon_super
);
...
...
include/linux/fs.h
浏览文件 @
0ee5dc67
...
...
@@ -1835,6 +1835,8 @@ void kill_litter_super(struct super_block *sb);
void
deactivate_super
(
struct
super_block
*
sb
);
void
deactivate_locked_super
(
struct
super_block
*
sb
);
int
set_anon_super
(
struct
super_block
*
s
,
void
*
data
);
int
get_anon_bdev
(
dev_t
*
);
void
free_anon_bdev
(
dev_t
);
struct
super_block
*
sget
(
struct
file_system_type
*
type
,
int
(
*
test
)(
struct
super_block
*
,
void
*
),
int
(
*
set
)(
struct
super_block
*
,
void
*
),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录