source:
trunk/server/common/patches/openafs-linux-3.1-fsync.patch
@
2113
Last change on this file since 2113 was 2066, checked in by achernya, 13 years ago | |
---|---|
File size: 3.1 KB |
-
acinclude.m4
From: Marc Dionne <marc.c.dionne@gmail.com> Date: Fri, 2 Sep 2011 21:56:58 +0000 (-0400) Subject: Linux: 3.1: adapt to fsync changes X-Git-Url: http://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=81f28004415ae07f2e3a1320da632cbd52c96b25;hp=ef492dc1e1a1809a910fbf07140b26c4924957c5 Linux: 3.1: adapt to fsync changes The fsync file operation gets new arguments to specify a range. Add a configure test to check for the API change. The inode lock is also pushed down into the operation, so we need to take it ourselves to keep the original behaviour. Reviewed-on: http://gerrit.openafs.org/5332 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Simon Wilkinson <sxw@inf.ed.ac.uk> Reviewed-by: Derrick Brashear <shadow@dementix.org> (cherry picked from commit cbaefa266d433af3b9a082a360e23a42f161d80f) Change-Id: Idb6770204b014c62a8611548509240f8b5f950bc --- diff --git a/acinclude.m4 b/acinclude.m4 index 3ff4551..35f2200 100644
a b case $AFS_SYSNAME in *_linux* | *_umlinux*) 920 920 LINUX_DOP_D_REVALIDATE_TAKES_NAMEIDATA 921 921 LINUX_FOP_F_FLUSH_TAKES_FL_OWNER_T 922 922 LINUX_FOP_F_FSYNC_TAKES_DENTRY 923 LINUX_FOP_F_FSYNC_TAKES_RANGE 923 924 LINUX_AOP_WRITEBACK_CONTROL 924 925 LINUX_FS_STRUCT_FOP_HAS_SPLICE 925 926 LINUX_KERNEL_POSIX_LOCK_FILE_WAIT_ARG -
src/afs/LINUX/osi_vnodeops.c
diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c index 696146b..019b568 100644
a b afs_linux_release(struct inode *ip, struct file *fp) 425 425 static int 426 426 #if defined(FOP_FSYNC_TAKES_DENTRY) 427 427 afs_linux_fsync(struct file *fp, struct dentry *dp, int datasync) 428 #elif defined(FOP_FSYNC_TAKES_RANGE) 429 afs_linux_fsync(struct file *fp, loff_t start, loff_t end, int datasync) 428 430 #else 429 431 afs_linux_fsync(struct file *fp, int datasync) 430 432 #endif … … afs_linux_fsync(struct file *fp, int datasync) 433 435 struct inode *ip = FILE_INODE(fp); 434 436 cred_t *credp = crref(); 435 437 438 #if defined(FOP_FSYNC_TAKES_RANGE) 439 mutex_lock(&ip->i_mutex); 440 #endif 436 441 AFS_GLOCK(); 437 442 code = afs_fsync(VTOAFS(ip), credp); 438 443 AFS_GUNLOCK(); 444 #if defined(FOP_FSYNC_TAKES_RANGE) 445 mutex_unlock(&ip->i_mutex); 446 #endif 439 447 crfree(credp); 440 448 return afs_convert_code(code); 441 449 -
src/cf/linux-test4.m4
diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 index 2292f81..35082b3 100644
a b struct dentry _d; 414 414 ]) 415 415 416 416 417 int (*fsync) (struct file *, loff_t start, loff_t end, int datasync); 418 419 AC_DEFUN([LINUX_FOP_F_FSYNC_TAKES_RANGE], [ 420 AC_CHECK_LINUX_BUILD([whether file_operations.fsync takes a range], 421 [ac_cv_linux_func_f_fsync_takes_range], 422 [#include <linux/fs.h>], 423 [struct inode _inode; 424 struct file _file; 425 loff_t start, end; 426 (void)_inode.i_fop->fsync(&_file, start, end, 0);], 427 [FOP_FSYNC_TAKES_RANGE], 428 [define if your fops.fsync takes range arguments], 429 []) 430 ]) 431 432 417 433 AC_DEFUN([LINUX_HAVE_KMEM_CACHE_T], [ 418 434 AC_CHECK_LINUX_BUILD([whether kmem_cache_t exists], 419 435 [ac_cv_linux_have_kmem_cache_t],
Note: See TracBrowser
for help on using the repository browser.