diff options
author | Al Viro <viro@ftp.linux.org.uk> | 2007-07-19 19:23:31 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-07-19 19:29:55 -0400 |
commit | 5f47c7eac65a45e33d7fe390effe75ec5c74f8bf (patch) | |
tree | 84fa8be209351a95897efedad824ead658d1c9f7 /fs/coda/dir.c | |
parent | c65c5131b349b08f3292b1cd10239cf376bfcb15 (diff) |
coda breakage
a) switch by loff_t == __cmpdi2 use. Replaced with a couple
of obvious ifs; update of ->f_pos in the first one makes sure that we
do the right thing in all cases.
b) block_signals() and unblock_signals() are globals on UML.
Renamed coda ones; in principle UML probably ought to do rename as
well, but that's another story.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/coda/dir.c')
-rw-r--r-- | fs/coda/dir.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/fs/coda/dir.c b/fs/coda/dir.c index 04a3dd84c993..8e61236abf4a 100644 --- a/fs/coda/dir.c +++ b/fs/coda/dir.c | |||
@@ -510,20 +510,20 @@ static int coda_venus_readdir(struct file *coda_file, void *buf, | |||
510 | vdir = kmalloc(sizeof(*vdir), GFP_KERNEL); | 510 | vdir = kmalloc(sizeof(*vdir), GFP_KERNEL); |
511 | if (!vdir) return -ENOMEM; | 511 | if (!vdir) return -ENOMEM; |
512 | 512 | ||
513 | switch (coda_file->f_pos) { | 513 | if (coda_file->f_pos == 0) { |
514 | case 0: | ||
515 | ret = filldir(buf, ".", 1, 0, de->d_inode->i_ino, DT_DIR); | 514 | ret = filldir(buf, ".", 1, 0, de->d_inode->i_ino, DT_DIR); |
516 | if (ret < 0) break; | 515 | if (ret < 0) |
516 | goto out; | ||
517 | result++; | 517 | result++; |
518 | coda_file->f_pos++; | 518 | coda_file->f_pos++; |
519 | /* fallthrough */ | 519 | } |
520 | case 1: | 520 | if (coda_file->f_pos == 1) { |
521 | ret = filldir(buf, "..", 2, 1, de->d_parent->d_inode->i_ino, DT_DIR); | 521 | ret = filldir(buf, "..", 2, 1, de->d_parent->d_inode->i_ino, DT_DIR); |
522 | if (ret < 0) break; | 522 | if (ret < 0) |
523 | goto out; | ||
523 | result++; | 524 | result++; |
524 | coda_file->f_pos++; | 525 | coda_file->f_pos++; |
525 | /* fallthrough */ | 526 | } |
526 | default: | ||
527 | while (1) { | 527 | while (1) { |
528 | /* read entries from the directory file */ | 528 | /* read entries from the directory file */ |
529 | ret = kernel_read(host_file, coda_file->f_pos - 2, (char *)vdir, | 529 | ret = kernel_read(host_file, coda_file->f_pos - 2, (char *)vdir, |
@@ -578,7 +578,7 @@ static int coda_venus_readdir(struct file *coda_file, void *buf, | |||
578 | * we've already established it is non-zero. */ | 578 | * we've already established it is non-zero. */ |
579 | coda_file->f_pos += vdir->d_reclen; | 579 | coda_file->f_pos += vdir->d_reclen; |
580 | } | 580 | } |
581 | } | 581 | out: |
582 | kfree(vdir); | 582 | kfree(vdir); |
583 | return result ? result : ret; | 583 | return result ? result : ret; |
584 | } | 584 | } |