Lines Matching +full:lower +full:- +full:case
1 // SPDX-License-Identifier: GPL-2.0-or-later
5 * Copyright (C) 1997-2004 Erez Zadok
6 * Copyright (C) 2001-2004 Stony Brook University
7 * Copyright (C) 2004-2007 International Business Machines Corp.
26 * doesn't give us a chance to update the atime of the lower layer
28 * updates the atime of the lower level inode if generic_file_read
37 struct file *file = iocb->ki_filp; in ecryptfs_read_update_atime()
41 path = ecryptfs_dentry_to_lower_path(file->f_path.dentry); in ecryptfs_read_update_atime()
51 * doesn't give us a chance to update the atime of the lower layer inode. This
53 * lower level inode if generic_file_read returns without any errors. This is
66 path = ecryptfs_dentry_to_lower_path(in->f_path.dentry); in ecryptfs_splice_read_update_atime()
92 buf->filldir_called++; in ecryptfs_filldir()
94 buf->sb, lower_name, in ecryptfs_filldir()
97 if (err != -EINVAL) { in ecryptfs_filldir()
104 /* Mask -EINVAL errors as these are most likely due a plaintext in ecryptfs_filldir()
105 * filename present in the lower filesystem despite filename in ecryptfs_filldir()
113 buf->caller->pos = buf->ctx.pos; in ecryptfs_filldir()
114 res = dir_emit(buf->caller, name, name_size, ino, d_type); in ecryptfs_filldir()
117 buf->entries_written++; in ecryptfs_filldir()
134 .sb = inode->i_sb, in ecryptfs_readdir()
138 ctx->pos = buf.ctx.pos; in ecryptfs_readdir()
153 crypt_stat = &ecryptfs_inode_to_private(inode)->crypt_stat; in read_or_initialize_metadata()
155 inode->i_sb)->mount_crypt_stat; in read_or_initialize_metadata()
156 mutex_lock(&crypt_stat->cs_mutex); in read_or_initialize_metadata()
158 if (crypt_stat->flags & ECRYPTFS_POLICY_APPLIED && in read_or_initialize_metadata()
159 crypt_stat->flags & ECRYPTFS_KEY_VALID) { in read_or_initialize_metadata()
168 if (mount_crypt_stat->flags & ECRYPTFS_PLAINTEXT_PASSTHROUGH_ENABLED) { in read_or_initialize_metadata()
169 crypt_stat->flags &= ~(ECRYPTFS_I_SIZE_INITIALIZED in read_or_initialize_metadata()
175 if (!(mount_crypt_stat->flags & ECRYPTFS_XATTR_METADATA_ENABLED) && in read_or_initialize_metadata()
182 rc = -EIO; in read_or_initialize_metadata()
184 mutex_unlock(&crypt_stat->cs_mutex); in read_or_initialize_metadata()
196 if (!lower_file->f_op->mmap) in ecryptfs_mmap()
197 return -ENODEV; in ecryptfs_mmap()
208 * Returns zero on success; non-zero otherwise
214 struct dentry *ecryptfs_dentry = file->f_path.dentry; in ecryptfs_open()
225 rc = -ENOMEM; in ecryptfs_open()
228 crypt_stat = &ecryptfs_inode_to_private(inode)->crypt_stat; in ecryptfs_open()
229 mutex_lock(&crypt_stat->cs_mutex); in ecryptfs_open()
230 if (!(crypt_stat->flags & ECRYPTFS_POLICY_APPLIED)) { in ecryptfs_open()
233 crypt_stat->flags |= (ECRYPTFS_POLICY_APPLIED in ecryptfs_open()
236 mutex_unlock(&crypt_stat->cs_mutex); in ecryptfs_open()
240 "the lower file for the dentry with name " in ecryptfs_open()
245 if ((ecryptfs_inode_to_private(inode)->lower_file->f_flags & O_ACCMODE) in ecryptfs_open()
246 == O_RDONLY && (file->f_flags & O_ACCMODE) != O_RDONLY) { in ecryptfs_open()
247 rc = -EPERM; in ecryptfs_open()
248 printk(KERN_WARNING "%s: Lower file is RO; eCryptfs " in ecryptfs_open()
253 file, ecryptfs_inode_to_private(inode)->lower_file); in ecryptfs_open()
258 "[0x%.16lx] size: [0x%.16llx]\n", inode, inode->i_ino, in ecryptfs_open()
277 * Returns zero on success; non-zero otherwise
281 struct dentry *ecryptfs_dentry = file->f_path.dentry; in ecryptfs_dir_open()
293 return -ENOMEM; in ecryptfs_dir_open()
296 file->f_flags, current_cred()); in ecryptfs_dir_open()
299 "the lower file for the dentry with name " in ecryptfs_dir_open()
313 if (lower_file->f_op->flush) { in ecryptfs_flush()
314 filemap_write_and_wait(file->f_mapping); in ecryptfs_flush()
315 return lower_file->f_op->flush(lower_file, td); in ecryptfs_flush()
360 if (lower_file->f_op->fasync) in ecryptfs_fasync()
361 rc = lower_file->f_op->fasync(fd, lower_file, flag); in ecryptfs_fasync()
369 long rc = -ENOTTY; in ecryptfs_unlocked_ioctl()
371 if (!lower_file->f_op->unlocked_ioctl) in ecryptfs_unlocked_ioctl()
375 case FITRIM: in ecryptfs_unlocked_ioctl()
376 case FS_IOC_GETFLAGS: in ecryptfs_unlocked_ioctl()
377 case FS_IOC_SETFLAGS: in ecryptfs_unlocked_ioctl()
378 case FS_IOC_GETVERSION: in ecryptfs_unlocked_ioctl()
379 case FS_IOC_SETVERSION: in ecryptfs_unlocked_ioctl()
380 rc = lower_file->f_op->unlocked_ioctl(lower_file, cmd, arg); in ecryptfs_unlocked_ioctl()
394 long rc = -ENOIOCTLCMD; in ecryptfs_compat_ioctl()
396 if (!lower_file->f_op->compat_ioctl) in ecryptfs_compat_ioctl()
400 case FITRIM: in ecryptfs_compat_ioctl()
401 case FS_IOC32_GETFLAGS: in ecryptfs_compat_ioctl()
402 case FS_IOC32_SETFLAGS: in ecryptfs_compat_ioctl()
403 case FS_IOC32_GETVERSION: in ecryptfs_compat_ioctl()
404 case FS_IOC32_SETVERSION: in ecryptfs_compat_ioctl()
405 rc = lower_file->f_op->compat_ioctl(lower_file, cmd, arg); in ecryptfs_compat_ioctl()