Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
cb0942b8
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看板
提交
cb0942b8
编写于
8月 27, 2012
作者:
A
Al Viro
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
make get_file() return its argument
simplifies a bunch of callers... Signed-off-by:
N
Al Viro
<
viro@zeniv.linux.org.uk
>
上级
cecb46f1
变更
16
隐藏空白更改
内联
并排
Showing
16 changed file
with
23 addition
and
38 deletion
+23
-38
arch/ia64/kernel/perfmon.c
arch/ia64/kernel/perfmon.c
+1
-3
drivers/base/dma-buf.c
drivers/base/dma-buf.c
+1
-2
drivers/staging/omapdrm/omap_gem.c
drivers/staging/omapdrm/omap_gem.c
+1
-2
drivers/tty/tty_io.c
drivers/tty/tty_io.c
+3
-6
fs/autofs4/waitq.c
fs/autofs4/waitq.c
+1
-2
fs/fuse/dev.c
fs/fuse/dev.c
+1
-2
fs/nfsd/nfs4state.c
fs/nfsd/nfs4state.c
+1
-2
fs/proc/base.c
fs/proc/base.c
+1
-2
fs/select.c
fs/select.c
+1
-2
include/linux/fs.h
include/linux/fs.h
+5
-1
mm/fremap.c
mm/fremap.c
+1
-2
mm/mmap.c
mm/mmap.c
+1
-2
mm/nommu.c
mm/nommu.c
+2
-4
net/compat.c
net/compat.c
+1
-2
net/core/scm.c
net/core/scm.c
+1
-2
security/selinux/hooks.c
security/selinux/hooks.c
+1
-2
未找到文件。
arch/ia64/kernel/perfmon.c
浏览文件 @
cb0942b8
...
...
@@ -2306,7 +2306,7 @@ pfm_smpl_buffer_alloc(struct task_struct *task, struct file *filp, pfm_context_t
* partially initialize the vma for the sampling buffer
*/
vma
->
vm_mm
=
mm
;
vma
->
vm_file
=
filp
;
vma
->
vm_file
=
get_file
(
filp
)
;
vma
->
vm_flags
=
VM_READ
|
VM_MAYREAD
|
VM_RESERVED
;
vma
->
vm_page_prot
=
PAGE_READONLY
;
/* XXX may need to change */
...
...
@@ -2345,8 +2345,6 @@ pfm_smpl_buffer_alloc(struct task_struct *task, struct file *filp, pfm_context_t
goto
error
;
}
get_file
(
filp
);
/*
* now insert the vma in the vm list for the process, must be
* done with mmap lock held
...
...
drivers/base/dma-buf.c
浏览文件 @
cb0942b8
...
...
@@ -460,8 +460,7 @@ int dma_buf_mmap(struct dma_buf *dmabuf, struct vm_area_struct *vma,
if
(
vma
->
vm_file
)
fput
(
vma
->
vm_file
);
vma
->
vm_file
=
dmabuf
->
file
;
get_file
(
vma
->
vm_file
);
vma
->
vm_file
=
get_file
(
dmabuf
->
file
);
vma
->
vm_pgoff
=
pgoff
;
...
...
drivers/staging/omapdrm/omap_gem.c
浏览文件 @
cb0942b8
...
...
@@ -566,9 +566,8 @@ int omap_gem_mmap_obj(struct drm_gem_object *obj,
* in particular in the case of mmap'd dmabufs)
*/
fput
(
vma
->
vm_file
);
get_file
(
obj
->
filp
);
vma
->
vm_pgoff
=
0
;
vma
->
vm_file
=
obj
->
filp
;
vma
->
vm_file
=
get_file
(
obj
->
filp
)
;
vma
->
vm_page_prot
=
vm_get_page_prot
(
vma
->
vm_flags
);
}
...
...
drivers/tty/tty_io.c
浏览文件 @
cb0942b8
...
...
@@ -1163,10 +1163,8 @@ ssize_t redirected_tty_write(struct file *file, const char __user *buf,
struct
file
*
p
=
NULL
;
spin_lock
(
&
redirect_lock
);
if
(
redirect
)
{
get_file
(
redirect
);
p
=
redirect
;
}
if
(
redirect
)
p
=
get_file
(
redirect
);
spin_unlock
(
&
redirect_lock
);
if
(
p
)
{
...
...
@@ -2246,8 +2244,7 @@ static int tioccons(struct file *file)
spin_unlock
(
&
redirect_lock
);
return
-
EBUSY
;
}
get_file
(
file
);
redirect
=
file
;
redirect
=
get_file
(
file
);
spin_unlock
(
&
redirect_lock
);
return
0
;
}
...
...
fs/autofs4/waitq.c
浏览文件 @
cb0942b8
...
...
@@ -175,8 +175,7 @@ static void autofs4_notify_daemon(struct autofs_sb_info *sbi,
return
;
}
pipe
=
sbi
->
pipe
;
get_file
(
pipe
);
pipe
=
get_file
(
sbi
->
pipe
);
mutex_unlock
(
&
sbi
->
wq_mutex
);
...
...
fs/fuse/dev.c
浏览文件 @
cb0942b8
...
...
@@ -148,8 +148,7 @@ static struct fuse_req *get_reserved_req(struct fuse_conn *fc,
if
(
ff
->
reserved_req
)
{
req
=
ff
->
reserved_req
;
ff
->
reserved_req
=
NULL
;
get_file
(
file
);
req
->
stolen_file
=
file
;
req
->
stolen_file
=
get_file
(
file
);
}
spin_unlock
(
&
fc
->
lock
);
}
while
(
!
req
);
...
...
fs/nfsd/nfs4state.c
浏览文件 @
cb0942b8
...
...
@@ -2837,8 +2837,7 @@ static int nfs4_setlease(struct nfs4_delegation *dp, int flag)
return
-
ENOMEM
;
}
fp
->
fi_lease
=
fl
;
fp
->
fi_deleg_file
=
fl
->
fl_file
;
get_file
(
fp
->
fi_deleg_file
);
fp
->
fi_deleg_file
=
get_file
(
fl
->
fl_file
);
atomic_set
(
&
fp
->
fi_delegees
,
1
);
list_add
(
&
dp
->
dl_perfile
,
&
fp
->
fi_delegations
);
return
0
;
...
...
fs/proc/base.c
浏览文件 @
cb0942b8
...
...
@@ -1979,8 +1979,7 @@ proc_map_files_readdir(struct file *filp, void *dirent, filldir_t filldir)
if
(
++
pos
<=
filp
->
f_pos
)
continue
;
get_file
(
vma
->
vm_file
);
info
.
file
=
vma
->
vm_file
;
info
.
file
=
get_file
(
vma
->
vm_file
);
info
.
len
=
snprintf
(
info
.
name
,
sizeof
(
info
.
name
),
"%lx-%lx"
,
vma
->
vm_start
,
vma
->
vm_end
);
...
...
fs/select.c
浏览文件 @
cb0942b8
...
...
@@ -220,8 +220,7 @@ static void __pollwait(struct file *filp, wait_queue_head_t *wait_address,
struct
poll_table_entry
*
entry
=
poll_get_entry
(
pwq
);
if
(
!
entry
)
return
;
get_file
(
filp
);
entry
->
filp
=
filp
;
entry
->
filp
=
get_file
(
filp
);
entry
->
wait_address
=
wait_address
;
entry
->
key
=
p
->
_key
;
init_waitqueue_func_entry
(
&
entry
->
wait
,
pollwake
);
...
...
include/linux/fs.h
浏览文件 @
cb0942b8
...
...
@@ -1074,7 +1074,11 @@ struct file_handle {
unsigned
char
f_handle
[
0
];
};
#define get_file(x) atomic_long_inc(&(x)->f_count)
static
inline
struct
file
*
get_file
(
struct
file
*
f
)
{
atomic_long_inc
(
&
f
->
f_count
);
return
f
;
}
#define fput_atomic(x) atomic_long_add_unless(&(x)->f_count, -1, 1)
#define file_count(x) atomic_long_read(&(x)->f_count)
...
...
mm/fremap.c
浏览文件 @
cb0942b8
...
...
@@ -195,10 +195,9 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
*/
if
(
mapping_cap_account_dirty
(
mapping
))
{
unsigned
long
addr
;
struct
file
*
file
=
vma
->
vm_file
;
struct
file
*
file
=
get_file
(
vma
->
vm_file
)
;
flags
&=
MAP_NONBLOCK
;
get_file
(
file
);
addr
=
mmap_region
(
file
,
start
,
size
,
flags
,
vma
->
vm_flags
,
pgoff
);
fput
(
file
);
...
...
mm/mmap.c
浏览文件 @
cb0942b8
...
...
@@ -1301,8 +1301,7 @@ unsigned long mmap_region(struct file *file, unsigned long addr,
goto
free_vma
;
correct_wcount
=
1
;
}
vma
->
vm_file
=
file
;
get_file
(
file
);
vma
->
vm_file
=
get_file
(
file
);
error
=
file
->
f_op
->
mmap
(
file
,
vma
);
if
(
error
)
goto
unmap_and_free_vma
;
...
...
mm/nommu.c
浏览文件 @
cb0942b8
...
...
@@ -1282,10 +1282,8 @@ unsigned long do_mmap_pgoff(struct file *file,
vma
->
vm_pgoff
=
pgoff
;
if
(
file
)
{
region
->
vm_file
=
file
;
get_file
(
file
);
vma
->
vm_file
=
file
;
get_file
(
file
);
region
->
vm_file
=
get_file
(
file
);
vma
->
vm_file
=
get_file
(
file
);
if
(
vm_flags
&
VM_EXECUTABLE
)
{
added_exe_file_vma
(
current
->
mm
);
vma
->
vm_mm
=
current
->
mm
;
...
...
net/compat.c
浏览文件 @
cb0942b8
...
...
@@ -301,8 +301,7 @@ void scm_detach_fds_compat(struct msghdr *kmsg, struct scm_cookie *scm)
break
;
}
/* Bump the usage count and install the file. */
get_file
(
fp
[
i
]);
fd_install
(
new_fd
,
fp
[
i
]);
fd_install
(
new_fd
,
get_file
(
fp
[
i
]));
}
if
(
i
>
0
)
{
...
...
net/core/scm.c
浏览文件 @
cb0942b8
...
...
@@ -281,11 +281,10 @@ void scm_detach_fds(struct msghdr *msg, struct scm_cookie *scm)
break
;
}
/* Bump the usage count and install the file. */
get_file
(
fp
[
i
]);
sock
=
sock_from_file
(
fp
[
i
],
&
err
);
if
(
sock
)
sock_update_netprioidx
(
sock
->
sk
,
current
);
fd_install
(
new_fd
,
fp
[
i
]
);
fd_install
(
new_fd
,
get_file
(
fp
[
i
])
);
}
if
(
i
>
0
)
...
...
security/selinux/hooks.c
浏览文件 @
cb0942b8
...
...
@@ -2135,8 +2135,7 @@ static inline void flush_unauthorized_files(const struct cred *cred,
if
(
!
IS_ERR
(
devnull
))
{
/* replace all the matching ones with this */
do
{
get_file
(
devnull
);
replace_fd
(
n
-
1
,
devnull
,
0
);
replace_fd
(
n
-
1
,
get_file
(
devnull
),
0
);
}
while
((
n
=
iterate_fd
(
files
,
n
,
match_file
,
cred
))
!=
0
);
fput
(
devnull
);
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录