Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
3dadecce
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
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看板
提交
3dadecce
编写于
1月 24, 2013
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
switch vfs_getattr() to struct path
Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
e72837e3
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
40 addition
and
35 deletion
+40
-35
drivers/base/devtmpfs.c
drivers/base/devtmpfs.c
+2
-1
drivers/base/firmware_class.c
drivers/base/firmware_class.c
+1
-1
drivers/block/loop.c
drivers/block/loop.c
+1
-1
fs/ecryptfs/ecryptfs_kernel.h
fs/ecryptfs/ecryptfs_kernel.h
+6
-0
fs/ecryptfs/inode.c
fs/ecryptfs/inode.c
+1
-2
fs/nfsd/nfs3proc.c
fs/nfsd/nfs3proc.c
+1
-4
fs/nfsd/nfs3xdr.c
fs/nfsd/nfs3xdr.c
+5
-5
fs/nfsd/nfs4xdr.c
fs/nfsd/nfs4xdr.c
+2
-2
fs/nfsd/nfsproc.c
fs/nfsd/nfsproc.c
+3
-9
fs/nfsd/nfsxdr.c
fs/nfsd/nfsxdr.c
+2
-1
fs/nfsd/vfs.h
fs/nfsd/vfs.h
+8
-0
fs/stat.c
fs/stat.c
+6
-7
include/linux/fs.h
include/linux/fs.h
+1
-1
kernel/module.c
kernel/module.c
+1
-1
未找到文件。
drivers/base/devtmpfs.c
浏览文件 @
3dadecce
...
...
@@ -302,7 +302,8 @@ static int handle_remove(const char *nodename, struct device *dev)
if
(
dentry
->
d_inode
)
{
struct
kstat
stat
;
err
=
vfs_getattr
(
parent
.
mnt
,
dentry
,
&
stat
);
struct
path
p
=
{.
mnt
=
parent
.
mnt
,
.
dentry
=
dentry
};
err
=
vfs_getattr
(
&
p
,
&
stat
);
if
(
!
err
&&
dev_mynode
(
dev
,
dentry
->
d_inode
,
&
stat
))
{
struct
iattr
newattrs
;
/*
...
...
drivers/base/firmware_class.c
浏览文件 @
3dadecce
...
...
@@ -290,7 +290,7 @@ MODULE_PARM_DESC(path, "customized firmware image search path with a higher prio
static
noinline_for_stack
long
fw_file_size
(
struct
file
*
file
)
{
struct
kstat
st
;
if
(
vfs_getattr
(
file
->
f_path
.
mnt
,
file
->
f_path
.
dentry
,
&
st
))
if
(
vfs_getattr
(
&
file
->
f_path
,
&
st
))
return
-
1
;
if
(
!
S_ISREG
(
st
.
mode
))
return
-
1
;
...
...
drivers/block/loop.c
浏览文件 @
3dadecce
...
...
@@ -1139,7 +1139,7 @@ loop_get_status(struct loop_device *lo, struct loop_info64 *info)
if
(
lo
->
lo_state
!=
Lo_bound
)
return
-
ENXIO
;
error
=
vfs_getattr
(
file
->
f_path
.
mnt
,
file
->
f_path
.
dentry
,
&
stat
);
error
=
vfs_getattr
(
&
file
->
f_path
,
&
stat
);
if
(
error
)
return
error
;
memset
(
info
,
0
,
sizeof
(
*
info
));
...
...
fs/ecryptfs/ecryptfs_kernel.h
浏览文件 @
3dadecce
...
...
@@ -509,6 +509,12 @@ ecryptfs_dentry_to_lower_mnt(struct dentry *dentry)
return
((
struct
ecryptfs_dentry_info
*
)
dentry
->
d_fsdata
)
->
lower_path
.
mnt
;
}
static
inline
struct
path
*
ecryptfs_dentry_to_lower_path
(
struct
dentry
*
dentry
)
{
return
&
((
struct
ecryptfs_dentry_info
*
)
dentry
->
d_fsdata
)
->
lower_path
;
}
static
inline
void
ecryptfs_set_dentry_lower_mnt
(
struct
dentry
*
dentry
,
struct
vfsmount
*
lower_mnt
)
{
...
...
fs/ecryptfs/inode.c
浏览文件 @
3dadecce
...
...
@@ -1027,8 +1027,7 @@ int ecryptfs_getattr(struct vfsmount *mnt, struct dentry *dentry,
struct
kstat
lower_stat
;
int
rc
;
rc
=
vfs_getattr
(
ecryptfs_dentry_to_lower_mnt
(
dentry
),
ecryptfs_dentry_to_lower
(
dentry
),
&
lower_stat
);
rc
=
vfs_getattr
(
ecryptfs_dentry_to_lower_path
(
dentry
),
&
lower_stat
);
if
(
!
rc
)
{
fsstack_copy_attr_all
(
dentry
->
d_inode
,
ecryptfs_inode_to_lower
(
dentry
->
d_inode
));
...
...
fs/nfsd/nfs3proc.c
浏览文件 @
3dadecce
...
...
@@ -43,7 +43,6 @@ static __be32
nfsd3_proc_getattr
(
struct
svc_rqst
*
rqstp
,
struct
nfsd_fhandle
*
argp
,
struct
nfsd3_attrstat
*
resp
)
{
int
err
;
__be32
nfserr
;
dprintk
(
"nfsd: GETATTR(3) %s
\n
"
,
...
...
@@ -55,9 +54,7 @@ nfsd3_proc_getattr(struct svc_rqst *rqstp, struct nfsd_fhandle *argp,
if
(
nfserr
)
RETURN_STATUS
(
nfserr
);
err
=
vfs_getattr
(
resp
->
fh
.
fh_export
->
ex_path
.
mnt
,
resp
->
fh
.
fh_dentry
,
&
resp
->
stat
);
nfserr
=
nfserrno
(
err
);
nfserr
=
fh_getattr
(
&
resp
->
fh
,
&
resp
->
stat
);
RETURN_STATUS
(
nfserr
);
}
...
...
fs/nfsd/nfs3xdr.c
浏览文件 @
3dadecce
...
...
@@ -11,6 +11,7 @@
#include "xdr3.h"
#include "auth.h"
#include "netns.h"
#include "vfs.h"
#define NFSDDBG_FACILITY NFSDDBG_XDR
...
...
@@ -204,10 +205,10 @@ encode_post_op_attr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp)
{
struct
dentry
*
dentry
=
fhp
->
fh_dentry
;
if
(
dentry
&&
dentry
->
d_inode
)
{
int
err
;
__be32
err
;
struct
kstat
stat
;
err
=
vfs_getattr
(
fhp
->
fh_export
->
ex_path
.
mnt
,
dentry
,
&
stat
);
err
=
fh_getattr
(
fhp
,
&
stat
);
if
(
!
err
)
{
*
p
++
=
xdr_one
;
/* attributes follow */
lease_get_mtime
(
dentry
->
d_inode
,
&
stat
.
mtime
);
...
...
@@ -254,13 +255,12 @@ encode_wcc_data(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp)
*/
void
fill_post_wcc
(
struct
svc_fh
*
fhp
)
{
int
err
;
__be32
err
;
if
(
fhp
->
fh_post_saved
)
printk
(
"nfsd: inode locked twice during operation.
\n
"
);
err
=
vfs_getattr
(
fhp
->
fh_export
->
ex_path
.
mnt
,
fhp
->
fh_dentry
,
&
fhp
->
fh_post_attr
);
err
=
fh_getattr
(
fhp
,
&
fhp
->
fh_post_attr
);
fhp
->
fh_post_change
=
fhp
->
fh_dentry
->
d_inode
->
i_version
;
if
(
err
)
{
fhp
->
fh_post_saved
=
0
;
...
...
fs/nfsd/nfs4xdr.c
浏览文件 @
3dadecce
...
...
@@ -1997,7 +1997,7 @@ static int get_parent_attributes(struct svc_export *exp, struct kstat *stat)
if
(
path
.
dentry
!=
path
.
mnt
->
mnt_root
)
break
;
}
err
=
vfs_getattr
(
path
.
mnt
,
path
.
dentry
,
stat
);
err
=
vfs_getattr
(
&
path
,
stat
);
path_put
(
&
path
);
return
err
;
}
...
...
@@ -2050,7 +2050,7 @@ nfsd4_encode_fattr(struct svc_fh *fhp, struct svc_export *exp,
goto
out
;
}
err
=
vfs_getattr
(
exp
->
ex_path
.
mnt
,
dentry
,
&
stat
);
err
=
vfs_getattr
(
&
path
,
&
stat
);
if
(
err
)
goto
out_nfserr
;
if
((
bmval0
&
(
FATTR4_WORD0_FILES_FREE
|
FATTR4_WORD0_FILES_TOTAL
|
...
...
fs/nfsd/nfsproc.c
浏览文件 @
3dadecce
...
...
@@ -26,17 +26,13 @@ static __be32
nfsd_return_attrs
(
__be32
err
,
struct
nfsd_attrstat
*
resp
)
{
if
(
err
)
return
err
;
return
nfserrno
(
vfs_getattr
(
resp
->
fh
.
fh_export
->
ex_path
.
mnt
,
resp
->
fh
.
fh_dentry
,
&
resp
->
stat
));
return
fh_getattr
(
&
resp
->
fh
,
&
resp
->
stat
);
}
static
__be32
nfsd_return_dirop
(
__be32
err
,
struct
nfsd_diropres
*
resp
)
{
if
(
err
)
return
err
;
return
nfserrno
(
vfs_getattr
(
resp
->
fh
.
fh_export
->
ex_path
.
mnt
,
resp
->
fh
.
fh_dentry
,
&
resp
->
stat
));
return
fh_getattr
(
&
resp
->
fh
,
&
resp
->
stat
);
}
/*
* Get a file's attributes
...
...
@@ -150,9 +146,7 @@ nfsd_proc_read(struct svc_rqst *rqstp, struct nfsd_readargs *argp,
&
resp
->
count
);
if
(
nfserr
)
return
nfserr
;
return
nfserrno
(
vfs_getattr
(
resp
->
fh
.
fh_export
->
ex_path
.
mnt
,
resp
->
fh
.
fh_dentry
,
&
resp
->
stat
));
return
fh_getattr
(
&
resp
->
fh
,
&
resp
->
stat
);
}
/*
...
...
fs/nfsd/nfsxdr.c
浏览文件 @
3dadecce
...
...
@@ -4,6 +4,7 @@
* Copyright (C) 1995, 1996 Olaf Kirch <okir@monad.swb.de>
*/
#include "vfs.h"
#include "xdr.h"
#include "auth.h"
...
...
@@ -197,7 +198,7 @@ encode_fattr(struct svc_rqst *rqstp, __be32 *p, struct svc_fh *fhp,
__be32
*
nfs2svc_encode_fattr
(
struct
svc_rqst
*
rqstp
,
__be32
*
p
,
struct
svc_fh
*
fhp
)
{
struct
kstat
stat
;
vfs_getattr
(
fhp
->
fh_export
->
ex_path
.
mnt
,
fhp
->
fh_dentry
,
&
stat
);
fh_getattr
(
fhp
,
&
stat
);
/* BUG */
return
encode_fattr
(
rqstp
,
p
,
fhp
,
&
stat
);
}
...
...
fs/nfsd/vfs.h
浏览文件 @
3dadecce
...
...
@@ -6,6 +6,7 @@
#define LINUX_NFSD_VFS_H
#include "nfsfh.h"
#include "nfsd.h"
/*
* Flags for nfsd_permission
...
...
@@ -125,4 +126,11 @@ static inline void fh_drop_write(struct svc_fh *fh)
}
}
static
inline
__be32
fh_getattr
(
struct
svc_fh
*
fh
,
struct
kstat
*
stat
)
{
struct
path
p
=
{.
mnt
=
fh
->
fh_export
->
ex_path
.
mnt
,
.
dentry
=
fh
->
fh_dentry
};
return
nfserrno
(
vfs_getattr
(
&
p
,
stat
));
}
#endif
/* LINUX_NFSD_VFS_H */
fs/stat.c
浏览文件 @
3dadecce
...
...
@@ -37,17 +37,17 @@ void generic_fillattr(struct inode *inode, struct kstat *stat)
EXPORT_SYMBOL
(
generic_fillattr
);
int
vfs_getattr
(
struct
vfsmount
*
mnt
,
struct
dentry
*
dentry
,
struct
kstat
*
stat
)
int
vfs_getattr
(
struct
path
*
path
,
struct
kstat
*
stat
)
{
struct
inode
*
inode
=
dentry
->
d_inode
;
struct
inode
*
inode
=
path
->
dentry
->
d_inode
;
int
retval
;
retval
=
security_inode_getattr
(
mnt
,
dentry
);
retval
=
security_inode_getattr
(
path
->
mnt
,
path
->
dentry
);
if
(
retval
)
return
retval
;
if
(
inode
->
i_op
->
getattr
)
return
inode
->
i_op
->
getattr
(
mnt
,
dentry
,
stat
);
return
inode
->
i_op
->
getattr
(
path
->
mnt
,
path
->
dentry
,
stat
);
generic_fillattr
(
inode
,
stat
);
return
0
;
...
...
@@ -61,8 +61,7 @@ int vfs_fstat(unsigned int fd, struct kstat *stat)
int
error
=
-
EBADF
;
if
(
f
.
file
)
{
error
=
vfs_getattr
(
f
.
file
->
f_path
.
mnt
,
f
.
file
->
f_path
.
dentry
,
stat
);
error
=
vfs_getattr
(
&
f
.
file
->
f_path
,
stat
);
fdput
(
f
);
}
return
error
;
...
...
@@ -89,7 +88,7 @@ int vfs_fstatat(int dfd, const char __user *filename, struct kstat *stat,
if
(
error
)
goto
out
;
error
=
vfs_getattr
(
path
.
mnt
,
path
.
dentry
,
stat
);
error
=
vfs_getattr
(
&
path
,
stat
);
path_put
(
&
path
);
if
(
retry_estale
(
error
,
lookup_flags
))
{
lookup_flags
|=
LOOKUP_REVAL
;
...
...
include/linux/fs.h
浏览文件 @
3dadecce
...
...
@@ -2468,7 +2468,7 @@ extern int page_symlink(struct inode *inode, const char *symname, int len);
extern
const
struct
inode_operations
page_symlink_inode_operations
;
extern
int
generic_readlink
(
struct
dentry
*
,
char
__user
*
,
int
);
extern
void
generic_fillattr
(
struct
inode
*
,
struct
kstat
*
);
extern
int
vfs_getattr
(
struct
vfsmount
*
,
struct
dentry
*
,
struct
kstat
*
);
extern
int
vfs_getattr
(
struct
path
*
,
struct
kstat
*
);
void
__inode_add_bytes
(
struct
inode
*
inode
,
loff_t
bytes
);
void
inode_add_bytes
(
struct
inode
*
inode
,
loff_t
bytes
);
void
inode_sub_bytes
(
struct
inode
*
inode
,
loff_t
bytes
);
...
...
kernel/module.c
浏览文件 @
3dadecce
...
...
@@ -2519,7 +2519,7 @@ static int copy_module_from_fd(int fd, struct load_info *info)
if
(
err
)
goto
out
;
err
=
vfs_getattr
(
file
->
f_vfsmnt
,
file
->
f_dentry
,
&
stat
);
err
=
vfs_getattr
(
&
file
->
f_path
,
&
stat
);
if
(
err
)
goto
out
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录