]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
orangefs: remove ORANGEFS_READDIR macros
authorMartin Brandenburg <martin@omnibond.com>
Tue, 25 Apr 2017 19:38:02 +0000 (15:38 -0400)
committerMike Marshall <hubcap@omnibond.com>
Wed, 26 Apr 2017 18:33:00 +0000 (14:33 -0400)
They are clones of the ORANGEFS_ITERATE macros in use elsewhere.  Delete
ORANGEFS_ITERATE_NEXT which is a hack previously used by readdir.

Signed-off-by: Martin Brandenburg <martin@omnibond.com>
Signed-off-by: Mike Marshall <hubcap@omnibond.com>
fs/orangefs/dir.c
fs/orangefs/protocol.h

index 7e9814fc6cc364fd7811be3d0e5bf8b6678d1753..d5ec9ba82ceff58597b759f67a82692fc5cc9228 100644 (file)
@@ -304,13 +304,13 @@ static int orangefs_dir_iterate(struct file *file,
         * Must read more if the user has sought past what has been read
         * so far.  Stop a user who has sought past the end.
         */
-       while (od->token != ORANGEFS_READDIR_END &&
+       while (od->token != ORANGEFS_ITERATE_END &&
            ctx->pos > od->end) {
                r = orangefs_dir_more(oi, od, dentry);
                if (r)
                        return r;
        }
-       if (od->token == ORANGEFS_READDIR_END && ctx->pos > od->end)
+       if (od->token == ORANGEFS_ITERATE_END && ctx->pos > od->end)
                return -EIO;
 
        /* Then try to fill if there's any left in the buffer. */
@@ -321,7 +321,7 @@ static int orangefs_dir_iterate(struct file *file,
        }
 
        /* Finally get some more and try to fill. */
-       if (od->token != ORANGEFS_READDIR_END) {
+       if (od->token != ORANGEFS_ITERATE_END) {
                r = orangefs_dir_more(oi, od, dentry);
                if (r)
                        return r;
@@ -339,7 +339,7 @@ static int orangefs_dir_open(struct inode *inode, struct file *file)
        if (!file->private_data)
                return -ENOMEM;
        od = file->private_data;
-       od->token = ORANGEFS_READDIR_START;
+       od->token = ORANGEFS_ITERATE_START;
        od->part = NULL;
        od->end = 1 << PART_SHIFT;
        od->error = 0;
index 971307ad69be4b08cd7be8df8b5a213a314a25b7..48bcc1bbe415f1a4f2394fb1b72ab704b2d0a1d3 100644 (file)
@@ -138,13 +138,8 @@ typedef __s64 ORANGEFS_offset;
 #define ORANGEFS_G_SGID    (1 << 10)
 #define ORANGEFS_U_SUID    (1 << 11)
 
-/* definition taken from stdint.h */
-#define INT32_MAX (2147483647)
-#define ORANGEFS_ITERATE_START    (INT32_MAX - 1)
-#define ORANGEFS_ITERATE_END      (INT32_MAX - 2)
-#define ORANGEFS_ITERATE_NEXT     (INT32_MAX - 3)
-#define ORANGEFS_READDIR_START ORANGEFS_ITERATE_START
-#define ORANGEFS_READDIR_END   ORANGEFS_ITERATE_END
+#define ORANGEFS_ITERATE_START    2147483646
+#define ORANGEFS_ITERATE_END      2147483645
 #define ORANGEFS_IMMUTABLE_FL FS_IMMUTABLE_FL
 #define ORANGEFS_APPEND_FL    FS_APPEND_FL
 #define ORANGEFS_NOATIME_FL   FS_NOATIME_FL