| [2337] | 1 | From 53774c945e91ea344cbe51c9fafae8acf711f558 Mon Sep 17 00:00:00 2001 | 
|---|
|  | 2 | From: Marc Dionne <marc.c.dionne@gmail.com> | 
|---|
|  | 3 | Date: Mon, 28 May 2012 21:43:12 -0400 | 
|---|
|  | 4 | Subject: [PATCH 01/12] Linux 3.4: replace end_writeback with clear_inode | 
|---|
|  | 5 |  | 
|---|
|  | 6 | end_writeback() is renamed to clear_inode().  Add a configure test | 
|---|
|  | 7 | and cope. | 
|---|
|  | 8 |  | 
|---|
|  | 9 | Change-Id: Icaf5b6b54d0ee377fabcf0b295d690eaa6b4be5e | 
|---|
|  | 10 | Reviewed-on: http://gerrit.openafs.org/7503 | 
|---|
|  | 11 | Reviewed-by: Derrick Brashear <shadow@dementix.org> | 
|---|
|  | 12 | Tested-by: BuildBot <buildbot@rampaginggeek.com> | 
|---|
|  | 13 | (cherry picked from commit 2b33384a4a7b88842281021129ffccc837d91d36) | 
|---|
|  | 14 | --- | 
|---|
|  | 15 | acinclude.m4               | 3 +++ | 
|---|
|  | 16 | src/afs/LINUX/osi_vfsops.c | 4 ++++ | 
|---|
|  | 17 | 2 files changed, 7 insertions(+) | 
|---|
|  | 18 |  | 
|---|
|  | 19 | diff --git a/acinclude.m4 b/acinclude.m4 | 
|---|
|  | 20 | index 6e2c9ae..c14b581 100644 | 
|---|
|  | 21 | --- a/acinclude.m4 | 
|---|
|  | 22 | +++ b/acinclude.m4 | 
|---|
|  | 23 | @@ -840,6 +840,9 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) | 
|---|
|  | 24 | #include <linux/page-flags.h>], | 
|---|
|  | 25 | [struct page *_page; | 
|---|
|  | 26 | int bchecked = PageFsMisc(_page);]) | 
|---|
|  | 27 | +                AC_CHECK_LINUX_FUNC([clear_inode], | 
|---|
|  | 28 | +                                    [#include <linux/fs.h>], | 
|---|
|  | 29 | +                                    [clear_inode(NULL);]) | 
|---|
|  | 30 | AC_CHECK_LINUX_FUNC([current_kernel_time], | 
|---|
|  | 31 | [#include <linux/time.h>], | 
|---|
|  | 32 | [struct timespec s; | 
|---|
|  | 33 | diff --git a/src/afs/LINUX/osi_vfsops.c b/src/afs/LINUX/osi_vfsops.c | 
|---|
|  | 34 | index a6be1b3..bc951a2 100644 | 
|---|
|  | 35 | --- a/src/afs/LINUX/osi_vfsops.c | 
|---|
|  | 36 | +++ b/src/afs/LINUX/osi_vfsops.c | 
|---|
|  | 37 | @@ -284,7 +284,11 @@ afs_evict_inode(struct inode *ip) | 
|---|
|  | 38 | osi_Panic("inode freed while still hashed"); | 
|---|
|  | 39 |  | 
|---|
|  | 40 | truncate_inode_pages(&ip->i_data, 0); | 
|---|
|  | 41 | +#if defined(HAVE_LINUX_CLEAR_INODE) | 
|---|
|  | 42 | +    clear_inode(ip); | 
|---|
|  | 43 | +#else | 
|---|
|  | 44 | end_writeback(ip); | 
|---|
|  | 45 | +#endif | 
|---|
|  | 46 |  | 
|---|
|  | 47 | #if !defined(STRUCT_SUPER_OPERATIONS_HAS_ALLOC_INODE) | 
|---|
|  | 48 | afs_osi_Free(ip->u.generic_ip, sizeof(struct vcache)); | 
|---|
|  | 49 | -- | 
|---|
|  | 50 | 1.8.0 | 
|---|
|  | 51 |  | 
|---|
|  | 52 |  | 
|---|
|  | 53 | From 235dee4c449bb5d5307f9b14d5effa4509d58efc Mon Sep 17 00:00:00 2001 | 
|---|
|  | 54 | From: Marc Dionne <marc.c.dionne@gmail.com> | 
|---|
|  | 55 | Date: Sat, 2 Jun 2012 21:35:53 -0400 | 
|---|
|  | 56 | Subject: [PATCH 02/12] Linux 3.5: encode_fh API change | 
|---|
|  | 57 |  | 
|---|
|  | 58 | The encode_fh export operation now expects two inode arguments | 
|---|
|  | 59 | instead of a dentry and a "connectable" flag.  Use the inode of | 
|---|
|  | 60 | the dentry we're interested in, and NULL as the parent inode which | 
|---|
|  | 61 | is the same as passing a 0 flag in the previous API. | 
|---|
|  | 62 |  | 
|---|
|  | 63 | Change-Id: I05cf146fb2a4bacdca20a9f108d04ccb11530804 | 
|---|
|  | 64 | Reviewed-on: http://gerrit.openafs.org/7523 | 
|---|
|  | 65 | Tested-by: BuildBot <buildbot@rampaginggeek.com> | 
|---|
|  | 66 | Reviewed-by: Derrick Brashear <shadow@dementix.org> | 
|---|
|  | 67 | (cherry picked from commit 5227148ae17949705487ea673d558ebfe143e635) | 
|---|
|  | 68 | --- | 
|---|
|  | 69 | acinclude.m4               |  1 + | 
|---|
|  | 70 | src/afs/LINUX/osi_compat.h |  4 ++++ | 
|---|
|  | 71 | src/cf/linux-test4.m4      | 14 ++++++++++++++ | 
|---|
|  | 72 | 3 files changed, 19 insertions(+) | 
|---|
|  | 73 |  | 
|---|
|  | 74 | diff --git a/acinclude.m4 b/acinclude.m4 | 
|---|
|  | 75 | index c14b581..25484cf 100644 | 
|---|
|  | 76 | --- a/acinclude.m4 | 
|---|
|  | 77 | +++ b/acinclude.m4 | 
|---|
|  | 78 | @@ -958,6 +958,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) | 
|---|
|  | 79 | LINUX_D_COUNT_IS_INT | 
|---|
|  | 80 | LINUX_IOP_MKDIR_TAKES_UMODE_T | 
|---|
|  | 81 | LINUX_IOP_CREATE_TAKES_UMODE_T | 
|---|
|  | 82 | +                LINUX_EXPORT_OP_ENCODE_FH_TAKES_INODES | 
|---|
|  | 83 |  | 
|---|
|  | 84 | dnl If we are guaranteed that keyrings will work - that is | 
|---|
|  | 85 | dnl  a) The kernel has keyrings enabled | 
|---|
|  | 86 | diff --git a/src/afs/LINUX/osi_compat.h b/src/afs/LINUX/osi_compat.h | 
|---|
|  | 87 | index b94295c..4c7c261 100644 | 
|---|
|  | 88 | --- a/src/afs/LINUX/osi_compat.h | 
|---|
|  | 89 | +++ b/src/afs/LINUX/osi_compat.h | 
|---|
|  | 90 | @@ -333,7 +333,11 @@ afs_get_dentry_from_fh(struct super_block *afs_cacheSBp, afs_dcache_id_t *ainode | 
|---|
|  | 91 | static inline int | 
|---|
|  | 92 | afs_get_fh_from_dentry(struct dentry *dp, afs_ufs_dcache_id_t *ainode, int *max_lenp) { | 
|---|
|  | 93 | if (dp->d_sb->s_export_op->encode_fh) | 
|---|
|  | 94 | +#if defined(EXPORT_OP_ENCODE_FH_TAKES_INODES) | 
|---|
|  | 95 | +        return dp->d_sb->s_export_op->encode_fh(dp->d_inode, &ainode->raw[0], max_lenp, NULL); | 
|---|
|  | 96 | +#else | 
|---|
|  | 97 | return dp->d_sb->s_export_op->encode_fh(dp, &ainode->raw[0], max_lenp, 0); | 
|---|
|  | 98 | +#endif | 
|---|
|  | 99 | #if defined(NEW_EXPORT_OPS) | 
|---|
|  | 100 | /* If fs doesn't provide an encode_fh method, assume the default INO32 type */ | 
|---|
|  | 101 | *max_lenp = sizeof(struct fid)/4; | 
|---|
|  | 102 | diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 | 
|---|
|  | 103 | index f5e91b1..f13e97d 100644 | 
|---|
|  | 104 | --- a/src/cf/linux-test4.m4 | 
|---|
|  | 105 | +++ b/src/cf/linux-test4.m4 | 
|---|
|  | 106 | @@ -661,3 +661,17 @@ AC_DEFUN([LINUX_IOP_CREATE_TAKES_UMODE_T], [ | 
|---|
|  | 107 | [define if inode.i_op->create takes a umode_t argument], | 
|---|
|  | 108 | [-Werror]) | 
|---|
|  | 109 | ]) | 
|---|
|  | 110 | + | 
|---|
|  | 111 | + | 
|---|
|  | 112 | +AC_DEFUN([LINUX_EXPORT_OP_ENCODE_FH_TAKES_INODES], [ | 
|---|
|  | 113 | +  AC_CHECK_LINUX_BUILD([whether export operation encode_fh takes inode arguments], | 
|---|
|  | 114 | +                       [ac_cv_linux_export_op_encode_fh__takes_inodes], | 
|---|
|  | 115 | +                       [#include <linux/exportfs.h>], | 
|---|
|  | 116 | +                       [struct export_operations _exp_ops; | 
|---|
|  | 117 | +                       int _encode_fh(struct inode *i, __u32 *fh, int *len, struct inode *p) | 
|---|
|  | 118 | +                               {return 0;}; | 
|---|
|  | 119 | +                       _exp_ops.encode_fh = _encode_fh;], | 
|---|
|  | 120 | +                       [EXPORT_OP_ENCODE_FH_TAKES_INODES], | 
|---|
|  | 121 | +                       [define if encode_fh export op takes inode arguments], | 
|---|
|  | 122 | +                       [-Werror]) | 
|---|
|  | 123 | +]) | 
|---|
|  | 124 | -- | 
|---|
|  | 125 | 1.8.0 | 
|---|
|  | 126 |  | 
|---|
|  | 127 |  | 
|---|
|  | 128 | From f6093c4716d36b7499b5c84950e6ec4480745467 Mon Sep 17 00:00:00 2001 | 
|---|
|  | 129 | From: Marc Dionne <marc.c.dionne@gmail.com> | 
|---|
|  | 130 | Date: Sat, 2 Jun 2012 20:45:08 -0400 | 
|---|
|  | 131 | Subject: [PATCH 03/12] afsd: include sys/resource.h in afsd_kernel.c | 
|---|
|  | 132 |  | 
|---|
|  | 133 | With a recent glibc update, sys/wait.h no longer includes | 
|---|
|  | 134 | sys/resource.h unless __USE_SVID, __USE_XOPEN or __USE_XOPEN2K8 | 
|---|
|  | 135 | are set. | 
|---|
|  | 136 |  | 
|---|
|  | 137 | Don't rely on the indirect inclusion to get the bits we need; | 
|---|
|  | 138 | include it directly in afsd_kernel.c.  This include used to be | 
|---|
|  | 139 | there but was dropped when afsd_kernel.c was split off. | 
|---|
|  | 140 |  | 
|---|
|  | 141 | Reviewed-on: http://gerrit.openafs.org/7522 | 
|---|
|  | 142 | Tested-by: BuildBot <buildbot@rampaginggeek.com> | 
|---|
|  | 143 | Reviewed-by: Derrick Brashear <shadow@dementix.org> | 
|---|
|  | 144 | (cherry picked from commit bc3a32a84facb8114a8c7de87025f972d0281098) | 
|---|
|  | 145 |  | 
|---|
|  | 146 | Change-Id: Ia5ba6a0e662607e680b4431f146c969b7069bcfd | 
|---|
|  | 147 | Reviewed-on: http://gerrit.openafs.org/8155 | 
|---|
|  | 148 | Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com> | 
|---|
|  | 149 | Reviewed-by: Derrick Brashear <shadow@your-file-system.com> | 
|---|
|  | 150 | Tested-by: Derrick Brashear <shadow@your-file-system.com> | 
|---|
|  | 151 | (cherry picked from commit 5842f856652051a4386b1e0170f18dca911ca4c6) | 
|---|
|  | 152 | --- | 
|---|
|  | 153 | src/afsd/afsd_kernel.c | 4 ++++ | 
|---|
|  | 154 | 1 file changed, 4 insertions(+) | 
|---|
|  | 155 |  | 
|---|
|  | 156 | diff --git a/src/afsd/afsd_kernel.c b/src/afsd/afsd_kernel.c | 
|---|
|  | 157 | index 1f7fdbb..e1e87a7 100644 | 
|---|
|  | 158 | --- a/src/afsd/afsd_kernel.c | 
|---|
|  | 159 | +++ b/src/afsd/afsd_kernel.c | 
|---|
|  | 160 | @@ -37,6 +37,10 @@ | 
|---|
|  | 161 | #include <sys/param.h> | 
|---|
|  | 162 | #endif | 
|---|
|  | 163 |  | 
|---|
|  | 164 | +#if defined(AFS_LINUX20_ENV) | 
|---|
|  | 165 | +#include <sys/resource.h> | 
|---|
|  | 166 | +#endif | 
|---|
|  | 167 | + | 
|---|
|  | 168 | #ifdef HAVE_SYS_FS_TYPES_H | 
|---|
|  | 169 | #include <sys/fs_types.h> | 
|---|
|  | 170 | #endif | 
|---|
|  | 171 | -- | 
|---|
|  | 172 | 1.8.0 | 
|---|
|  | 173 |  | 
|---|
|  | 174 |  | 
|---|
|  | 175 | From 31a7f5ef2fcb81c2510834befd15fb057d067eaf Mon Sep 17 00:00:00 2001 | 
|---|
|  | 176 | From: Marc Dionne <marc.c.dionne@gmail.com> | 
|---|
|  | 177 | Date: Mon, 13 Aug 2012 20:32:08 -0400 | 
|---|
|  | 178 | Subject: [PATCH 04/12] Linux: bypass: consolidate copy_page macros into a | 
|---|
|  | 179 | single function | 
|---|
|  | 180 |  | 
|---|
|  | 181 | The copy_page(s) macros are very similar; combine them into a | 
|---|
|  | 182 | single function that can be used for all cases. | 
|---|
|  | 183 |  | 
|---|
|  | 184 | This will make it easier to add some pre-processor logic around | 
|---|
|  | 185 | the kmap_atomic calls to adapt to Linux API changes. | 
|---|
|  | 186 |  | 
|---|
|  | 187 | Reviewed-on: http://gerrit.openafs.org/7980 | 
|---|
|  | 188 | Tested-by: BuildBot <buildbot@rampaginggeek.com> | 
|---|
|  | 189 | Reviewed-by: Derrick Brashear <shadow@dementix.org> | 
|---|
|  | 190 | (cherry picked from commit 0a8256a26fafb490b454f2a857b0c15d859572c5) | 
|---|
|  | 191 |  | 
|---|
|  | 192 | Change-Id: I6835a024428b26a8cd8d073f6304d0d0b3042b24 | 
|---|
|  | 193 | Reviewed-on: http://gerrit.openafs.org/8077 | 
|---|
|  | 194 | Reviewed-by: Derrick Brashear <shadow@your-file-system.com> | 
|---|
|  | 195 | Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com> | 
|---|
|  | 196 | Tested-by: BuildBot <buildbot@rampaginggeek.com> | 
|---|
|  | 197 | (cherry picked from commit 54db9af1a87c03d6f00ab70565c9d1f733813fc2) | 
|---|
|  | 198 | --- | 
|---|
|  | 199 | src/afs/afs_bypasscache.c | 63 ++++++++++++++++++----------------------------- | 
|---|
|  | 200 | 1 file changed, 24 insertions(+), 39 deletions(-) | 
|---|
|  | 201 |  | 
|---|
|  | 202 | diff --git a/src/afs/afs_bypasscache.c b/src/afs/afs_bypasscache.c | 
|---|
|  | 203 | index e447024..b350233 100644 | 
|---|
|  | 204 | --- a/src/afs/afs_bypasscache.c | 
|---|
|  | 205 | +++ b/src/afs/afs_bypasscache.c | 
|---|
|  | 206 | @@ -270,49 +270,12 @@ done: | 
|---|
|  | 207 | #ifdef UKERNEL | 
|---|
|  | 208 | typedef void * bypass_page_t; | 
|---|
|  | 209 |  | 
|---|
|  | 210 | -#define copy_page(pp, pageoff, rxiov, iovno, iovoff, auio, curiov)     \ | 
|---|
|  | 211 | -    do { \ | 
|---|
|  | 212 | -       int dolen = auio->uio_iov[curiov].iov_len - pageoff; \ | 
|---|
|  | 213 | -       memcpy(((char *)pp) + pageoff,                 \ | 
|---|
|  | 214 | -              ((char *)rxiov[iovno].iov_base) + iovoff, dolen);        \ | 
|---|
|  | 215 | -       auio->uio_resid -= dolen; \ | 
|---|
|  | 216 | -    } while(0) | 
|---|
|  | 217 | - | 
|---|
|  | 218 | -#define copy_pages(pp, pageoff, rxiov, iovno, iovoff, auio, curiov)    \ | 
|---|
|  | 219 | -    do { \ | 
|---|
|  | 220 | -       int dolen = rxiov[iovno].iov_len - iovoff; \ | 
|---|
|  | 221 | -       memcpy(((char *)pp) + pageoff,                          \ | 
|---|
|  | 222 | -              ((char *)rxiov[iovno].iov_base) + iovoff, dolen);        \ | 
|---|
|  | 223 | -       auio->uio_resid -= dolen;       \ | 
|---|
|  | 224 | -    } while(0) | 
|---|
|  | 225 | - | 
|---|
|  | 226 | #define unlock_and_release_pages(auio) | 
|---|
|  | 227 | #define release_full_page(pp, pageoff) | 
|---|
|  | 228 |  | 
|---|
|  | 229 | #else | 
|---|
|  | 230 | typedef struct page * bypass_page_t; | 
|---|
|  | 231 |  | 
|---|
|  | 232 | -#define copy_page(pp, pageoff, rxiov, iovno, iovoff, auio, curiov)     \ | 
|---|
|  | 233 | -    do { \ | 
|---|
|  | 234 | -        char *address;                                         \ | 
|---|
|  | 235 | -       int dolen = auio->uio_iov[curiov].iov_len - pageoff; \ | 
|---|
|  | 236 | -       address = kmap_atomic(pp, KM_USER0); \ | 
|---|
|  | 237 | -       memcpy(address + pageoff, \ | 
|---|
|  | 238 | -              (char *)(rxiov[iovno].iov_base) + iovoff, dolen);        \ | 
|---|
|  | 239 | -       kunmap_atomic(address, KM_USER0); \ | 
|---|
|  | 240 | -    } while(0) | 
|---|
|  | 241 | - | 
|---|
|  | 242 | -#define copy_pages(pp, pageoff, rxiov, iovno, iovoff, auio, curiov)    \ | 
|---|
|  | 243 | -    do { \ | 
|---|
|  | 244 | -        char *address; \ | 
|---|
|  | 245 | -       int dolen = rxiov[iovno].iov_len - iovoff; \ | 
|---|
|  | 246 | -       address = kmap_atomic(pp, KM_USER0); \ | 
|---|
|  | 247 | -       memcpy(address + pageoff, \ | 
|---|
|  | 248 | -              (char *)(rxiov[iovno].iov_base) + iovoff, dolen);        \ | 
|---|
|  | 249 | -       kunmap_atomic(address, KM_USER0); \ | 
|---|
|  | 250 | -    } while(0) | 
|---|
|  | 251 | - | 
|---|
|  | 252 | - | 
|---|
|  | 253 | #define unlock_and_release_pages(auio) \ | 
|---|
|  | 254 | do { \ | 
|---|
|  | 255 | struct iovec *ciov;     \ | 
|---|
|  | 256 | @@ -347,8 +310,30 @@ typedef struct page * bypass_page_t; | 
|---|
|  | 257 | afs_warn("afs_NoCacheFetchProc: page not locked!\n"); \ | 
|---|
|  | 258 | put_page(pp); /* decrement refcount */ \ | 
|---|
|  | 259 | } while(0) | 
|---|
|  | 260 | +#endif | 
|---|
|  | 261 | + | 
|---|
|  | 262 | +static void | 
|---|
|  | 263 | +afs_bypass_copy_page(bypass_page_t pp, int pageoff, struct iovec *rxiov, | 
|---|
|  | 264 | +       int iovno, int iovoff, struct uio *auio, int curiov, int partial) | 
|---|
|  | 265 | +{ | 
|---|
|  | 266 | +    char *address; | 
|---|
|  | 267 | +    int dolen; | 
|---|
|  | 268 | + | 
|---|
|  | 269 | +    if (partial) | 
|---|
|  | 270 | +       dolen = rxiov[iovno].iov_len - iovoff; | 
|---|
|  | 271 | +    else | 
|---|
|  | 272 | +       dolen = auio->uio_iov[curiov].iov_len - pageoff; | 
|---|
|  | 273 |  | 
|---|
|  | 274 | +#if !defined(UKERNEL) | 
|---|
|  | 275 | +    address = kmap_atomic(pp, KM_USER0); | 
|---|
|  | 276 | +#else | 
|---|
|  | 277 | +    address = pp; | 
|---|
|  | 278 | #endif | 
|---|
|  | 279 | +    memcpy(address + pageoff, (char *)(rxiov[iovno].iov_base) + iovoff, dolen); | 
|---|
|  | 280 | +#if !defined(UKERNEL) | 
|---|
|  | 281 | +    kunmap_atomic(address, KM_USER0); | 
|---|
|  | 282 | +#endif | 
|---|
|  | 283 | +} | 
|---|
|  | 284 |  | 
|---|
|  | 285 | /* no-cache prefetch routine */ | 
|---|
|  | 286 | static afs_int32 | 
|---|
|  | 287 | @@ -447,7 +432,7 @@ afs_NoCacheFetchProc(struct rx_call *acall, | 
|---|
|  | 288 | if (pageoff + (rxiov[iovno].iov_len - iovoff) <= auio->uio_iov[curpage].iov_len) { | 
|---|
|  | 289 | /* Copy entire (or rest of) current iovec into current page */ | 
|---|
|  | 290 | if (pp) | 
|---|
|  | 291 | -                       copy_pages(pp, pageoff, rxiov, iovno, iovoff, auio, curpage); | 
|---|
|  | 292 | +                       afs_bypass_copy_page(pp, pageoff, rxiov, iovno, iovoff, auio, curpage, 0); | 
|---|
|  | 293 | length -= (rxiov[iovno].iov_len - iovoff); | 
|---|
|  | 294 | pageoff += rxiov[iovno].iov_len - iovoff; | 
|---|
|  | 295 | iovno++; | 
|---|
|  | 296 | @@ -455,7 +440,7 @@ afs_NoCacheFetchProc(struct rx_call *acall, | 
|---|
|  | 297 | } else { | 
|---|
|  | 298 | /* Copy only what's needed to fill current page */ | 
|---|
|  | 299 | if (pp) | 
|---|
|  | 300 | -                       copy_page(pp, pageoff, rxiov, iovno, iovoff, auio, curpage); | 
|---|
|  | 301 | +                       afs_bypass_copy_page(pp, pageoff, rxiov, iovno, iovoff, auio, curpage, 1); | 
|---|
|  | 302 | length -= (auio->uio_iov[curpage].iov_len - pageoff); | 
|---|
|  | 303 | iovoff += auio->uio_iov[curpage].iov_len - pageoff; | 
|---|
|  | 304 | pageoff = auio->uio_iov[curpage].iov_len; | 
|---|
|  | 305 | -- | 
|---|
|  | 306 | 1.8.0 | 
|---|
|  | 307 |  | 
|---|
|  | 308 |  | 
|---|
|  | 309 | From 51102503174a33c0bbb74a062a9413a0f041588e Mon Sep 17 00:00:00 2001 | 
|---|
|  | 310 | From: Marc Dionne <marc.c.dionne@gmail.com> | 
|---|
|  | 311 | Date: Tue, 14 Aug 2012 16:34:42 -0400 | 
|---|
|  | 312 | Subject: [PATCH 05/12] Linux 3.6: kmap_atomic API change | 
|---|
|  | 313 |  | 
|---|
|  | 314 | kmap_atomic no longer requires a KM_TYPE argument.  Test for this | 
|---|
|  | 315 | and adjust the affected code. | 
|---|
|  | 316 |  | 
|---|
|  | 317 | Reviewed-on: http://gerrit.openafs.org/7981 | 
|---|
|  | 318 | Tested-by: BuildBot <buildbot@rampaginggeek.com> | 
|---|
|  | 319 | Reviewed-by: Derrick Brashear <shadow@dementix.org> | 
|---|
|  | 320 | (cherry picked from commit 049c485b4a39ba510035788b4959d839ef668c55) | 
|---|
|  | 321 |  | 
|---|
|  | 322 | Change-Id: Iac8be7901da4b277864b1b6cc987cf5087992789 | 
|---|
|  | 323 | Reviewed-on: http://gerrit.openafs.org/8078 | 
|---|
|  | 324 | Reviewed-by: Derrick Brashear <shadow@your-file-system.com> | 
|---|
|  | 325 | Reviewed-by: Chas Williams - CONTRACTOR <chas@cmf.nrl.navy.mil> | 
|---|
|  | 326 | Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com> | 
|---|
|  | 327 | Tested-by: BuildBot <buildbot@rampaginggeek.com> | 
|---|
|  | 328 | (cherry picked from commit 76ab286feb1570efa9763e076020fc43fb0a95fa) | 
|---|
|  | 329 | --- | 
|---|
|  | 330 | acinclude.m4              |  1 + | 
|---|
|  | 331 | src/afs/afs_bypasscache.c |  8 ++++++++ | 
|---|
|  | 332 | src/cf/linux-test4.m4     | 12 ++++++++++++ | 
|---|
|  | 333 | 3 files changed, 21 insertions(+) | 
|---|
|  | 334 |  | 
|---|
|  | 335 | diff --git a/acinclude.m4 b/acinclude.m4 | 
|---|
|  | 336 | index 25484cf..20fd15e 100644 | 
|---|
|  | 337 | --- a/acinclude.m4 | 
|---|
|  | 338 | +++ b/acinclude.m4 | 
|---|
|  | 339 | @@ -959,6 +959,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) | 
|---|
|  | 340 | LINUX_IOP_MKDIR_TAKES_UMODE_T | 
|---|
|  | 341 | LINUX_IOP_CREATE_TAKES_UMODE_T | 
|---|
|  | 342 | LINUX_EXPORT_OP_ENCODE_FH_TAKES_INODES | 
|---|
|  | 343 | +                LINUX_KMAP_ATOMIC_TAKES_NO_KM_TYPE | 
|---|
|  | 344 |  | 
|---|
|  | 345 | dnl If we are guaranteed that keyrings will work - that is | 
|---|
|  | 346 | dnl  a) The kernel has keyrings enabled | 
|---|
|  | 347 | diff --git a/src/afs/afs_bypasscache.c b/src/afs/afs_bypasscache.c | 
|---|
|  | 348 | index b350233..1138f89 100644 | 
|---|
|  | 349 | --- a/src/afs/afs_bypasscache.c | 
|---|
|  | 350 | +++ b/src/afs/afs_bypasscache.c | 
|---|
|  | 351 | @@ -325,13 +325,21 @@ afs_bypass_copy_page(bypass_page_t pp, int pageoff, struct iovec *rxiov, | 
|---|
|  | 352 | dolen = auio->uio_iov[curiov].iov_len - pageoff; | 
|---|
|  | 353 |  | 
|---|
|  | 354 | #if !defined(UKERNEL) | 
|---|
|  | 355 | +# if defined(KMAP_ATOMIC_TAKES_NO_KM_TYPE) | 
|---|
|  | 356 | +    address = kmap_atomic(pp); | 
|---|
|  | 357 | +# else | 
|---|
|  | 358 | address = kmap_atomic(pp, KM_USER0); | 
|---|
|  | 359 | +# endif | 
|---|
|  | 360 | #else | 
|---|
|  | 361 | address = pp; | 
|---|
|  | 362 | #endif | 
|---|
|  | 363 | memcpy(address + pageoff, (char *)(rxiov[iovno].iov_base) + iovoff, dolen); | 
|---|
|  | 364 | #if !defined(UKERNEL) | 
|---|
|  | 365 | +# if defined(KMAP_ATOMIC_TAKES_NO_KM_TYPE) | 
|---|
|  | 366 | +    kunmap_atomic(address); | 
|---|
|  | 367 | +# else | 
|---|
|  | 368 | kunmap_atomic(address, KM_USER0); | 
|---|
|  | 369 | +# endif | 
|---|
|  | 370 | #endif | 
|---|
|  | 371 | } | 
|---|
|  | 372 |  | 
|---|
|  | 373 | diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 | 
|---|
|  | 374 | index f13e97d..7db805f 100644 | 
|---|
|  | 375 | --- a/src/cf/linux-test4.m4 | 
|---|
|  | 376 | +++ b/src/cf/linux-test4.m4 | 
|---|
|  | 377 | @@ -675,3 +675,15 @@ AC_DEFUN([LINUX_EXPORT_OP_ENCODE_FH_TAKES_INODES], [ | 
|---|
|  | 378 | [define if encode_fh export op takes inode arguments], | 
|---|
|  | 379 | [-Werror]) | 
|---|
|  | 380 | ]) | 
|---|
|  | 381 | + | 
|---|
|  | 382 | + | 
|---|
|  | 383 | +AC_DEFUN([LINUX_KMAP_ATOMIC_TAKES_NO_KM_TYPE], [ | 
|---|
|  | 384 | +  AC_CHECK_LINUX_BUILD([whether kmap_atomic takes no km_type argument], | 
|---|
|  | 385 | +                       [ac_cv_linux_kma_atomic_takes_no_km_type], | 
|---|
|  | 386 | +                       [#include <linux/highmem.h>], | 
|---|
|  | 387 | +                       [struct page *p = NULL; | 
|---|
|  | 388 | +                       kmap_atomic(p);], | 
|---|
|  | 389 | +                       [KMAP_ATOMIC_TAKES_NO_KM_TYPE], | 
|---|
|  | 390 | +                       [define if kmap_atomic takes no km_type argument], | 
|---|
|  | 391 | +                       [-Werror]) | 
|---|
|  | 392 | +]) | 
|---|
|  | 393 | -- | 
|---|
|  | 394 | 1.8.0 | 
|---|
|  | 395 |  | 
|---|
|  | 396 |  | 
|---|
|  | 397 | From f842c54d6cba963ce34f2d092c9586c6ee21a13c Mon Sep 17 00:00:00 2001 | 
|---|
|  | 398 | From: Marc Dionne <marc.c.dionne@gmail.com> | 
|---|
|  | 399 | Date: Mon, 13 Aug 2012 21:36:15 -0400 | 
|---|
|  | 400 | Subject: [PATCH 06/12] Linux 3.6: dentry_open API change | 
|---|
|  | 401 |  | 
|---|
|  | 402 | dentry_open now takes a path argument that combines the dentry and | 
|---|
|  | 403 | the vfsmount pointers. | 
|---|
|  | 404 | Add a configure test and a new compat inline function to keep things | 
|---|
|  | 405 | cleaner in the main source file. | 
|---|
|  | 406 |  | 
|---|
|  | 407 | Reviewed-on: http://gerrit.openafs.org/7982 | 
|---|
|  | 408 | Tested-by: BuildBot <buildbot@rampaginggeek.com> | 
|---|
|  | 409 | Reviewed-by: Derrick Brashear <shadow@dementix.org> | 
|---|
|  | 410 | (cherry picked from commit 8766a65e97eb90cb6c97ccd35181c441ece14f8a) | 
|---|
|  | 411 |  | 
|---|
|  | 412 | Change-Id: I2c0f59ad9aa6e544a2a613e902933d463f22a5b6 | 
|---|
|  | 413 | Reviewed-on: http://gerrit.openafs.org/8079 | 
|---|
|  | 414 | Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com> | 
|---|
|  | 415 | Tested-by: BuildBot <buildbot@rampaginggeek.com> | 
|---|
|  | 416 | Reviewed-by: Derrick Brashear <shadow@your-file-system.com> | 
|---|
|  | 417 | (cherry picked from commit 1bba9760b26bdb1ef1e17f9d1e15be9d565828cc) | 
|---|
|  | 418 | --- | 
|---|
|  | 419 | acinclude.m4               |  1 + | 
|---|
|  | 420 | src/afs/LINUX/osi_compat.h | 16 ++++++++++++++++ | 
|---|
|  | 421 | src/afs/LINUX/osi_file.c   |  4 ++-- | 
|---|
|  | 422 | src/cf/linux-test4.m4      | 12 ++++++++++++ | 
|---|
|  | 423 | 4 files changed, 31 insertions(+), 2 deletions(-) | 
|---|
|  | 424 |  | 
|---|
|  | 425 | diff --git a/acinclude.m4 b/acinclude.m4 | 
|---|
|  | 426 | index 20fd15e..d99c755 100644 | 
|---|
|  | 427 | --- a/acinclude.m4 | 
|---|
|  | 428 | +++ b/acinclude.m4 | 
|---|
|  | 429 | @@ -960,6 +960,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) | 
|---|
|  | 430 | LINUX_IOP_CREATE_TAKES_UMODE_T | 
|---|
|  | 431 | LINUX_EXPORT_OP_ENCODE_FH_TAKES_INODES | 
|---|
|  | 432 | LINUX_KMAP_ATOMIC_TAKES_NO_KM_TYPE | 
|---|
|  | 433 | +                LINUX_DENTRY_OPEN_TAKES_PATH | 
|---|
|  | 434 |  | 
|---|
|  | 435 | dnl If we are guaranteed that keyrings will work - that is | 
|---|
|  | 436 | dnl  a) The kernel has keyrings enabled | 
|---|
|  | 437 | diff --git a/src/afs/LINUX/osi_compat.h b/src/afs/LINUX/osi_compat.h | 
|---|
|  | 438 | index 4c7c261..84fcaa5 100644 | 
|---|
|  | 439 | --- a/src/afs/LINUX/osi_compat.h | 
|---|
|  | 440 | +++ b/src/afs/LINUX/osi_compat.h | 
|---|
|  | 441 | @@ -445,4 +445,20 @@ afs_get_dentry_ref(struct path *path, struct vfsmount **mnt, struct dentry **dpp | 
|---|
|  | 442 | #endif | 
|---|
|  | 443 | } | 
|---|
|  | 444 |  | 
|---|
|  | 445 | +#if defined(STRUCT_TASK_STRUCT_HAS_CRED) | 
|---|
|  | 446 | +static inline struct file * | 
|---|
|  | 447 | +afs_dentry_open(struct dentry *dp, struct vfsmount *mnt, int flags, const struct cred *creds) { | 
|---|
|  | 448 | +#if defined(DENTRY_OPEN_TAKES_PATH) | 
|---|
|  | 449 | +    struct path path; | 
|---|
|  | 450 | +    struct file *filp; | 
|---|
|  | 451 | +    path.mnt = mnt; | 
|---|
|  | 452 | +    path.dentry = dp; | 
|---|
|  | 453 | +    filp = dentry_open(&path, flags, creds); | 
|---|
|  | 454 | +    return filp; | 
|---|
|  | 455 | +#else | 
|---|
|  | 456 | +    return dentry_open(dp, mntget(mnt), flags, creds); | 
|---|
|  | 457 | +#endif | 
|---|
|  | 458 | +} | 
|---|
|  | 459 | +#endif | 
|---|
|  | 460 | + | 
|---|
|  | 461 | #endif /* AFS_LINUX_OSI_COMPAT_H */ | 
|---|
|  | 462 | diff --git a/src/afs/LINUX/osi_file.c b/src/afs/LINUX/osi_file.c | 
|---|
|  | 463 | index 3c20fd9..27806ab 100644 | 
|---|
|  | 464 | --- a/src/afs/LINUX/osi_file.c | 
|---|
|  | 465 | +++ b/src/afs/LINUX/osi_file.c | 
|---|
|  | 466 | @@ -56,9 +56,9 @@ afs_linux_raw_open(afs_dcache_id_t *ainode) | 
|---|
|  | 467 |  | 
|---|
|  | 468 | #if defined(STRUCT_TASK_STRUCT_HAS_CRED) | 
|---|
|  | 469 | /* Use stashed credentials - prevent selinux/apparmor problems  */ | 
|---|
|  | 470 | -    filp = dentry_open(dp, mntget(afs_cacheMnt), O_RDWR, cache_creds); | 
|---|
|  | 471 | +    filp = afs_dentry_open(dp, mntget(afs_cacheMnt), O_RDWR, cache_creds); | 
|---|
|  | 472 | if (IS_ERR(filp)) | 
|---|
|  | 473 | -       filp = dentry_open(dp, mntget(afs_cacheMnt), O_RDWR, current_cred()); | 
|---|
|  | 474 | +       filp = afs_dentry_open(dp, mntget(afs_cacheMnt), O_RDWR, current_cred()); | 
|---|
|  | 475 | #else | 
|---|
|  | 476 | filp = dentry_open(dp, mntget(afs_cacheMnt), O_RDWR); | 
|---|
|  | 477 | #endif | 
|---|
|  | 478 | diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 | 
|---|
|  | 479 | index 7db805f..427c5e1 100644 | 
|---|
|  | 480 | --- a/src/cf/linux-test4.m4 | 
|---|
|  | 481 | +++ b/src/cf/linux-test4.m4 | 
|---|
|  | 482 | @@ -687,3 +687,15 @@ AC_DEFUN([LINUX_KMAP_ATOMIC_TAKES_NO_KM_TYPE], [ | 
|---|
|  | 483 | [define if kmap_atomic takes no km_type argument], | 
|---|
|  | 484 | [-Werror]) | 
|---|
|  | 485 | ]) | 
|---|
|  | 486 | + | 
|---|
|  | 487 | + | 
|---|
|  | 488 | +AC_DEFUN([LINUX_DENTRY_OPEN_TAKES_PATH], [ | 
|---|
|  | 489 | +  AC_CHECK_LINUX_BUILD([whether dentry_open takes a path argument], | 
|---|
|  | 490 | +                       [ac_cv_linux_dentry_open_takes_path], | 
|---|
|  | 491 | +                       [#include <linux/fs.h>], | 
|---|
|  | 492 | +                       [struct path p; | 
|---|
|  | 493 | +                       dentry_open(&p, 0, NULL);], | 
|---|
|  | 494 | +                       [DENTRY_OPEN_TAKES_PATH], | 
|---|
|  | 495 | +                       [define if dentry_open takes a path argument], | 
|---|
|  | 496 | +                       [-Werror]) | 
|---|
|  | 497 | +]) | 
|---|
|  | 498 | -- | 
|---|
|  | 499 | 1.8.0 | 
|---|
|  | 500 |  | 
|---|
|  | 501 |  | 
|---|
|  | 502 | From 1aebd8757ba9684e0be18d722797a594146cefce Mon Sep 17 00:00:00 2001 | 
|---|
|  | 503 | From: Marc Dionne <marc.c.dionne@gmail.com> | 
|---|
|  | 504 | Date: Mon, 13 Aug 2012 21:55:25 -0400 | 
|---|
|  | 505 | Subject: [PATCH 07/12] Linux 3.6: d_alias and i_dentry are now hlists | 
|---|
|  | 506 |  | 
|---|
|  | 507 | The d_alias pointer is now the head of an hlist.  This means the | 
|---|
|  | 508 | iterator is a different macro and has no "reverse" version since | 
|---|
|  | 509 | hlists have no direct pointer to the list tail. | 
|---|
|  | 510 |  | 
|---|
|  | 511 | inode->i_dentry gets the same treatment.  Adjust where we use it. | 
|---|
|  | 512 |  | 
|---|
|  | 513 | Reviewed-on: http://gerrit.openafs.org/7983 | 
|---|
|  | 514 | Tested-by: BuildBot <buildbot@rampaginggeek.com> | 
|---|
|  | 515 | Reviewed-by: Derrick Brashear <shadow@dementix.org> | 
|---|
|  | 516 | (cherry picked from commit 6bea047fb404bde828c6358ae06f7941aa2bc959) | 
|---|
|  | 517 |  | 
|---|
|  | 518 | Change-Id: I7e7b87e5f5c240f3f0ff25fa723c857ab9d0108c | 
|---|
|  | 519 | Reviewed-on: http://gerrit.openafs.org/8080 | 
|---|
|  | 520 | Reviewed-by: Derrick Brashear <shadow@your-file-system.com> | 
|---|
|  | 521 | Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com> | 
|---|
|  | 522 | Tested-by: BuildBot <buildbot@rampaginggeek.com> | 
|---|
|  | 523 | (cherry picked from commit b5a66fb391b47848f023042e96c87a1b7d49b888) | 
|---|
|  | 524 | --- | 
|---|
|  | 525 | acinclude.m4               |  1 + | 
|---|
|  | 526 | src/afs/LINUX/osi_vcache.c | 12 ++++++++++++ | 
|---|
|  | 527 | src/afs/afs_daemons.c      |  5 +++++ | 
|---|
|  | 528 | src/cf/linux-test4.m4      | 13 +++++++++++++ | 
|---|
|  | 529 | 4 files changed, 31 insertions(+) | 
|---|
|  | 530 |  | 
|---|
|  | 531 | diff --git a/acinclude.m4 b/acinclude.m4 | 
|---|
|  | 532 | index d99c755..d52d149 100644 | 
|---|
|  | 533 | --- a/acinclude.m4 | 
|---|
|  | 534 | +++ b/acinclude.m4 | 
|---|
|  | 535 | @@ -961,6 +961,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) | 
|---|
|  | 536 | LINUX_EXPORT_OP_ENCODE_FH_TAKES_INODES | 
|---|
|  | 537 | LINUX_KMAP_ATOMIC_TAKES_NO_KM_TYPE | 
|---|
|  | 538 | LINUX_DENTRY_OPEN_TAKES_PATH | 
|---|
|  | 539 | +                LINUX_D_ALIAS_IS_HLIST | 
|---|
|  | 540 |  | 
|---|
|  | 541 | dnl If we are guaranteed that keyrings will work - that is | 
|---|
|  | 542 | dnl  a) The kernel has keyrings enabled | 
|---|
|  | 543 | diff --git a/src/afs/LINUX/osi_vcache.c b/src/afs/LINUX/osi_vcache.c | 
|---|
|  | 544 | index e82d78e..cd61c65 100644 | 
|---|
|  | 545 | --- a/src/afs/LINUX/osi_vcache.c | 
|---|
|  | 546 | +++ b/src/afs/LINUX/osi_vcache.c | 
|---|
|  | 547 | @@ -19,7 +19,11 @@ osi_TryEvictVCache(struct vcache *avc, int *slept, int defersleep) { | 
|---|
|  | 548 |  | 
|---|
|  | 549 | struct dentry *dentry; | 
|---|
|  | 550 | struct inode *inode = AFSTOV(avc); | 
|---|
|  | 551 | +#if defined(D_ALIAS_IS_HLIST) | 
|---|
|  | 552 | +    struct hlist_node *cur, *head; | 
|---|
|  | 553 | +#else | 
|---|
|  | 554 | struct list_head *cur, *head; | 
|---|
|  | 555 | +#endif | 
|---|
|  | 556 |  | 
|---|
|  | 557 | /* First, see if we can evict the inode from the dcache */ | 
|---|
|  | 558 | if (defersleep && avc != afs_globalVp && VREFCOUNT(avc) > 1 && avc->opens == 0) { | 
|---|
|  | 559 | @@ -53,12 +57,20 @@ restart: | 
|---|
|  | 560 | spin_unlock(&dcache_lock); | 
|---|
|  | 561 | #else /* HAVE_DCACHE_LOCK */ | 
|---|
|  | 562 | spin_lock(&inode->i_lock); | 
|---|
|  | 563 | +#if defined(D_ALIAS_IS_HLIST) | 
|---|
|  | 564 | +       head = inode->i_dentry.first; | 
|---|
|  | 565 | +#else | 
|---|
|  | 566 | head = &inode->i_dentry; | 
|---|
|  | 567 | +#endif | 
|---|
|  | 568 |  | 
|---|
|  | 569 | restart: | 
|---|
|  | 570 | cur = head; | 
|---|
|  | 571 | while ((cur = cur->next) != head) { | 
|---|
|  | 572 | +#if defined(D_ALIAS_IS_HLIST) | 
|---|
|  | 573 | +           dentry = hlist_entry(cur, struct dentry, d_alias); | 
|---|
|  | 574 | +#else | 
|---|
|  | 575 | dentry = list_entry(cur, struct dentry, d_alias); | 
|---|
|  | 576 | +#endif | 
|---|
|  | 577 |  | 
|---|
|  | 578 | spin_lock(&dentry->d_lock); | 
|---|
|  | 579 | if (d_unhashed(dentry)) { | 
|---|
|  | 580 | diff --git a/src/afs/afs_daemons.c b/src/afs/afs_daemons.c | 
|---|
|  | 581 | index 23655e3..f47be0e 100644 | 
|---|
|  | 582 | --- a/src/afs/afs_daemons.c | 
|---|
|  | 583 | +++ b/src/afs/afs_daemons.c | 
|---|
|  | 584 | @@ -396,8 +396,13 @@ afs_CheckRootVolume(void) | 
|---|
|  | 585 | spin_lock(&dp->d_lock); | 
|---|
|  | 586 | #endif | 
|---|
|  | 587 | #endif | 
|---|
|  | 588 | +#if defined(D_ALIAS_IS_HLIST) | 
|---|
|  | 589 | +                   hlist_del_init(&dp->d_alias); | 
|---|
|  | 590 | +                   hlist_add_head(&dp->d_alias, &(AFSTOV(vcp)->i_dentry)); | 
|---|
|  | 591 | +#else | 
|---|
|  | 592 | list_del_init(&dp->d_alias); | 
|---|
|  | 593 | list_add(&dp->d_alias, &(AFSTOV(vcp)->i_dentry)); | 
|---|
|  | 594 | +#endif | 
|---|
|  | 595 | dp->d_inode = AFSTOV(vcp); | 
|---|
|  | 596 | #if defined(AFS_LINUX24_ENV) | 
|---|
|  | 597 | #if defined(AFS_LINUX26_ENV) | 
|---|
|  | 598 | diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 | 
|---|
|  | 599 | index 427c5e1..6b70059 100644 | 
|---|
|  | 600 | --- a/src/cf/linux-test4.m4 | 
|---|
|  | 601 | +++ b/src/cf/linux-test4.m4 | 
|---|
|  | 602 | @@ -699,3 +699,16 @@ AC_DEFUN([LINUX_DENTRY_OPEN_TAKES_PATH], [ | 
|---|
|  | 603 | [define if dentry_open takes a path argument], | 
|---|
|  | 604 | [-Werror]) | 
|---|
|  | 605 | ]) | 
|---|
|  | 606 | + | 
|---|
|  | 607 | + | 
|---|
|  | 608 | +AC_DEFUN([LINUX_D_ALIAS_IS_HLIST], [ | 
|---|
|  | 609 | +  AC_CHECK_LINUX_BUILD([whether dentry->d_alias is an hlist], | 
|---|
|  | 610 | +                       [ac_cv_linux_d_alias_is_hlist], | 
|---|
|  | 611 | +                       [#include <linux/fs.h>], | 
|---|
|  | 612 | +                       [struct dentry *d = NULL; | 
|---|
|  | 613 | +                       struct hlist_node *hn = NULL; | 
|---|
|  | 614 | +                       d->d_alias = *hn;], | 
|---|
|  | 615 | +                       [D_ALIAS_IS_HLIST], | 
|---|
|  | 616 | +                       [define if dentry->d_alias is an hlist], | 
|---|
|  | 617 | +                       []) | 
|---|
|  | 618 | +]) | 
|---|
|  | 619 | -- | 
|---|
|  | 620 | 1.8.0 | 
|---|
|  | 621 |  | 
|---|
|  | 622 |  | 
|---|
|  | 623 | From 10f8f641542d9bc16c9a9c953324fa9d89b81607 Mon Sep 17 00:00:00 2001 | 
|---|
|  | 624 | From: Marc Dionne <marc.c.dionne@gmail.com> | 
|---|
|  | 625 | Date: Tue, 14 Aug 2012 17:11:08 -0400 | 
|---|
|  | 626 | Subject: [PATCH 08/12] Linux: fix variable used to test for the iop create | 
|---|
|  | 627 | API | 
|---|
|  | 628 |  | 
|---|
|  | 629 | Use correct variable when testing for the create API to use. | 
|---|
|  | 630 |  | 
|---|
|  | 631 | This is just for looks - there is no effect since mkdir and create | 
|---|
|  | 632 | were changed in the same kernel release. | 
|---|
|  | 633 |  | 
|---|
|  | 634 | Reviewed-on: http://gerrit.openafs.org/7984 | 
|---|
|  | 635 | Reviewed-by: Alistair Ferguson <alistair.ferguson@mac.com> | 
|---|
|  | 636 | Tested-by: BuildBot <buildbot@rampaginggeek.com> | 
|---|
|  | 637 | Reviewed-by: Derrick Brashear <shadow@dementix.org> | 
|---|
|  | 638 | (cherry picked from commit c633a92a1bc7881f18ee641082ff2efe7da1a8cb) | 
|---|
|  | 639 |  | 
|---|
|  | 640 | Change-Id: Ib23fe9a34bc07227614c149b0f16d3b0a067501b | 
|---|
|  | 641 | Reviewed-on: http://gerrit.openafs.org/8081 | 
|---|
|  | 642 | Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com> | 
|---|
|  | 643 | Tested-by: BuildBot <buildbot@rampaginggeek.com> | 
|---|
|  | 644 | Reviewed-by: Derrick Brashear <shadow@your-file-system.com> | 
|---|
|  | 645 | (cherry picked from commit aecd183acb34a0a9b850fb69eed472d2c9a27612) | 
|---|
|  | 646 | --- | 
|---|
|  | 647 | src/afs/LINUX/osi_vnodeops.c | 2 +- | 
|---|
|  | 648 | 1 file changed, 1 insertion(+), 1 deletion(-) | 
|---|
|  | 649 |  | 
|---|
|  | 650 | diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c | 
|---|
|  | 651 | index 4cda547..b3bf115 100644 | 
|---|
|  | 652 | --- a/src/afs/LINUX/osi_vnodeops.c | 
|---|
|  | 653 | +++ b/src/afs/LINUX/osi_vnodeops.c | 
|---|
|  | 654 | @@ -1094,7 +1094,7 @@ struct dentry_operations afs_dentry_operations = { | 
|---|
|  | 655 | * name is in kernel space at this point. | 
|---|
|  | 656 | */ | 
|---|
|  | 657 | static int | 
|---|
|  | 658 | -#if defined(IOP_MKDIR_TAKES_UMODE_T) | 
|---|
|  | 659 | +#if defined(IOP_CREATE_TAKES_UMODE_T) | 
|---|
|  | 660 | afs_linux_create(struct inode *dip, struct dentry *dp, umode_t mode, | 
|---|
|  | 661 | struct nameidata *nd) | 
|---|
|  | 662 | #else | 
|---|
|  | 663 | -- | 
|---|
|  | 664 | 1.8.0 | 
|---|
|  | 665 |  | 
|---|
|  | 666 |  | 
|---|
|  | 667 | From 6cbb9a258b73c28c0295f93b75cbd437efe3713a Mon Sep 17 00:00:00 2001 | 
|---|
|  | 668 | From: Marc Dionne <marc.c.dionne@gmail.com> | 
|---|
|  | 669 | Date: Tue, 14 Aug 2012 17:28:50 -0400 | 
|---|
|  | 670 | Subject: [PATCH 09/12] Linux 3.6: create inode operation API change | 
|---|
|  | 671 |  | 
|---|
|  | 672 | The nameidata argument is dropped and a flag is added. | 
|---|
|  | 673 |  | 
|---|
|  | 674 | Reviewed-on: http://gerrit.openafs.org/7985 | 
|---|
|  | 675 | Tested-by: BuildBot <buildbot@rampaginggeek.com> | 
|---|
|  | 676 | Reviewed-by: Derrick Brashear <shadow@dementix.org> | 
|---|
|  | 677 | (cherry picked from commit 020e32779c103817ca89caa51259fb53bc3dde79) | 
|---|
|  | 678 |  | 
|---|
|  | 679 | Change-Id: Iae2a0301a1c4acb6835eb0bdca6ae22b143b2cda | 
|---|
|  | 680 | Reviewed-on: http://gerrit.openafs.org/8082 | 
|---|
|  | 681 | Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com> | 
|---|
|  | 682 | Tested-by: BuildBot <buildbot@rampaginggeek.com> | 
|---|
|  | 683 | Reviewed-by: Derrick Brashear <shadow@your-file-system.com> | 
|---|
|  | 684 | (cherry picked from commit 5210d97865d974d5e14f68eec6a58b292d6b7893) | 
|---|
|  | 685 | --- | 
|---|
|  | 686 | acinclude.m4                 |  1 + | 
|---|
|  | 687 | src/afs/LINUX/osi_vnodeops.c |  9 +++++---- | 
|---|
|  | 688 | src/cf/linux-test4.m4        | 15 +++++++++++++++ | 
|---|
|  | 689 | 3 files changed, 21 insertions(+), 4 deletions(-) | 
|---|
|  | 690 |  | 
|---|
|  | 691 | diff --git a/acinclude.m4 b/acinclude.m4 | 
|---|
|  | 692 | index d52d149..1c84354 100644 | 
|---|
|  | 693 | --- a/acinclude.m4 | 
|---|
|  | 694 | +++ b/acinclude.m4 | 
|---|
|  | 695 | @@ -962,6 +962,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) | 
|---|
|  | 696 | LINUX_KMAP_ATOMIC_TAKES_NO_KM_TYPE | 
|---|
|  | 697 | LINUX_DENTRY_OPEN_TAKES_PATH | 
|---|
|  | 698 | LINUX_D_ALIAS_IS_HLIST | 
|---|
|  | 699 | +                LINUX_IOP_I_CREATE_TAKES_BOOL | 
|---|
|  | 700 |  | 
|---|
|  | 701 | dnl If we are guaranteed that keyrings will work - that is | 
|---|
|  | 702 | dnl  a) The kernel has keyrings enabled | 
|---|
|  | 703 | diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c | 
|---|
|  | 704 | index b3bf115..8c8045b 100644 | 
|---|
|  | 705 | --- a/src/afs/LINUX/osi_vnodeops.c | 
|---|
|  | 706 | +++ b/src/afs/LINUX/osi_vnodeops.c | 
|---|
|  | 707 | @@ -1094,17 +1094,18 @@ struct dentry_operations afs_dentry_operations = { | 
|---|
|  | 708 | * name is in kernel space at this point. | 
|---|
|  | 709 | */ | 
|---|
|  | 710 | static int | 
|---|
|  | 711 | -#if defined(IOP_CREATE_TAKES_UMODE_T) | 
|---|
|  | 712 | +#if defined(IOP_CREATE_TAKES_BOOL) | 
|---|
|  | 713 | +afs_linux_create(struct inode *dip, struct dentry *dp, umode_t mode, | 
|---|
|  | 714 | +                bool excl) | 
|---|
|  | 715 | +#elif defined(IOP_CREATE_TAKES_UMODE_T) | 
|---|
|  | 716 | afs_linux_create(struct inode *dip, struct dentry *dp, umode_t mode, | 
|---|
|  | 717 | struct nameidata *nd) | 
|---|
|  | 718 | -#else | 
|---|
|  | 719 | -#ifdef IOP_CREATE_TAKES_NAMEIDATA | 
|---|
|  | 720 | +#elif defined(IOP_CREATE_TAKES_NAMEIDATA) | 
|---|
|  | 721 | afs_linux_create(struct inode *dip, struct dentry *dp, int mode, | 
|---|
|  | 722 | struct nameidata *nd) | 
|---|
|  | 723 | #else | 
|---|
|  | 724 | afs_linux_create(struct inode *dip, struct dentry *dp, int mode) | 
|---|
|  | 725 | #endif | 
|---|
|  | 726 | -#endif | 
|---|
|  | 727 | { | 
|---|
|  | 728 | struct vattr vattr; | 
|---|
|  | 729 | cred_t *credp = crref(); | 
|---|
|  | 730 | diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 | 
|---|
|  | 731 | index 6b70059..dc30770 100644 | 
|---|
|  | 732 | --- a/src/cf/linux-test4.m4 | 
|---|
|  | 733 | +++ b/src/cf/linux-test4.m4 | 
|---|
|  | 734 | @@ -712,3 +712,18 @@ AC_DEFUN([LINUX_D_ALIAS_IS_HLIST], [ | 
|---|
|  | 735 | [define if dentry->d_alias is an hlist], | 
|---|
|  | 736 | []) | 
|---|
|  | 737 | ]) | 
|---|
|  | 738 | + | 
|---|
|  | 739 | + | 
|---|
|  | 740 | +AC_DEFUN([LINUX_IOP_I_CREATE_TAKES_BOOL], [ | 
|---|
|  | 741 | +  AC_CHECK_LINUX_BUILD([whether inode_operations.create takes a bool], | 
|---|
|  | 742 | +                       [ac_cv_linux_func_i_create_takes_bool], | 
|---|
|  | 743 | +                       [#include <linux/fs.h> | 
|---|
|  | 744 | +                       #include <linux/namei.h>], | 
|---|
|  | 745 | +                       [struct inode _inode = {}; | 
|---|
|  | 746 | +                       struct dentry _dentry; | 
|---|
|  | 747 | +                       bool b = true; | 
|---|
|  | 748 | +                       (void)_inode.i_op->create(&_inode, &_dentry, 0, b);], | 
|---|
|  | 749 | +                      [IOP_CREATE_TAKES_BOOL], | 
|---|
|  | 750 | +                      [define if your iops.create takes a bool argument], | 
|---|
|  | 751 | +                      [-Werror]) | 
|---|
|  | 752 | +]) | 
|---|
|  | 753 | -- | 
|---|
|  | 754 | 1.8.0 | 
|---|
|  | 755 |  | 
|---|
|  | 756 |  | 
|---|
|  | 757 | From ebfd3de107e0dd97127aa12e572684cc98a457cf Mon Sep 17 00:00:00 2001 | 
|---|
|  | 758 | From: Marc Dionne <marc.c.dionne@gmail.com> | 
|---|
|  | 759 | Date: Tue, 14 Aug 2012 18:08:51 -0400 | 
|---|
|  | 760 | Subject: [PATCH 10/12] Linux 3.6: revalidate dentry op API change | 
|---|
|  | 761 |  | 
|---|
|  | 762 | The nameidata argument is dropped, replaced by an unsigned flags | 
|---|
|  | 763 | value.  The configure test is very specific; kernels with the | 
|---|
|  | 764 | older API with a signed int flags value should fall through. | 
|---|
|  | 765 |  | 
|---|
|  | 766 | Reviewed-on: http://gerrit.openafs.org/7986 | 
|---|
|  | 767 | Tested-by: BuildBot <buildbot@rampaginggeek.com> | 
|---|
|  | 768 | Reviewed-by: Derrick Brashear <shadow@dementix.org> | 
|---|
|  | 769 | (cherry picked from commit 7413cd09a53f89882a46fd100bf6c501348f2188) | 
|---|
|  | 770 |  | 
|---|
|  | 771 | Change-Id: Ie68d70dcf414d24e7e980c8a8f35b83550d2da7c | 
|---|
|  | 772 | Reviewed-on: http://gerrit.openafs.org/8083 | 
|---|
|  | 773 | Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com> | 
|---|
|  | 774 | Tested-by: BuildBot <buildbot@rampaginggeek.com> | 
|---|
|  | 775 | Reviewed-by: Derrick Brashear <shadow@your-file-system.com> | 
|---|
|  | 776 | (cherry picked from commit 4ab59d7ee924a6be1d553f75a67b0b253cc85e88) | 
|---|
|  | 777 | --- | 
|---|
|  | 778 | acinclude.m4                 |  1 + | 
|---|
|  | 779 | src/afs/LINUX/osi_vnodeops.c |  8 +++++++- | 
|---|
|  | 780 | src/cf/linux-test4.m4        | 14 ++++++++++++++ | 
|---|
|  | 781 | 3 files changed, 22 insertions(+), 1 deletion(-) | 
|---|
|  | 782 |  | 
|---|
|  | 783 | diff --git a/acinclude.m4 b/acinclude.m4 | 
|---|
|  | 784 | index 1c84354..8bb5bf7 100644 | 
|---|
|  | 785 | --- a/acinclude.m4 | 
|---|
|  | 786 | +++ b/acinclude.m4 | 
|---|
|  | 787 | @@ -963,6 +963,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) | 
|---|
|  | 788 | LINUX_DENTRY_OPEN_TAKES_PATH | 
|---|
|  | 789 | LINUX_D_ALIAS_IS_HLIST | 
|---|
|  | 790 | LINUX_IOP_I_CREATE_TAKES_BOOL | 
|---|
|  | 791 | +                LINUX_DOP_D_REVALIDATE_TAKES_UNSIGNED | 
|---|
|  | 792 |  | 
|---|
|  | 793 | dnl If we are guaranteed that keyrings will work - that is | 
|---|
|  | 794 | dnl  a) The kernel has keyrings enabled | 
|---|
|  | 795 | diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c | 
|---|
|  | 796 | index 8c8045b..49f8b96 100644 | 
|---|
|  | 797 | --- a/src/afs/LINUX/osi_vnodeops.c | 
|---|
|  | 798 | +++ b/src/afs/LINUX/osi_vnodeops.c | 
|---|
|  | 799 | @@ -906,7 +906,9 @@ afs_linux_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat *sta | 
|---|
|  | 800 | * later on, we shouldn't have to do it until later. Perhaps in the future.. | 
|---|
|  | 801 | */ | 
|---|
|  | 802 | static int | 
|---|
|  | 803 | -#ifdef DOP_REVALIDATE_TAKES_NAMEIDATA | 
|---|
|  | 804 | +#if defined(DOP_REVALIDATE_TAKES_UNSIGNED) | 
|---|
|  | 805 | +afs_linux_dentry_revalidate(struct dentry *dp, unsigned int flags) | 
|---|
|  | 806 | +#elif defined(DOP_REVALIDATE_TAKES_NAMEIDATA) | 
|---|
|  | 807 | afs_linux_dentry_revalidate(struct dentry *dp, struct nameidata *nd) | 
|---|
|  | 808 | #else | 
|---|
|  | 809 | afs_linux_dentry_revalidate(struct dentry *dp, int flags) | 
|---|
|  | 810 | @@ -921,7 +923,11 @@ afs_linux_dentry_revalidate(struct dentry *dp, int flags) | 
|---|
|  | 811 |  | 
|---|
|  | 812 | #ifdef LOOKUP_RCU | 
|---|
|  | 813 | /* We don't support RCU path walking */ | 
|---|
|  | 814 | +# if defined(DOP_REVALIDATE_TAKES_UNSIGNED) | 
|---|
|  | 815 | +    if (flags & LOOKUP_RCU) | 
|---|
|  | 816 | +# else | 
|---|
|  | 817 | if (nd->flags & LOOKUP_RCU) | 
|---|
|  | 818 | +# endif | 
|---|
|  | 819 | return -ECHILD; | 
|---|
|  | 820 | #endif | 
|---|
|  | 821 | AFS_GLOCK(); | 
|---|
|  | 822 | diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 | 
|---|
|  | 823 | index dc30770..4a6ec02 100644 | 
|---|
|  | 824 | --- a/src/cf/linux-test4.m4 | 
|---|
|  | 825 | +++ b/src/cf/linux-test4.m4 | 
|---|
|  | 826 | @@ -727,3 +727,17 @@ AC_DEFUN([LINUX_IOP_I_CREATE_TAKES_BOOL], [ | 
|---|
|  | 827 | [define if your iops.create takes a bool argument], | 
|---|
|  | 828 | [-Werror]) | 
|---|
|  | 829 | ]) | 
|---|
|  | 830 | + | 
|---|
|  | 831 | + | 
|---|
|  | 832 | +AC_DEFUN([LINUX_DOP_D_REVALIDATE_TAKES_UNSIGNED], [ | 
|---|
|  | 833 | +  AC_CHECK_LINUX_BUILD([whether dentry_operations.d_revalidate takes an unsigned int], | 
|---|
|  | 834 | +                       [ac_cv_linux_func_d_revalidate_takes_unsigned], | 
|---|
|  | 835 | +                       [#include <linux/fs.h> | 
|---|
|  | 836 | +                       #include <linux/namei.h>], | 
|---|
|  | 837 | +                       [struct dentry_operations dops; | 
|---|
|  | 838 | +                       int reval(struct dentry *d, unsigned int i) { return 0; }; | 
|---|
|  | 839 | +                       dops.d_revalidate = reval;], | 
|---|
|  | 840 | +                      [DOP_REVALIDATE_TAKES_UNSIGNED], | 
|---|
|  | 841 | +                      [define if your dops.d_revalidate takes an unsigned int argument], | 
|---|
|  | 842 | +                      [-Werror]) | 
|---|
|  | 843 | +]) | 
|---|
|  | 844 | -- | 
|---|
|  | 845 | 1.8.0 | 
|---|
|  | 846 |  | 
|---|
|  | 847 |  | 
|---|
|  | 848 | From 208d7925bd59490712bfd6bedc41ba5e3a8f4a6c Mon Sep 17 00:00:00 2001 | 
|---|
|  | 849 | From: Marc Dionne <marc.c.dionne@gmail.com> | 
|---|
|  | 850 | Date: Tue, 14 Aug 2012 18:26:24 -0400 | 
|---|
|  | 851 | Subject: [PATCH 11/12] Linux 3.6: lookup inode operation API change | 
|---|
|  | 852 |  | 
|---|
|  | 853 | The nameidata argument is replaced with an unsigned int flags | 
|---|
|  | 854 | argument. | 
|---|
|  | 855 |  | 
|---|
|  | 856 | Reviewed-on: http://gerrit.openafs.org/7987 | 
|---|
|  | 857 | Tested-by: BuildBot <buildbot@rampaginggeek.com> | 
|---|
|  | 858 | Reviewed-by: Derrick Brashear <shadow@dementix.org> | 
|---|
|  | 859 | (cherry picked from commit ec48dca871ef98adb69792a34047c6be5818f1b2) | 
|---|
|  | 860 |  | 
|---|
|  | 861 | Change-Id: Ic8be26141ede6e1c4062872c79a846efb0045bda | 
|---|
|  | 862 | Reviewed-on: http://gerrit.openafs.org/8084 | 
|---|
|  | 863 | Reviewed-by: Ken Dreyer <ktdreyer@ktdreyer.com> | 
|---|
|  | 864 | Tested-by: BuildBot <buildbot@rampaginggeek.com> | 
|---|
|  | 865 | Reviewed-by: Derrick Brashear <shadow@your-file-system.com> | 
|---|
|  | 866 | (cherry picked from commit 6c22f2e1de91fa3080221df22fdcd05064b57307) | 
|---|
|  | 867 | --- | 
|---|
|  | 868 | acinclude.m4                 |  1 + | 
|---|
|  | 869 | src/afs/LINUX/osi_vnodeops.c |  5 ++++- | 
|---|
|  | 870 | src/cf/linux-test4.m4        | 14 ++++++++++++++ | 
|---|
|  | 871 | 3 files changed, 19 insertions(+), 1 deletion(-) | 
|---|
|  | 872 |  | 
|---|
|  | 873 | diff --git a/acinclude.m4 b/acinclude.m4 | 
|---|
|  | 874 | index 8bb5bf7..4b49449 100644 | 
|---|
|  | 875 | --- a/acinclude.m4 | 
|---|
|  | 876 | +++ b/acinclude.m4 | 
|---|
|  | 877 | @@ -964,6 +964,7 @@ case $AFS_SYSNAME in *_linux* | *_umlinux*) | 
|---|
|  | 878 | LINUX_D_ALIAS_IS_HLIST | 
|---|
|  | 879 | LINUX_IOP_I_CREATE_TAKES_BOOL | 
|---|
|  | 880 | LINUX_DOP_D_REVALIDATE_TAKES_UNSIGNED | 
|---|
|  | 881 | +                LINUX_IOP_LOOKUP_TAKES_UNSIGNED | 
|---|
|  | 882 |  | 
|---|
|  | 883 | dnl If we are guaranteed that keyrings will work - that is | 
|---|
|  | 884 | dnl  a) The kernel has keyrings enabled | 
|---|
|  | 885 | diff --git a/src/afs/LINUX/osi_vnodeops.c b/src/afs/LINUX/osi_vnodeops.c | 
|---|
|  | 886 | index 49f8b96..c376bd1 100644 | 
|---|
|  | 887 | --- a/src/afs/LINUX/osi_vnodeops.c | 
|---|
|  | 888 | +++ b/src/afs/LINUX/osi_vnodeops.c | 
|---|
|  | 889 | @@ -1147,7 +1147,10 @@ afs_linux_create(struct inode *dip, struct dentry *dp, int mode) | 
|---|
|  | 890 |  | 
|---|
|  | 891 | /* afs_linux_lookup */ | 
|---|
|  | 892 | static struct dentry * | 
|---|
|  | 893 | -#ifdef IOP_LOOKUP_TAKES_NAMEIDATA | 
|---|
|  | 894 | +#if defined(IOP_LOOKUP_TAKES_UNSIGNED) | 
|---|
|  | 895 | +afs_linux_lookup(struct inode *dip, struct dentry *dp, | 
|---|
|  | 896 | +                unsigned flags) | 
|---|
|  | 897 | +#elif defined(IOP_LOOKUP_TAKES_NAMEIDATA) | 
|---|
|  | 898 | afs_linux_lookup(struct inode *dip, struct dentry *dp, | 
|---|
|  | 899 | struct nameidata *nd) | 
|---|
|  | 900 | #else | 
|---|
|  | 901 | diff --git a/src/cf/linux-test4.m4 b/src/cf/linux-test4.m4 | 
|---|
|  | 902 | index 4a6ec02..fc0149f 100644 | 
|---|
|  | 903 | --- a/src/cf/linux-test4.m4 | 
|---|
|  | 904 | +++ b/src/cf/linux-test4.m4 | 
|---|
|  | 905 | @@ -741,3 +741,17 @@ AC_DEFUN([LINUX_DOP_D_REVALIDATE_TAKES_UNSIGNED], [ | 
|---|
|  | 906 | [define if your dops.d_revalidate takes an unsigned int argument], | 
|---|
|  | 907 | [-Werror]) | 
|---|
|  | 908 | ]) | 
|---|
|  | 909 | + | 
|---|
|  | 910 | + | 
|---|
|  | 911 | +AC_DEFUN([LINUX_IOP_LOOKUP_TAKES_UNSIGNED], [ | 
|---|
|  | 912 | +  AC_CHECK_LINUX_BUILD([whether inode operation lookup takes an unsigned int], | 
|---|
|  | 913 | +                       [ac_cv_linux_func_lookup_takes_unsigned], | 
|---|
|  | 914 | +                       [#include <linux/fs.h> | 
|---|
|  | 915 | +                       #include <linux/namei.h>], | 
|---|
|  | 916 | +                       [struct inode_operations iops; | 
|---|
|  | 917 | +                       struct dentry *look(struct inode *i, struct dentry *d, unsigned int j) { return NULL; }; | 
|---|
|  | 918 | +                       iops.lookup = look;], | 
|---|
|  | 919 | +                      [IOP_LOOKUP_TAKES_UNSIGNED], | 
|---|
|  | 920 | +                      [define if your iops.lookup takes an unsigned int argument], | 
|---|
|  | 921 | +                      [-Werror]) | 
|---|
|  | 922 | +]) | 
|---|
|  | 923 | -- | 
|---|
|  | 924 | 1.8.0 | 
|---|
|  | 925 |  | 
|---|
|  | 926 |  | 
|---|
|  | 927 | From 6c53a1dea7d8fe3174405febf2bf7b98a219824d Mon Sep 17 00:00:00 2001 | 
|---|
|  | 928 | From: Marc Dionne <marc.c.dionne@gmail.com> | 
|---|
|  | 929 | Date: Fri, 12 Oct 2012 16:25:43 -0400 | 
|---|
|  | 930 | Subject: [PATCH 12/12] Linux: osi_vcache: Fix loop for the hlist case | 
|---|
|  | 931 |  | 
|---|
|  | 932 | An hlist is not circular, and the end is marked by a NULL next | 
|---|
|  | 933 | pointer. | 
|---|
|  | 934 |  | 
|---|
|  | 935 | Reviewed-on: http://gerrit.openafs.org/8233 | 
|---|
|  | 936 | Tested-by: BuildBot <buildbot@rampaginggeek.com> | 
|---|
|  | 937 | Reviewed-by: Derrick Brashear <shadow@your-file-system.com> | 
|---|
|  | 938 | (cherry picked from commit 78ae01fb9837d79e7bbdb2918872ab106d4c7e98) | 
|---|
|  | 939 |  | 
|---|
|  | 940 | Change-Id: I7e4e3ed2515dd8c2ec765d8acbb97eba189d6aeb | 
|---|
|  | 941 | Reviewed-on: http://gerrit.openafs.org/8239 | 
|---|
|  | 942 | Tested-by: BuildBot <buildbot@rampaginggeek.com> | 
|---|
|  | 943 | Reviewed-by: Derrick Brashear <shadow@your-file-system.com> | 
|---|
|  | 944 | (cherry picked from commit 0506af9c058e22e3475f7e152c022571c0823253) | 
|---|
|  | 945 | --- | 
|---|
|  | 946 | src/afs/LINUX/osi_vcache.c | 8 +++++--- | 
|---|
|  | 947 | 1 file changed, 5 insertions(+), 3 deletions(-) | 
|---|
|  | 948 |  | 
|---|
|  | 949 | diff --git a/src/afs/LINUX/osi_vcache.c b/src/afs/LINUX/osi_vcache.c | 
|---|
|  | 950 | index cd61c65..dc3685b 100644 | 
|---|
|  | 951 | --- a/src/afs/LINUX/osi_vcache.c | 
|---|
|  | 952 | +++ b/src/afs/LINUX/osi_vcache.c | 
|---|
|  | 953 | @@ -20,9 +20,9 @@ osi_TryEvictVCache(struct vcache *avc, int *slept, int defersleep) { | 
|---|
|  | 954 | struct dentry *dentry; | 
|---|
|  | 955 | struct inode *inode = AFSTOV(avc); | 
|---|
|  | 956 | #if defined(D_ALIAS_IS_HLIST) | 
|---|
|  | 957 | -    struct hlist_node *cur, *head; | 
|---|
|  | 958 | +    struct hlist_node *cur, *head, *list_end; | 
|---|
|  | 959 | #else | 
|---|
|  | 960 | -    struct list_head *cur, *head; | 
|---|
|  | 961 | +    struct list_head *cur, *head, *list_end; | 
|---|
|  | 962 | #endif | 
|---|
|  | 963 |  | 
|---|
|  | 964 | /* First, see if we can evict the inode from the dcache */ | 
|---|
|  | 965 | @@ -59,13 +59,15 @@ restart: | 
|---|
|  | 966 | spin_lock(&inode->i_lock); | 
|---|
|  | 967 | #if defined(D_ALIAS_IS_HLIST) | 
|---|
|  | 968 | head = inode->i_dentry.first; | 
|---|
|  | 969 | +       list_end = NULL; | 
|---|
|  | 970 | #else | 
|---|
|  | 971 | head = &inode->i_dentry; | 
|---|
|  | 972 | +       list_end = head; | 
|---|
|  | 973 | #endif | 
|---|
|  | 974 |  | 
|---|
|  | 975 | restart: | 
|---|
|  | 976 | cur = head; | 
|---|
|  | 977 | -       while ((cur = cur->next) != head) { | 
|---|
|  | 978 | +       while ((cur = cur->next) != list_end) { | 
|---|
|  | 979 | #if defined(D_ALIAS_IS_HLIST) | 
|---|
|  | 980 | dentry = hlist_entry(cur, struct dentry, d_alias); | 
|---|
|  | 981 | #else | 
|---|
|  | 982 | -- | 
|---|
|  | 983 | 1.8.0 | 
|---|
|  | 984 |  | 
|---|