introduce ->iterate(), ctx->pos, dir_emit()
[GitHub/mt8127/android_kernel_alcatel_ttab.git] / fs / compat.c
index 2279b59e81f2172efe48f3034dc5e6dbd4e23f12..69ca1e301766e0f91607b3851f8932d32c98568f 100644 (file)
@@ -975,7 +975,7 @@ asmlinkage long compat_sys_getdents(unsigned int fd,
                error = buf.error;
        lastdirent = buf.previous;
        if (lastdirent) {
-               if (put_user(f.file->f_pos, &lastdirent->d_off))
+               if (put_user(buf.ctx.pos, &lastdirent->d_off))
                        error = -EFAULT;
                else
                        error = count - buf.count;
@@ -1062,7 +1062,7 @@ asmlinkage long compat_sys_getdents64(unsigned int fd,
                error = buf.error;
        lastdirent = buf.previous;
        if (lastdirent) {
-               typeof(lastdirent->d_off) d_off = f.file->f_pos;
+               typeof(lastdirent->d_off) d_off = buf.ctx.pos;
                if (__put_user_unaligned(d_off, &lastdirent->d_off))
                        error = -EFAULT;
                else