Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xiphi1978
linux
提交
c74a1cbb
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,发现更多精彩内容 >>
提交
c74a1cbb
编写于
1月 12, 2011
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
pass default dentry_operations to mount_pseudo()
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
f772c4a6
变更
8
显示空白变更内容
内联
并排
Showing
8 changed file
with
40 addition
and
33 deletion
+40
-33
arch/ia64/kernel/perfmon.c
arch/ia64/kernel/perfmon.c
+4
-2
drivers/mtd/mtdchar.c
drivers/mtd/mtdchar.c
+1
-1
fs/anon_inodes.c
fs/anon_inodes.c
+11
-10
fs/block_dev.c
fs/block_dev.c
+1
-1
fs/libfs.c
fs/libfs.c
+3
-1
fs/pipe.c
fs/pipe.c
+2
-2
include/linux/fs.h
include/linux/fs.h
+3
-1
net/socket.c
net/socket.c
+15
-15
未找到文件。
arch/ia64/kernel/perfmon.c
浏览文件 @
c74a1cbb
...
...
@@ -617,11 +617,14 @@ pfm_get_unmapped_area(struct file *file, unsigned long addr, unsigned long len,
return
get_unmapped_area
(
file
,
addr
,
len
,
pgoff
,
flags
);
}
/* forward declaration */
static
static
const
struct
dentry_operations
pfmfs_dentry_operations
;
static
struct
dentry
*
pfmfs_mount
(
struct
file_system_type
*
fs_type
,
int
flags
,
const
char
*
dev_name
,
void
*
data
)
{
return
mount_pseudo
(
fs_type
,
"pfm:"
,
NULL
,
PFMFS_MAGIC
);
return
mount_pseudo
(
fs_type
,
"pfm:"
,
NULL
,
&
pfmfs_dentry_operations
,
PFMFS_MAGIC
);
}
static
struct
file_system_type
pfm_fs_type
=
{
...
...
@@ -2232,7 +2235,6 @@ pfm_alloc_file(pfm_context_t *ctx)
}
path
.
mnt
=
mntget
(
pfmfs_mnt
);
d_set_d_op
(
path
.
dentry
,
&
pfmfs_dentry_operations
);
d_add
(
path
.
dentry
,
inode
);
file
=
alloc_file
(
&
path
,
FMODE_READ
,
&
pfm_file_ops
);
...
...
drivers/mtd/mtdchar.c
浏览文件 @
c74a1cbb
...
...
@@ -1134,7 +1134,7 @@ static const struct file_operations mtd_fops = {
static
struct
dentry
*
mtd_inodefs_mount
(
struct
file_system_type
*
fs_type
,
int
flags
,
const
char
*
dev_name
,
void
*
data
)
{
return
mount_pseudo
(
fs_type
,
"mtd_inode:"
,
NULL
,
MTD_INODE_FS_MAGIC
);
return
mount_pseudo
(
fs_type
,
"mtd_inode:"
,
NULL
,
NULL
,
MTD_INODE_FS_MAGIC
);
}
static
struct
file_system_type
mtd_inodefs_type
=
{
...
...
fs/anon_inodes.c
浏览文件 @
c74a1cbb
...
...
@@ -26,12 +26,6 @@ static struct vfsmount *anon_inode_mnt __read_mostly;
static
struct
inode
*
anon_inode_inode
;
static
const
struct
file_operations
anon_inode_fops
;
static
struct
dentry
*
anon_inodefs_mount
(
struct
file_system_type
*
fs_type
,
int
flags
,
const
char
*
dev_name
,
void
*
data
)
{
return
mount_pseudo
(
fs_type
,
"anon_inode:"
,
NULL
,
ANON_INODE_FS_MAGIC
);
}
/*
* anon_inodefs_dname() is called from d_path().
*/
...
...
@@ -41,14 +35,22 @@ static char *anon_inodefs_dname(struct dentry *dentry, char *buffer, int buflen)
dentry
->
d_name
.
name
);
}
static
const
struct
dentry_operations
anon_inodefs_dentry_operations
=
{
.
d_dname
=
anon_inodefs_dname
,
};
static
struct
dentry
*
anon_inodefs_mount
(
struct
file_system_type
*
fs_type
,
int
flags
,
const
char
*
dev_name
,
void
*
data
)
{
return
mount_pseudo
(
fs_type
,
"anon_inode:"
,
NULL
,
&
anon_inodefs_dentry_operations
,
ANON_INODE_FS_MAGIC
);
}
static
struct
file_system_type
anon_inode_fs_type
=
{
.
name
=
"anon_inodefs"
,
.
mount
=
anon_inodefs_mount
,
.
kill_sb
=
kill_anon_super
,
};
static
const
struct
dentry_operations
anon_inodefs_dentry_operations
=
{
.
d_dname
=
anon_inodefs_dname
,
};
/*
* nop .set_page_dirty method so that people can use .page_mkwrite on
...
...
@@ -113,7 +115,6 @@ struct file *anon_inode_getfile(const char *name,
*/
ihold
(
anon_inode_inode
);
d_set_d_op
(
path
.
dentry
,
&
anon_inodefs_dentry_operations
);
d_instantiate
(
path
.
dentry
,
anon_inode_inode
);
error
=
-
ENFILE
;
...
...
fs/block_dev.c
浏览文件 @
c74a1cbb
...
...
@@ -473,7 +473,7 @@ static const struct super_operations bdev_sops = {
static
struct
dentry
*
bd_mount
(
struct
file_system_type
*
fs_type
,
int
flags
,
const
char
*
dev_name
,
void
*
data
)
{
return
mount_pseudo
(
fs_type
,
"bdev:"
,
&
bdev_sops
,
0x62646576
);
return
mount_pseudo
(
fs_type
,
"bdev:"
,
&
bdev_sops
,
NULL
,
0x62646576
);
}
static
struct
file_system_type
bd_type
=
{
...
...
fs/libfs.c
浏览文件 @
c74a1cbb
...
...
@@ -217,7 +217,8 @@ static const struct super_operations simple_super_operations = {
* will never be mountable)
*/
struct
dentry
*
mount_pseudo
(
struct
file_system_type
*
fs_type
,
char
*
name
,
const
struct
super_operations
*
ops
,
unsigned
long
magic
)
const
struct
super_operations
*
ops
,
const
struct
dentry_operations
*
dops
,
unsigned
long
magic
)
{
struct
super_block
*
s
=
sget
(
fs_type
,
NULL
,
set_anon_super
,
NULL
);
struct
dentry
*
dentry
;
...
...
@@ -254,6 +255,7 @@ struct dentry *mount_pseudo(struct file_system_type *fs_type, char *name,
dentry
->
d_parent
=
dentry
;
d_instantiate
(
dentry
,
root
);
s
->
s_root
=
dentry
;
s
->
s_d_op
=
dops
;
s
->
s_flags
|=
MS_ACTIVE
;
return
dget
(
s
->
s_root
);
...
...
fs/pipe.c
浏览文件 @
c74a1cbb
...
...
@@ -1004,7 +1004,6 @@ struct file *create_write_pipe(int flags)
goto
err_inode
;
path
.
mnt
=
mntget
(
pipe_mnt
);
d_set_d_op
(
path
.
dentry
,
&
pipefs_dentry_operations
);
d_instantiate
(
path
.
dentry
,
inode
);
err
=
-
ENFILE
;
...
...
@@ -1266,7 +1265,8 @@ static const struct super_operations pipefs_ops = {
static
struct
dentry
*
pipefs_mount
(
struct
file_system_type
*
fs_type
,
int
flags
,
const
char
*
dev_name
,
void
*
data
)
{
return
mount_pseudo
(
fs_type
,
"pipe:"
,
&
pipefs_ops
,
PIPEFS_MAGIC
);
return
mount_pseudo
(
fs_type
,
"pipe:"
,
&
pipefs_ops
,
&
pipefs_dentry_operations
,
PIPEFS_MAGIC
);
}
static
struct
file_system_type
pipe_fs_type
=
{
...
...
include/linux/fs.h
浏览文件 @
c74a1cbb
...
...
@@ -1835,7 +1835,9 @@ struct super_block *sget(struct file_system_type *type,
int
(
*
set
)(
struct
super_block
*
,
void
*
),
void
*
data
);
extern
struct
dentry
*
mount_pseudo
(
struct
file_system_type
*
,
char
*
,
const
struct
super_operations
*
ops
,
unsigned
long
);
const
struct
super_operations
*
ops
,
const
struct
dentry_operations
*
dops
,
unsigned
long
);
extern
void
simple_set_mnt
(
struct
vfsmount
*
mnt
,
struct
super_block
*
sb
);
static
inline
void
sb_mark_dirty
(
struct
super_block
*
sb
)
...
...
net/socket.c
浏览文件 @
c74a1cbb
...
...
@@ -306,20 +306,6 @@ static const struct super_operations sockfs_ops = {
.
statfs
=
simple_statfs
,
};
static
struct
dentry
*
sockfs_mount
(
struct
file_system_type
*
fs_type
,
int
flags
,
const
char
*
dev_name
,
void
*
data
)
{
return
mount_pseudo
(
fs_type
,
"socket:"
,
&
sockfs_ops
,
SOCKFS_MAGIC
);
}
static
struct
vfsmount
*
sock_mnt
__read_mostly
;
static
struct
file_system_type
sock_fs_type
=
{
.
name
=
"sockfs"
,
.
mount
=
sockfs_mount
,
.
kill_sb
=
kill_anon_super
,
};
/*
* sockfs_dname() is called from d_path().
*/
...
...
@@ -333,6 +319,21 @@ static const struct dentry_operations sockfs_dentry_operations = {
.
d_dname
=
sockfs_dname
,
};
static
struct
dentry
*
sockfs_mount
(
struct
file_system_type
*
fs_type
,
int
flags
,
const
char
*
dev_name
,
void
*
data
)
{
return
mount_pseudo
(
fs_type
,
"socket:"
,
&
sockfs_ops
,
&
sockfs_dentry_operations
,
SOCKFS_MAGIC
);
}
static
struct
vfsmount
*
sock_mnt
__read_mostly
;
static
struct
file_system_type
sock_fs_type
=
{
.
name
=
"sockfs"
,
.
mount
=
sockfs_mount
,
.
kill_sb
=
kill_anon_super
,
};
/*
* Obtains the first available file descriptor and sets it up for use.
*
...
...
@@ -368,7 +369,6 @@ static int sock_alloc_file(struct socket *sock, struct file **f, int flags)
}
path
.
mnt
=
mntget
(
sock_mnt
);
d_set_d_op
(
path
.
dentry
,
&
sockfs_dentry_operations
);
d_instantiate
(
path
.
dentry
,
SOCK_INODE
(
sock
));
SOCK_INODE
(
sock
)
->
i_fop
=
&
socket_file_ops
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录