file.c (11e4afb49b7fa1fc8e1ffd850c1806dd86a08204) | file.c (c43f7b8fb03be8bcc579bfc4e6ab70eac887ab55) |
---|---|
1/** 2 * eCryptfs: Linux filesystem encryption layer 3 * 4 * Copyright (C) 1997-2004 Erez Zadok 5 * Copyright (C) 2001-2004 Stony Brook University 6 * Copyright (C) 2004-2007 International Business Machines Corp. 7 * Author(s): Michael A. Halcrow <mhalcrow@us.ibm.com> 8 * Michael C. Thompson <mcthomps@us.ibm.com> --- 278 unchanged lines hidden (view full) --- 287 lock_kernel(); 288 lower_file = ecryptfs_file_to_lower(file); 289 if (lower_file->f_op && lower_file->f_op->fasync) 290 rc = lower_file->f_op->fasync(fd, lower_file, flag); 291 unlock_kernel(); 292 return rc; 293} 294 | 1/** 2 * eCryptfs: Linux filesystem encryption layer 3 * 4 * Copyright (C) 1997-2004 Erez Zadok 5 * Copyright (C) 2001-2004 Stony Brook University 6 * Copyright (C) 2004-2007 International Business Machines Corp. 7 * Author(s): Michael A. Halcrow <mhalcrow@us.ibm.com> 8 * Michael C. Thompson <mcthomps@us.ibm.com> --- 278 unchanged lines hidden (view full) --- 287 lock_kernel(); 288 lower_file = ecryptfs_file_to_lower(file); 289 if (lower_file->f_op && lower_file->f_op->fasync) 290 rc = lower_file->f_op->fasync(fd, lower_file, flag); 291 unlock_kernel(); 292 return rc; 293} 294 |
295static int ecryptfs_ioctl(struct inode *inode, struct file *file, 296 unsigned int cmd, unsigned long arg); | 295static long 296ecryptfs_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 297{ 298 struct file *lower_file = NULL; 299 long rc = -ENOTTY; |
297 | 300 |
301 if (ecryptfs_file_to_private(file)) 302 lower_file = ecryptfs_file_to_lower(file); 303 if (lower_file && lower_file->f_op && lower_file->f_op->unlocked_ioctl) 304 rc = lower_file->f_op->unlocked_ioctl(lower_file, cmd, arg); 305 return rc; 306} 307 308#ifdef CONFIG_COMPAT 309static long 310ecryptfs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 311{ 312 struct file *lower_file = NULL; 313 long rc = -ENOIOCTLCMD; 314 315 if (ecryptfs_file_to_private(file)) 316 lower_file = ecryptfs_file_to_lower(file); 317 if (lower_file && lower_file->f_op && lower_file->f_op->compat_ioctl) 318 rc = lower_file->f_op->compat_ioctl(lower_file, cmd, arg); 319 return rc; 320} 321#endif 322 |
|
298const struct file_operations ecryptfs_dir_fops = { 299 .readdir = ecryptfs_readdir, | 323const struct file_operations ecryptfs_dir_fops = { 324 .readdir = ecryptfs_readdir, |
300 .ioctl = ecryptfs_ioctl, | 325 .unlocked_ioctl = ecryptfs_unlocked_ioctl, 326#ifdef CONFIG_COMPAT 327 .compat_ioctl = ecryptfs_compat_ioctl, 328#endif |
301 .open = ecryptfs_open, 302 .flush = ecryptfs_flush, 303 .release = ecryptfs_release, 304 .fsync = ecryptfs_fsync, 305 .fasync = ecryptfs_fasync, 306 .splice_read = generic_file_splice_read, 307}; 308 309const struct file_operations ecryptfs_main_fops = { 310 .llseek = generic_file_llseek, 311 .read = do_sync_read, 312 .aio_read = ecryptfs_read_update_atime, 313 .write = do_sync_write, 314 .aio_write = generic_file_aio_write, 315 .readdir = ecryptfs_readdir, | 329 .open = ecryptfs_open, 330 .flush = ecryptfs_flush, 331 .release = ecryptfs_release, 332 .fsync = ecryptfs_fsync, 333 .fasync = ecryptfs_fasync, 334 .splice_read = generic_file_splice_read, 335}; 336 337const struct file_operations ecryptfs_main_fops = { 338 .llseek = generic_file_llseek, 339 .read = do_sync_read, 340 .aio_read = ecryptfs_read_update_atime, 341 .write = do_sync_write, 342 .aio_write = generic_file_aio_write, 343 .readdir = ecryptfs_readdir, |
316 .ioctl = ecryptfs_ioctl, | 344 .unlocked_ioctl = ecryptfs_unlocked_ioctl, 345#ifdef CONFIG_COMPAT 346 .compat_ioctl = ecryptfs_compat_ioctl, 347#endif |
317 .mmap = generic_file_mmap, 318 .open = ecryptfs_open, 319 .flush = ecryptfs_flush, 320 .release = ecryptfs_release, 321 .fsync = ecryptfs_fsync, 322 .fasync = ecryptfs_fasync, 323 .splice_read = generic_file_splice_read, 324}; | 348 .mmap = generic_file_mmap, 349 .open = ecryptfs_open, 350 .flush = ecryptfs_flush, 351 .release = ecryptfs_release, 352 .fsync = ecryptfs_fsync, 353 .fasync = ecryptfs_fasync, 354 .splice_read = generic_file_splice_read, 355}; |
325 326static int 327ecryptfs_ioctl(struct inode *inode, struct file *file, unsigned int cmd, 328 unsigned long arg) 329{ 330 int rc = 0; 331 struct file *lower_file = NULL; 332 333 if (ecryptfs_file_to_private(file)) 334 lower_file = ecryptfs_file_to_lower(file); 335 if (lower_file && lower_file->f_op && lower_file->f_op->ioctl) 336 rc = lower_file->f_op->ioctl(ecryptfs_inode_to_lower(inode), 337 lower_file, cmd, arg); 338 else 339 rc = -ENOTTY; 340 return rc; 341} | |