Skip to content

Commit 843e7b5

Browse files
committed
spufs: convert spufs_context_open() to FD_PREPARE()
Link: https://patch.msgid.link/20251123-work-fd-prepare-v4-32-b6efa1706cfd@kernel.org Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent 4667d63 commit 843e7b5

1 file changed

Lines changed: 5 additions & 16 deletions

File tree

  • arch/powerpc/platforms/cell/spufs

arch/powerpc/platforms/cell/spufs/inode.c

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -267,22 +267,11 @@ spufs_mkdir(struct inode *dir, struct dentry *dentry, unsigned int flags,
267267

268268
static int spufs_context_open(const struct path *path)
269269
{
270-
int ret;
271-
struct file *filp;
272-
273-
ret = get_unused_fd_flags(0);
274-
if (ret < 0)
275-
return ret;
276-
277-
filp = dentry_open(path, O_RDONLY, current_cred());
278-
if (IS_ERR(filp)) {
279-
put_unused_fd(ret);
280-
return PTR_ERR(filp);
281-
}
282-
283-
filp->f_op = &spufs_context_fops;
284-
fd_install(ret, filp);
285-
return ret;
270+
FD_PREPARE(fdf, 0, dentry_open(path, O_RDONLY, current_cred()));
271+
if (fdf.err)
272+
return fdf.err;
273+
fd_prepare_file(fdf)->f_op = &spufs_context_fops;
274+
return fd_publish(fdf);
286275
}
287276

288277
static struct spu_context *

0 commit comments

Comments
 (0)