summaryrefslogtreecommitdiff
path: root/fs/coda/dir.c
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2007-07-20 00:23:31 +0100
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-19 16:29:55 -0700
commit5f47c7eac65a45e33d7fe390effe75ec5c74f8bf (patch)
tree84fa8be209351a95897efedad824ead658d1c9f7 /fs/coda/dir.c
parentc65c5131b349b08f3292b1cd10239cf376bfcb15 (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.c18
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,
vdir = kmalloc(sizeof(*vdir), GFP_KERNEL);
if (!vdir) return -ENOMEM;
- switch (coda_file->f_pos) {
- case 0:
+ if (coda_file->f_pos == 0) {
ret = filldir(buf, ".", 1, 0, de->d_inode->i_ino, DT_DIR);
- if (ret < 0) break;
+ if (ret < 0)
+ goto out;
result++;
coda_file->f_pos++;
- /* fallthrough */
- case 1:
+ }
+ if (coda_file->f_pos == 1) {
ret = filldir(buf, "..", 2, 1, de->d_parent->d_inode->i_ino, DT_DIR);
- if (ret < 0) break;
+ if (ret < 0)
+ goto out;
result++;
coda_file->f_pos++;
- /* fallthrough */
- default:
+ }
while (1) {
/* read entries from the directory file */
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,
* we've already established it is non-zero. */
coda_file->f_pos += vdir->d_reclen;
}
- }
+out:
kfree(vdir);
return result ? result : ret;
}