From 0c9bd6365d0b278728359843b8303047ddedb831 Mon Sep 17 00:00:00 2001 From: Richard Weinberger Date: Tue, 24 Mar 2015 15:47:38 +0100 Subject: um: hostfs: Reduce number of syscalls in readdir Currently hostfs issues every time a seekdir(), in fact it has to do this only upon the first call. Also telldir() can be omitted as we can obtain the directory offset from readdir(). Signed-off-by: Richard Weinberger --- fs/hostfs/hostfs_kern.c | 1 + 1 file changed, 1 insertion(+) (limited to 'fs/hostfs/hostfs_kern.c') diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c index e77da44a235c..d0a2f68a0eea 100644 --- a/fs/hostfs/hostfs_kern.c +++ b/fs/hostfs/hostfs_kern.c @@ -292,6 +292,7 @@ static int hostfs_readdir(struct file *file, struct dir_context *ctx) if (dir == NULL) return -error; next = ctx->pos; + seek_dir(dir, next); while ((name = read_dir(dir, &next, &ino, &len, &type)) != NULL) { if (!dir_emit(ctx, name, len, ino, type)) break; -- cgit v1.2.3