Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
raspberrypi-kernel
提交
cd3758e3
R
raspberrypi-kernel
项目概览
openeuler
/
raspberrypi-kernel
通知
13
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
raspberrypi-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
cd3758e3
编写于
8月 10, 2007
作者:
T
Trond Myklebust
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
NFS: Replace file->private_data with calls to nfs_file_open_context()
Signed-off-by:
N
Trond Myklebust
<
Trond.Myklebust@netapp.com
>
上级
c03025d5
变更
10
隐藏空白更改
内联
并排
Showing
10 changed file
with
21 addition
and
27 deletion
+21
-27
fs/nfs/delegation.c
fs/nfs/delegation.c
+1
-1
fs/nfs/dir.c
fs/nfs/dir.c
+2
-2
fs/nfs/direct.c
fs/nfs/direct.c
+2
-2
fs/nfs/file.c
fs/nfs/file.c
+4
-4
fs/nfs/inode.c
fs/nfs/inode.c
+1
-1
fs/nfs/nfs4proc.c
fs/nfs/nfs4proc.c
+4
-4
fs/nfs/nfs4state.c
fs/nfs/nfs4state.c
+1
-1
fs/nfs/read.c
fs/nfs/read.c
+2
-4
fs/nfs/write.c
fs/nfs/write.c
+2
-2
include/linux/nfs_fs.h
include/linux/nfs_fs.h
+2
-6
未找到文件。
fs/nfs/delegation.c
浏览文件 @
cd3758e3
...
...
@@ -52,7 +52,7 @@ static int nfs_delegation_claim_locks(struct nfs_open_context *ctx, struct nfs4_
for
(
fl
=
inode
->
i_flock
;
fl
!=
0
;
fl
=
fl
->
fl_next
)
{
if
(
!
(
fl
->
fl_flags
&
(
FL_POSIX
|
FL_FLOCK
)))
continue
;
if
(
(
struct
nfs_open_context
*
)
fl
->
fl_file
->
private_data
!=
ctx
)
if
(
nfs_file_open_context
(
fl
->
fl_file
)
!=
ctx
)
continue
;
status
=
nfs4_lock_delegation_recall
(
state
,
fl
);
if
(
status
>=
0
)
...
...
fs/nfs/dir.c
浏览文件 @
cd3758e3
...
...
@@ -558,7 +558,7 @@ static int nfs_readdir(struct file *filp, void *dirent, filldir_t filldir)
memset
(
desc
,
0
,
sizeof
(
*
desc
));
desc
->
file
=
filp
;
desc
->
dir_cookie
=
&
((
struct
nfs_open_context
*
)
filp
->
private_data
)
->
dir_cookie
;
desc
->
dir_cookie
=
&
nfs_file_open_context
(
filp
)
->
dir_cookie
;
desc
->
decode
=
NFS_PROTO
(
inode
)
->
decode_dirent
;
desc
->
plus
=
NFS_USE_READDIRPLUS
(
inode
);
...
...
@@ -623,7 +623,7 @@ static loff_t nfs_llseek_dir(struct file *filp, loff_t offset, int origin)
}
if
(
offset
!=
filp
->
f_pos
)
{
filp
->
f_pos
=
offset
;
((
struct
nfs_open_context
*
)
filp
->
private_data
)
->
dir_cookie
=
0
;
nfs_file_open_context
(
filp
)
->
dir_cookie
=
0
;
}
out:
mutex_unlock
(
&
filp
->
f_path
.
dentry
->
d_inode
->
i_mutex
);
...
...
fs/nfs/direct.c
浏览文件 @
cd3758e3
...
...
@@ -368,7 +368,7 @@ static ssize_t nfs_direct_read(struct kiocb *iocb, unsigned long user_addr, size
return
-
ENOMEM
;
dreq
->
inode
=
inode
;
dreq
->
ctx
=
get_nfs_open_context
(
(
struct
nfs_open_context
*
)
iocb
->
ki_filp
->
private_data
);
dreq
->
ctx
=
get_nfs_open_context
(
nfs_file_open_context
(
iocb
->
ki_filp
)
);
if
(
!
is_sync_kiocb
(
iocb
))
dreq
->
iocb
=
iocb
;
...
...
@@ -718,7 +718,7 @@ static ssize_t nfs_direct_write(struct kiocb *iocb, unsigned long user_addr, siz
sync
=
FLUSH_STABLE
;
dreq
->
inode
=
inode
;
dreq
->
ctx
=
get_nfs_open_context
(
(
struct
nfs_open_context
*
)
iocb
->
ki_filp
->
private_data
);
dreq
->
ctx
=
get_nfs_open_context
(
nfs_file_open_context
(
iocb
->
ki_filp
)
);
if
(
!
is_sync_kiocb
(
iocb
))
dreq
->
iocb
=
iocb
;
...
...
fs/nfs/file.c
浏览文件 @
cd3758e3
...
...
@@ -208,7 +208,7 @@ static int nfs_do_fsync(struct nfs_open_context *ctx, struct inode *inode)
static
int
nfs_file_flush
(
struct
file
*
file
,
fl_owner_t
id
)
{
struct
nfs_open_context
*
ctx
=
(
struct
nfs_open_context
*
)
file
->
private_data
;
struct
nfs_open_context
*
ctx
=
nfs_file_open_context
(
file
)
;
struct
inode
*
inode
=
file
->
f_path
.
dentry
->
d_inode
;
int
status
;
...
...
@@ -296,7 +296,7 @@ nfs_file_mmap(struct file * file, struct vm_area_struct * vma)
static
int
nfs_fsync
(
struct
file
*
file
,
struct
dentry
*
dentry
,
int
datasync
)
{
struct
nfs_open_context
*
ctx
=
(
struct
nfs_open_context
*
)
file
->
private_data
;
struct
nfs_open_context
*
ctx
=
nfs_file_open_context
(
file
)
;
struct
inode
*
inode
=
dentry
->
d_inode
;
dfprintk
(
VFS
,
"nfs: fsync(%s/%ld)
\n
"
,
inode
->
i_sb
->
s_id
,
inode
->
i_ino
);
...
...
@@ -395,7 +395,7 @@ static int nfs_need_sync_write(struct file *filp, struct inode *inode)
if
(
IS_SYNC
(
inode
)
||
(
filp
->
f_flags
&
O_SYNC
))
return
1
;
ctx
=
filp
->
private_data
;
ctx
=
nfs_file_open_context
(
filp
)
;
if
(
test_bit
(
NFS_CONTEXT_ERROR_WRITE
,
&
ctx
->
flags
))
return
1
;
return
0
;
...
...
@@ -438,7 +438,7 @@ static ssize_t nfs_file_write(struct kiocb *iocb, const struct iovec *iov,
result
=
generic_file_aio_write
(
iocb
,
iov
,
nr_segs
,
pos
);
/* Return error values for O_SYNC and IS_SYNC() */
if
(
result
>=
0
&&
nfs_need_sync_write
(
iocb
->
ki_filp
,
inode
))
{
int
err
=
nfs_do_fsync
(
iocb
->
ki_filp
->
private_data
,
inode
);
int
err
=
nfs_do_fsync
(
nfs_file_open_context
(
iocb
->
ki_filp
)
,
inode
);
if
(
err
<
0
)
result
=
err
;
}
...
...
fs/nfs/inode.c
浏览文件 @
cd3758e3
...
...
@@ -538,7 +538,7 @@ struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_c
static
void
nfs_file_clear_open_context
(
struct
file
*
filp
)
{
struct
inode
*
inode
=
filp
->
f_path
.
dentry
->
d_inode
;
struct
nfs_open_context
*
ctx
=
(
struct
nfs_open_context
*
)
filp
->
private_data
;
struct
nfs_open_context
*
ctx
=
nfs_file_open_context
(
filp
)
;
if
(
ctx
)
{
filp
->
private_data
=
NULL
;
...
...
fs/nfs/nfs4proc.c
浏览文件 @
cd3758e3
...
...
@@ -1390,7 +1390,7 @@ static int nfs4_intent_set_file(struct nameidata *nd, struct path *path, struct
filp
=
lookup_instantiate_filp
(
nd
,
path
->
dentry
,
NULL
);
if
(
!
IS_ERR
(
filp
))
{
struct
nfs_open_context
*
ctx
;
ctx
=
(
struct
nfs_open_context
*
)
filp
->
private_data
;
ctx
=
nfs_file_open_context
(
filp
)
;
ctx
->
state
=
state
;
return
0
;
}
...
...
@@ -3303,7 +3303,7 @@ static int nfs4_proc_unlck(struct nfs4_state *state, int cmd, struct file_lock *
status
=
-
ENOMEM
;
if
(
seqid
==
NULL
)
goto
out
;
task
=
nfs4_do_unlck
(
request
,
request
->
fl_file
->
private_data
,
lsp
,
seqid
);
task
=
nfs4_do_unlck
(
request
,
nfs_file_open_context
(
request
->
fl_file
)
,
lsp
,
seqid
);
status
=
PTR_ERR
(
task
);
if
(
IS_ERR
(
task
))
goto
out
;
...
...
@@ -3447,7 +3447,7 @@ static int _nfs4_do_setlk(struct nfs4_state *state, int cmd, struct file_lock *f
int
ret
;
dprintk
(
"%s: begin!
\n
"
,
__FUNCTION__
);
data
=
nfs4_alloc_lockdata
(
fl
,
fl
->
fl_file
->
private_data
,
data
=
nfs4_alloc_lockdata
(
fl
,
nfs_file_open_context
(
fl
->
fl_file
)
,
fl
->
fl_u
.
nfs4_fl
.
owner
);
if
(
data
==
NULL
)
return
-
ENOMEM
;
...
...
@@ -3573,7 +3573,7 @@ nfs4_proc_lock(struct file *filp, int cmd, struct file_lock *request)
int
status
;
/* verify open state */
ctx
=
(
struct
nfs_open_context
*
)
filp
->
private_data
;
ctx
=
nfs_file_open_context
(
filp
)
;
state
=
ctx
->
state
;
if
(
request
->
fl_start
<
0
||
request
->
fl_end
<
0
)
...
...
fs/nfs/nfs4state.c
浏览文件 @
cd3758e3
...
...
@@ -774,7 +774,7 @@ static int nfs4_reclaim_locks(struct nfs4_state_recovery_ops *ops, struct nfs4_s
for
(
fl
=
inode
->
i_flock
;
fl
!=
0
;
fl
=
fl
->
fl_next
)
{
if
(
!
(
fl
->
fl_flags
&
(
FL_POSIX
|
FL_FLOCK
)))
continue
;
if
(
((
struct
nfs_open_context
*
)
fl
->
fl_file
->
private_data
)
->
state
!=
state
)
if
(
nfs_file_open_context
(
fl
->
fl_file
)
->
state
!=
state
)
continue
;
status
=
ops
->
recover_lock
(
state
,
fl
);
if
(
status
>=
0
)
...
...
fs/nfs/read.c
浏览文件 @
cd3758e3
...
...
@@ -497,8 +497,7 @@ int nfs_readpage(struct file *file, struct page *page)
if
(
ctx
==
NULL
)
goto
out_unlock
;
}
else
ctx
=
get_nfs_open_context
((
struct
nfs_open_context
*
)
file
->
private_data
);
ctx
=
get_nfs_open_context
(
nfs_file_open_context
(
file
));
error
=
nfs_readpage_async
(
ctx
,
inode
,
page
);
...
...
@@ -576,8 +575,7 @@ int nfs_readpages(struct file *filp, struct address_space *mapping,
if
(
desc
.
ctx
==
NULL
)
return
-
EBADF
;
}
else
desc
.
ctx
=
get_nfs_open_context
((
struct
nfs_open_context
*
)
filp
->
private_data
);
desc
.
ctx
=
get_nfs_open_context
(
nfs_file_open_context
(
filp
));
if
(
rsize
<
PAGE_CACHE_SIZE
)
nfs_pageio_init
(
&
pgio
,
inode
,
nfs_pagein_multi
,
rsize
,
0
);
else
...
...
fs/nfs/write.c
浏览文件 @
cd3758e3
...
...
@@ -667,7 +667,7 @@ static struct nfs_page * nfs_update_request(struct nfs_open_context* ctx,
int
nfs_flush_incompatible
(
struct
file
*
file
,
struct
page
*
page
)
{
struct
nfs_open_context
*
ctx
=
(
struct
nfs_open_context
*
)
file
->
private_data
;
struct
nfs_open_context
*
ctx
=
nfs_file_open_context
(
file
)
;
struct
nfs_page
*
req
;
int
do_flush
,
status
;
/*
...
...
@@ -701,7 +701,7 @@ int nfs_flush_incompatible(struct file *file, struct page *page)
int
nfs_updatepage
(
struct
file
*
file
,
struct
page
*
page
,
unsigned
int
offset
,
unsigned
int
count
)
{
struct
nfs_open_context
*
ctx
=
(
struct
nfs_open_context
*
)
file
->
private_data
;
struct
nfs_open_context
*
ctx
=
nfs_file_open_context
(
file
)
;
struct
inode
*
inode
=
page
->
mapping
->
host
;
int
status
=
0
;
...
...
include/linux/nfs_fs.h
浏览文件 @
cd3758e3
...
...
@@ -338,12 +338,8 @@ static inline struct nfs_open_context *nfs_file_open_context(struct file *filp)
static
inline
struct
rpc_cred
*
nfs_file_cred
(
struct
file
*
file
)
{
if
(
file
!=
NULL
)
{
struct
nfs_open_context
*
ctx
;
ctx
=
(
struct
nfs_open_context
*
)
file
->
private_data
;
return
ctx
->
cred
;
}
if
(
file
!=
NULL
)
return
nfs_file_open_context
(
file
)
->
cred
;
return
NULL
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录