source: trunk/server/common/patches/openafs-linux-3.1-fsync.patch @ 2170

Last change on this file since 2170 was 2066, checked in by achernya, 13 years ago
Merge branches/fc15-dev to trunk
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*) 
    920920                 LINUX_DOP_D_REVALIDATE_TAKES_NAMEIDATA
    921921                 LINUX_FOP_F_FLUSH_TAKES_FL_OWNER_T
    922922                 LINUX_FOP_F_FSYNC_TAKES_DENTRY
     923                 LINUX_FOP_F_FSYNC_TAKES_RANGE
    923924                 LINUX_AOP_WRITEBACK_CONTROL
    924925                 LINUX_FS_STRUCT_FOP_HAS_SPLICE
    925926                 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) 
    425425static int
    426426#if defined(FOP_FSYNC_TAKES_DENTRY)
    427427afs_linux_fsync(struct file *fp, struct dentry *dp, int datasync)
     428#elif defined(FOP_FSYNC_TAKES_RANGE)
     429afs_linux_fsync(struct file *fp, loff_t start, loff_t end, int datasync)
    428430#else
    429431afs_linux_fsync(struct file *fp, int datasync)
    430432#endif
    afs_linux_fsync(struct file *fp, int datasync) 
    433435    struct inode *ip = FILE_INODE(fp);
    434436    cred_t *credp = crref();
    435437
     438#if defined(FOP_FSYNC_TAKES_RANGE)
     439    mutex_lock(&ip->i_mutex);
     440#endif
    436441    AFS_GLOCK();
    437442    code = afs_fsync(VTOAFS(ip), credp);
    438443    AFS_GUNLOCK();
     444#if defined(FOP_FSYNC_TAKES_RANGE)
     445    mutex_unlock(&ip->i_mutex);
     446#endif
    439447    crfree(credp);
    440448    return afs_convert_code(code);
    441449
  • 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; 
    414414])
    415415
    416416
     417int (*fsync) (struct file *, loff_t start, loff_t end, int datasync);
     418
     419AC_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;
     424struct file _file;
     425loff_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
    417433AC_DEFUN([LINUX_HAVE_KMEM_CACHE_T], [
    418434  AC_CHECK_LINUX_BUILD([whether kmem_cache_t exists],
    419435                       [ac_cv_linux_have_kmem_cache_t],
Note: See TracBrowser for help on using the repository browser.