Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
- --- openafs-1.6.22.2/src/afs/LINUX/osi_vnodeops.c.rh75enotdir 2018-03-02 13:47:53.455634567 -0500
- +++ openafs-1.6.22.2/src/afs/LINUX/osi_vnodeops.c 2018-03-02 13:54:29.729629392 -0500
- @@ -47,6 +47,16 @@
- #define MAX_ERRNO 1000L
- #endif
- +/* Workaround for RH 7.5 which introduced file operation iterate() but requires
- + * each file->f_mode to be marked with FMODE_KABI_ITERATE. Instead OpenAFS will
- + * continue to use file opearation readdir() in this case.
- + */
- +#if defined(STRUCT_FILE_OPERATIONS_HAS_ITERATE) && !defined(FMODE_KABI_ITERATE)
- +#define USE_FOP_ITERATE 1
- +#else
- +#undef USE_FOP_ITERATE
- +#endif
- +
- int cachefs_noreadpage = 0;
- extern struct backing_dev_info *afs_backing_dev_info;
- @@ -296,7 +306,7 @@ extern int BlobScan(struct dcache * afil
- * handling and use of bulkstats will need to be reflected here as well.
- */
- static int
- -#if defined(STRUCT_FILE_OPERATIONS_HAS_ITERATE)
- +#if defined(USE_FOP_ITERATE)
- afs_linux_readdir(struct file *fp, struct dir_context *ctx)
- #else
- afs_linux_readdir(struct file *fp, void *dirbuf, filldir_t filldir)
- @@ -378,7 +388,7 @@ afs_linux_readdir(struct file *fp, void
- * takes an offset in units of blobs, rather than bytes.
- */
- code = 0;
- -#if defined(STRUCT_FILE_OPERATIONS_HAS_ITERATE)
- +#if defined(USE_FOP_ITERATE)
- offset = ctx->pos;
- #else
- offset = (int) fp->f_pos;
- @@ -437,7 +447,7 @@ afs_linux_readdir(struct file *fp, void
- * holding the GLOCK.
- */
- AFS_GUNLOCK();
- -#if defined(STRUCT_FILE_OPERATIONS_HAS_ITERATE)
- +#if defined(USE_FOP_ITERATE)
- /* dir_emit returns a bool - true when it succeeds.
- * Inverse the result to fit with how we check "code" */
- code = !dir_emit(ctx, de->name, len, ino, type);
- @@ -454,7 +464,7 @@ afs_linux_readdir(struct file *fp, void
- /* If filldir didn't fill in the last one this is still pointing to that
- * last attempt.
- */
- -#if defined(STRUCT_FILE_OPERATIONS_HAS_ITERATE)
- +#if defined(USE_FOP_ITERATE)
- ctx->pos = (loff_t) offset;
- #else
- fp->f_pos = (loff_t) offset;
- @@ -780,7 +790,7 @@ out:
- struct file_operations afs_dir_fops = {
- .read = generic_read_dir,
- -#if defined(STRUCT_FILE_OPERATIONS_HAS_ITERATE)
- +#if defined(USE_FOP_ITERATE)
- .iterate = afs_linux_readdir,
- #else
- .readdir = afs_linux_readdir,
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement