Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2018
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.42 KB | None | 0 0
  1. diff -up openafs-1.6.22.2/src/afs/LINUX/osi_vnodeops.c.rh75enotdir openafs-1.6.22.2/src/afs/LINUX/osi_vnodeops.c
  2. --- openafs-1.6.22.2/src/afs/LINUX/osi_vnodeops.c.rh75enotdir 2018-03-02 13:47:53.455634567 -0500
  3. +++ openafs-1.6.22.2/src/afs/LINUX/osi_vnodeops.c 2018-03-02 13:54:29.729629392 -0500
  4. @@ -47,6 +47,16 @@
  5. #define MAX_ERRNO 1000L
  6. #endif
  7.  
  8. +/* Workaround for RH 7.5 which introduced file operation iterate() but requires
  9. + * each file->f_mode to be marked with FMODE_KABI_ITERATE. Instead OpenAFS will
  10. + * continue to use file opearation readdir() in this case.
  11. + */
  12. +#if defined(STRUCT_FILE_OPERATIONS_HAS_ITERATE) && !defined(FMODE_KABI_ITERATE)
  13. +#define USE_FOP_ITERATE 1
  14. +#else
  15. +#undef USE_FOP_ITERATE
  16. +#endif
  17. +
  18. int cachefs_noreadpage = 0;
  19.  
  20. extern struct backing_dev_info *afs_backing_dev_info;
  21. @@ -296,7 +306,7 @@ extern int BlobScan(struct dcache * afil
  22. * handling and use of bulkstats will need to be reflected here as well.
  23. */
  24. static int
  25. -#if defined(STRUCT_FILE_OPERATIONS_HAS_ITERATE)
  26. +#if defined(USE_FOP_ITERATE)
  27. afs_linux_readdir(struct file *fp, struct dir_context *ctx)
  28. #else
  29. afs_linux_readdir(struct file *fp, void *dirbuf, filldir_t filldir)
  30. @@ -378,7 +388,7 @@ afs_linux_readdir(struct file *fp, void
  31. * takes an offset in units of blobs, rather than bytes.
  32. */
  33. code = 0;
  34. -#if defined(STRUCT_FILE_OPERATIONS_HAS_ITERATE)
  35. +#if defined(USE_FOP_ITERATE)
  36. offset = ctx->pos;
  37. #else
  38. offset = (int) fp->f_pos;
  39. @@ -437,7 +447,7 @@ afs_linux_readdir(struct file *fp, void
  40. * holding the GLOCK.
  41. */
  42. AFS_GUNLOCK();
  43. -#if defined(STRUCT_FILE_OPERATIONS_HAS_ITERATE)
  44. +#if defined(USE_FOP_ITERATE)
  45. /* dir_emit returns a bool - true when it succeeds.
  46. * Inverse the result to fit with how we check "code" */
  47. code = !dir_emit(ctx, de->name, len, ino, type);
  48. @@ -454,7 +464,7 @@ afs_linux_readdir(struct file *fp, void
  49. /* If filldir didn't fill in the last one this is still pointing to that
  50. * last attempt.
  51. */
  52. -#if defined(STRUCT_FILE_OPERATIONS_HAS_ITERATE)
  53. +#if defined(USE_FOP_ITERATE)
  54. ctx->pos = (loff_t) offset;
  55. #else
  56. fp->f_pos = (loff_t) offset;
  57. @@ -780,7 +790,7 @@ out:
  58.  
  59. struct file_operations afs_dir_fops = {
  60. .read = generic_read_dir,
  61. -#if defined(STRUCT_FILE_OPERATIONS_HAS_ITERATE)
  62. +#if defined(USE_FOP_ITERATE)
  63. .iterate = afs_linux_readdir,
  64. #else
  65. .readdir = afs_linux_readdir,
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement