Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Linux-御风守护者
linux
提交
863d684f
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,发现更多精彩内容 >>
提交
863d684f
编写于
11月 25, 2011
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
vfs: move the rest of int fields to struct mount
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
15169fe7
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
21 addition
and
19 deletion
+21
-19
fs/mount.h
fs/mount.h
+3
-0
fs/namespace.c
fs/namespace.c
+17
-15
fs/pnode.c
fs/pnode.c
+1
-1
include/linux/mount.h
include/linux/mount.h
+0
-3
未找到文件。
fs/mount.h
浏览文件 @
863d684f
...
...
@@ -28,6 +28,9 @@ struct mount {
struct
mnt_namespace
*
mnt_ns
;
/* containing namespace */
int
mnt_id
;
/* mount identifier */
int
mnt_group_id
;
/* peer group identifier */
int
mnt_expiry_mark
;
/* true if marked for expiry */
int
mnt_pinned
;
int
mnt_ghosts
;
};
static
inline
struct
mount
*
real_mount
(
struct
vfsmount
*
mnt
)
...
...
fs/namespace.c
浏览文件 @
863d684f
...
...
@@ -787,9 +787,9 @@ static void mntput_no_expire(struct mount *mnt)
return
;
br_write_lock
(
vfsmount_lock
);
#endif
if
(
unlikely
(
mnt
->
mnt
.
mnt
_pinned
))
{
mnt_add_count
(
mnt
,
mnt
->
mnt
.
mnt
_pinned
+
1
);
mnt
->
mnt
.
mnt
_pinned
=
0
;
if
(
unlikely
(
mnt
->
mnt_pinned
))
{
mnt_add_count
(
mnt
,
mnt
->
mnt_pinned
+
1
);
mnt
->
mnt_pinned
=
0
;
br_write_unlock
(
vfsmount_lock
);
acct_auto_close_mnt
(
&
mnt
->
mnt
);
goto
put_again
;
...
...
@@ -801,10 +801,11 @@ static void mntput_no_expire(struct mount *mnt)
void
mntput
(
struct
vfsmount
*
mnt
)
{
if
(
mnt
)
{
struct
mount
*
m
=
real_mount
(
mnt
);
/* avoid cacheline pingpong, hope gcc doesn't get "smart" */
if
(
unlikely
(
m
nt
->
mnt_expiry_mark
))
m
nt
->
mnt_expiry_mark
=
0
;
mntput_no_expire
(
real_mount
(
mnt
)
);
if
(
unlikely
(
m
->
mnt_expiry_mark
))
m
->
mnt_expiry_mark
=
0
;
mntput_no_expire
(
m
);
}
}
EXPORT_SYMBOL
(
mntput
);
...
...
@@ -820,16 +821,17 @@ EXPORT_SYMBOL(mntget);
void
mnt_pin
(
struct
vfsmount
*
mnt
)
{
br_write_lock
(
vfsmount_lock
);
mnt
->
mnt_pinned
++
;
real_mount
(
mnt
)
->
mnt_pinned
++
;
br_write_unlock
(
vfsmount_lock
);
}
EXPORT_SYMBOL
(
mnt_pin
);
void
mnt_unpin
(
struct
vfsmount
*
m
nt
)
void
mnt_unpin
(
struct
vfsmount
*
m
)
{
struct
mount
*
mnt
=
real_mount
(
m
);
br_write_lock
(
vfsmount_lock
);
if
(
mnt
->
mnt_pinned
)
{
mnt_add_count
(
real_mount
(
mnt
)
,
1
);
mnt_add_count
(
mnt
,
1
);
mnt
->
mnt_pinned
--
;
}
br_write_unlock
(
vfsmount_lock
);
...
...
@@ -1200,17 +1202,17 @@ void release_mounts(struct list_head *head)
list_del_init
(
&
mnt
->
mnt_hash
);
if
(
mnt_has_parent
(
mnt
))
{
struct
dentry
*
dentry
;
struct
vfs
mount
*
m
;
struct
mount
*
m
;
br_write_lock
(
vfsmount_lock
);
dentry
=
mnt
->
mnt_mountpoint
;
m
=
&
mnt
->
mnt_parent
->
m
nt
;
m
=
mnt
->
mnt_pare
nt
;
mnt
->
mnt_mountpoint
=
mnt
->
mnt
.
mnt_root
;
mnt
->
mnt_parent
=
mnt
;
m
->
mnt_ghosts
--
;
br_write_unlock
(
vfsmount_lock
);
dput
(
dentry
);
mntput
(
m
);
mntput
(
&
m
->
mnt
);
}
mntput
(
&
mnt
->
mnt
);
}
...
...
@@ -1239,7 +1241,7 @@ void umount_tree(struct mount *mnt, int propagate, struct list_head *kill)
__mnt_make_shortterm
(
p
);
list_del_init
(
&
p
->
mnt_child
);
if
(
mnt_has_parent
(
p
))
{
p
->
mnt_parent
->
mnt
.
mnt
_ghosts
++
;
p
->
mnt_parent
->
mnt_ghosts
++
;
dentry_reset_mounted
(
p
->
mnt_mountpoint
);
}
change_mnt_propagation
(
p
,
MS_PRIVATE
);
...
...
@@ -1281,7 +1283,7 @@ static int do_umount(struct mount *mnt, int flags)
}
br_write_unlock
(
vfsmount_lock
);
if
(
!
xchg
(
&
mnt
->
mnt
.
mnt
_expiry_mark
,
1
))
if
(
!
xchg
(
&
mnt
->
mnt_expiry_mark
,
1
))
return
-
EAGAIN
;
}
...
...
@@ -2106,7 +2108,7 @@ void mark_mounts_for_expiry(struct list_head *mounts)
* cleared by mntput())
*/
list_for_each_entry_safe
(
mnt
,
next
,
mounts
,
mnt_expire
)
{
if
(
!
xchg
(
&
mnt
->
mnt
.
mnt
_expiry_mark
,
1
)
||
if
(
!
xchg
(
&
mnt
->
mnt_expiry_mark
,
1
)
||
propagate_mount_busy
(
mnt
,
1
))
continue
;
list_move
(
&
mnt
->
mnt_expire
,
&
graveyard
);
...
...
fs/pnode.c
浏览文件 @
863d684f
...
...
@@ -272,7 +272,7 @@ int propagate_mnt(struct mount *dest_mnt, struct dentry *dest_dentry,
*/
static
inline
int
do_refcount_check
(
struct
mount
*
mnt
,
int
count
)
{
int
mycount
=
mnt_get_count
(
mnt
)
-
mnt
->
mnt
.
mnt
_ghosts
;
int
mycount
=
mnt_get_count
(
mnt
)
-
mnt
->
mnt_ghosts
;
return
(
mycount
>
count
);
}
...
...
include/linux/mount.h
浏览文件 @
863d684f
...
...
@@ -58,9 +58,6 @@ struct vfsmount {
#endif
const
char
*
mnt_devname
;
/* Name of device e.g. /dev/dsk/hda1 */
struct
list_head
mnt_list
;
int
mnt_expiry_mark
;
/* true if marked for expiry */
int
mnt_pinned
;
int
mnt_ghosts
;
};
struct
file
;
/* forward dec */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录