mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
pseries: convert papr_platform_dump_create_handle() to FD_ADD()
Link: https://patch.msgid.link/20251123-work-fd-prepare-v4-35-b6efa1706cfd@kernel.org Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
@@ -303,8 +303,6 @@ static long papr_platform_dump_create_handle(u64 dump_tag)
|
||||
{
|
||||
struct ibm_platform_dump_params *params;
|
||||
u64 param_dump_tag;
|
||||
struct file *file;
|
||||
long err;
|
||||
int fd;
|
||||
|
||||
/*
|
||||
@@ -334,34 +332,22 @@ static long papr_platform_dump_create_handle(u64 dump_tag)
|
||||
params->dump_tag_lo = (u32)(dump_tag & 0x00000000ffffffffULL);
|
||||
params->status = RTAS_IBM_PLATFORM_DUMP_START;
|
||||
|
||||
fd = get_unused_fd_flags(O_RDONLY | O_CLOEXEC);
|
||||
fd = FD_ADD(O_RDONLY | O_CLOEXEC,
|
||||
anon_inode_getfile_fmode("[papr-platform-dump]",
|
||||
&papr_platform_dump_handle_ops,
|
||||
(void *)params, O_RDONLY,
|
||||
FMODE_LSEEK | FMODE_PREAD));
|
||||
if (fd < 0) {
|
||||
err = fd;
|
||||
goto free_area;
|
||||
rtas_work_area_free(params->work_area);
|
||||
kfree(params);
|
||||
return fd;
|
||||
}
|
||||
|
||||
file = anon_inode_getfile_fmode("[papr-platform-dump]",
|
||||
&papr_platform_dump_handle_ops,
|
||||
(void *)params, O_RDONLY,
|
||||
FMODE_LSEEK | FMODE_PREAD);
|
||||
if (IS_ERR(file)) {
|
||||
err = PTR_ERR(file);
|
||||
goto put_fd;
|
||||
}
|
||||
|
||||
fd_install(fd, file);
|
||||
|
||||
list_add(¶ms->list, &platform_dump_list);
|
||||
|
||||
pr_info("%s (%d) initiated platform dump for dump tag %llu\n",
|
||||
current->comm, current->pid, dump_tag);
|
||||
return fd;
|
||||
put_fd:
|
||||
put_unused_fd(fd);
|
||||
free_area:
|
||||
rtas_work_area_free(params->work_area);
|
||||
kfree(params);
|
||||
return err;
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user