Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

+5 -16
+5 -16
arch/powerpc/platforms/cell/spufs/inode.c
··· 267 267 268 268 static int spufs_context_open(const struct path *path) 269 269 { 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); 286 275 } 287 276 288 277 static struct spu_context *