Lines Matching full:real

104 static int ovl_real_fdget_meta(const struct file *file, struct fd *real,  in ovl_real_fdget_meta()  argument
110 real->flags = 0; in ovl_real_fdget_meta()
111 real->file = file->private_data; in ovl_real_fdget_meta()
119 if (unlikely(file_inode(real->file) != d_inode(realpath.dentry))) { in ovl_real_fdget_meta()
120 real->flags = FDPUT_FPUT; in ovl_real_fdget_meta()
121 real->file = ovl_open_realfile(file, &realpath); in ovl_real_fdget_meta()
123 return PTR_ERR_OR_ZERO(real->file); in ovl_real_fdget_meta()
127 if (unlikely((file->f_flags ^ real->file->f_flags) & ~OVL_OPEN_FLAGS)) in ovl_real_fdget_meta()
128 return ovl_change_flags(real->file, file->f_flags); in ovl_real_fdget_meta()
133 static int ovl_real_fdget(const struct file *file, struct fd *real) in ovl_real_fdget() argument
136 real->flags = 0; in ovl_real_fdget()
137 real->file = ovl_dir_real_file(file, false); in ovl_real_fdget()
139 return PTR_ERR_OR_ZERO(real->file); in ovl_real_fdget()
142 return ovl_real_fdget_meta(file, real, false); in ovl_real_fdget()
179 struct fd real; in ovl_llseek() local
184 * The two special cases below do not need to involve real fs, in ovl_llseek()
195 ret = ovl_real_fdget(file, &real); in ovl_llseek()
201 * through copy up and modified on read/write, but only real in ovl_llseek()
202 * fs knows how to SEEK_HOLE/SEEK_DATA and real fs may impose in ovl_llseek()
204 * files, so we use the real file to perform seeks. in ovl_llseek()
207 real.file->f_pos = file->f_pos; in ovl_llseek()
210 ret = vfs_llseek(real.file, offset, whence); in ovl_llseek()
213 file->f_pos = real.file->f_pos; in ovl_llseek()
216 fdput(real); in ovl_llseek()
299 struct fd real; in ovl_read_iter() local
306 ret = ovl_real_fdget(file, &real); in ovl_read_iter()
312 !(real.file->f_mode & FMODE_CAN_ODIRECT)) in ovl_read_iter()
317 ret = vfs_iter_read(real.file, iter, &iocb->ki_pos, in ovl_read_iter()
327 aio_req->fd = real; in ovl_read_iter()
328 real.flags = 0; in ovl_read_iter()
330 kiocb_clone(&aio_req->iocb, iocb, real.file); in ovl_read_iter()
333 ret = vfs_iocb_iter_read(real.file, &aio_req->iocb, iter); in ovl_read_iter()
342 fdput(real); in ovl_read_iter()
351 struct fd real; in ovl_write_iter() local
366 ret = ovl_real_fdget(file, &real); in ovl_write_iter()
372 !(real.file->f_mode & FMODE_CAN_ODIRECT)) in ovl_write_iter()
380 file_start_write(real.file); in ovl_write_iter()
381 ret = vfs_iter_write(real.file, iter, &iocb->ki_pos, in ovl_write_iter()
383 file_end_write(real.file); in ovl_write_iter()
394 file_start_write(real.file); in ovl_write_iter()
396 __sb_writers_release(file_inode(real.file)->i_sb, in ovl_write_iter()
398 aio_req->fd = real; in ovl_write_iter()
399 real.flags = 0; in ovl_write_iter()
401 kiocb_clone(&aio_req->iocb, iocb, real.file); in ovl_write_iter()
405 ret = vfs_iocb_iter_write(real.file, &aio_req->iocb, iter); in ovl_write_iter()
413 fdput(real); in ovl_write_iter()
424 * and file_start_write(real.file) in ovl_write_iter().
427 * the real file.
432 struct fd real; in ovl_splice_write() local
444 ret = ovl_real_fdget(out, &real); in ovl_splice_write()
449 file_start_write(real.file); in ovl_splice_write()
451 ret = iter_file_splice_write(pipe, real.file, ppos, len, flags); in ovl_splice_write()
453 file_end_write(real.file); in ovl_splice_write()
457 fdput(real); in ovl_splice_write()
467 struct fd real; in ovl_fsync() local
475 ret = ovl_real_fdget_meta(file, &real, !datasync); in ovl_fsync()
480 if (file_inode(real.file) == ovl_inode_upper(file_inode(file))) { in ovl_fsync()
482 ret = vfs_fsync_range(real.file, start, end, datasync); in ovl_fsync()
486 fdput(real); in ovl_fsync()
516 struct fd real; in ovl_fallocate() local
520 ret = ovl_real_fdget(file, &real); in ovl_fallocate()
525 ret = vfs_fallocate(real.file, mode, offset, len); in ovl_fallocate()
531 fdput(real); in ovl_fallocate()
538 struct fd real; in ovl_fadvise() local
542 ret = ovl_real_fdget(file, &real); in ovl_fadvise()
547 ret = vfs_fadvise(real.file, offset, len, advice); in ovl_fadvise()
550 fdput(real); in ovl_fadvise()
646 struct fd real; in ovl_flush() local
650 err = ovl_real_fdget(file, &real); in ovl_flush()
654 if (real.file->f_op->flush) { in ovl_flush()
656 err = real.file->f_op->flush(real.file, id); in ovl_flush()
659 fdput(real); in ovl_flush()