Skip to content

Commit 7b796ae

Browse files
Martin Brandenburghubcapsc
authored andcommitted
orangefs: remove ORANGEFS_READDIR macros
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 <[email protected]> Signed-off-by: Mike Marshall <[email protected]>
1 parent 480e3e5 commit 7b796ae

File tree

2 files changed

+6
-11
lines changed

2 files changed

+6
-11
lines changed

fs/orangefs/dir.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -304,13 +304,13 @@ static int orangefs_dir_iterate(struct file *file,
304304
* Must read more if the user has sought past what has been read
305305
* so far. Stop a user who has sought past the end.
306306
*/
307-
while (od->token != ORANGEFS_READDIR_END &&
307+
while (od->token != ORANGEFS_ITERATE_END &&
308308
ctx->pos > od->end) {
309309
r = orangefs_dir_more(oi, od, dentry);
310310
if (r)
311311
return r;
312312
}
313-
if (od->token == ORANGEFS_READDIR_END && ctx->pos > od->end)
313+
if (od->token == ORANGEFS_ITERATE_END && ctx->pos > od->end)
314314
return -EIO;
315315

316316
/* Then try to fill if there's any left in the buffer. */
@@ -321,7 +321,7 @@ static int orangefs_dir_iterate(struct file *file,
321321
}
322322

323323
/* Finally get some more and try to fill. */
324-
if (od->token != ORANGEFS_READDIR_END) {
324+
if (od->token != ORANGEFS_ITERATE_END) {
325325
r = orangefs_dir_more(oi, od, dentry);
326326
if (r)
327327
return r;
@@ -339,7 +339,7 @@ static int orangefs_dir_open(struct inode *inode, struct file *file)
339339
if (!file->private_data)
340340
return -ENOMEM;
341341
od = file->private_data;
342-
od->token = ORANGEFS_READDIR_START;
342+
od->token = ORANGEFS_ITERATE_START;
343343
od->part = NULL;
344344
od->end = 1 << PART_SHIFT;
345345
od->error = 0;

fs/orangefs/protocol.h

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,8 @@ typedef __s64 ORANGEFS_offset;
138138
#define ORANGEFS_G_SGID (1 << 10)
139139
#define ORANGEFS_U_SUID (1 << 11)
140140

141-
/* definition taken from stdint.h */
142-
#define INT32_MAX (2147483647)
143-
#define ORANGEFS_ITERATE_START (INT32_MAX - 1)
144-
#define ORANGEFS_ITERATE_END (INT32_MAX - 2)
145-
#define ORANGEFS_ITERATE_NEXT (INT32_MAX - 3)
146-
#define ORANGEFS_READDIR_START ORANGEFS_ITERATE_START
147-
#define ORANGEFS_READDIR_END ORANGEFS_ITERATE_END
141+
#define ORANGEFS_ITERATE_START 2147483646
142+
#define ORANGEFS_ITERATE_END 2147483645
148143
#define ORANGEFS_IMMUTABLE_FL FS_IMMUTABLE_FL
149144
#define ORANGEFS_APPEND_FL FS_APPEND_FL
150145
#define ORANGEFS_NOATIME_FL FS_NOATIME_FL

0 commit comments

Comments
 (0)