OLD | NEW |
1 /** | 1 /** |
2 * eCryptfs: Linux filesystem encryption layer | 2 * eCryptfs: Linux filesystem encryption layer |
3 * | 3 * |
4 * Copyright (C) 1997-2004 Erez Zadok | 4 * Copyright (C) 1997-2004 Erez Zadok |
5 * Copyright (C) 2001-2004 Stony Brook University | 5 * Copyright (C) 2001-2004 Stony Brook University |
6 * Copyright (C) 2004-2007 International Business Machines Corp. | 6 * Copyright (C) 2004-2007 International Business Machines Corp. |
7 * Author(s): Michael A. Halcrow <mhalcrow@us.ibm.com> | 7 * Author(s): Michael A. Halcrow <mhalcrow@us.ibm.com> |
8 * Michael C. Thompson <mcthomps@us.ibm.com> | 8 * Michael C. Thompson <mcthomps@us.ibm.com> |
9 * | 9 * |
10 * This program is free software; you can redistribute it and/or | 10 * This program is free software; you can redistribute it and/or |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 static int ecryptfs_release(struct inode *inode, struct file *file) | 268 static int ecryptfs_release(struct inode *inode, struct file *file) |
269 { | 269 { |
270 kmem_cache_free(ecryptfs_file_info_cache, | 270 kmem_cache_free(ecryptfs_file_info_cache, |
271 ecryptfs_file_to_private(file)); | 271 ecryptfs_file_to_private(file)); |
272 return 0; | 272 return 0; |
273 } | 273 } |
274 | 274 |
275 static int | 275 static int |
276 ecryptfs_fsync(struct file *file, struct dentry *dentry, int datasync) | 276 ecryptfs_fsync(struct file *file, struct dentry *dentry, int datasync) |
277 { | 277 { |
278 » int rc = 0; | 278 » return vfs_fsync(ecryptfs_file_to_lower(file), |
279 | 279 » » » ecryptfs_dentry_to_lower(dentry), |
280 » rc = simple_fsync(file, dentry, datasync); | 280 » » » datasync); |
281 » if (rc) | |
282 » » goto out; | |
283 » rc = vfs_fsync(ecryptfs_file_to_lower(file), | |
284 » » ecryptfs_dentry_to_lower(dentry), | |
285 » » datasync); | |
286 out: | |
287 » return rc; | |
288 } | 281 } |
289 | 282 |
290 static int ecryptfs_fasync(int fd, struct file *file, int flag) | 283 static int ecryptfs_fasync(int fd, struct file *file, int flag) |
291 { | 284 { |
292 int rc = 0; | 285 int rc = 0; |
293 struct file *lower_file = NULL; | 286 struct file *lower_file = NULL; |
294 | 287 |
295 lock_kernel(); | 288 lock_kernel(); |
296 lower_file = ecryptfs_file_to_lower(file); | 289 lower_file = ecryptfs_file_to_lower(file); |
297 if (lower_file->f_op && lower_file->f_op->fasync) | 290 if (lower_file->f_op && lower_file->f_op->fasync) |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 .compat_ioctl = ecryptfs_compat_ioctl, | 348 .compat_ioctl = ecryptfs_compat_ioctl, |
356 #endif | 349 #endif |
357 .mmap = generic_file_mmap, | 350 .mmap = generic_file_mmap, |
358 .open = ecryptfs_open, | 351 .open = ecryptfs_open, |
359 .flush = ecryptfs_flush, | 352 .flush = ecryptfs_flush, |
360 .release = ecryptfs_release, | 353 .release = ecryptfs_release, |
361 .fsync = ecryptfs_fsync, | 354 .fsync = ecryptfs_fsync, |
362 .fasync = ecryptfs_fasync, | 355 .fasync = ecryptfs_fasync, |
363 .splice_read = generic_file_splice_read, | 356 .splice_read = generic_file_splice_read, |
364 }; | 357 }; |
OLD | NEW |