Re: [PATCH 2/2] ntdll: Use swapping method to return . and .. as first entries.
Grazvydas Ignotas <notasas(a)gmail.com> writes:
@@ -1522,76 +1538,76 @@ static int read_directory_getdents( int fd, IO_STATUS_BLOCK *io, void *buffer, U }
io->u.Status = STATUS_SUCCESS; + de = (KERNEL_DIRENT64 *)data;
+ /* read first 2 entries so we can handle "." and ".." */ + lseek( fd, 0, SEEK_SET ); res = getdents64( fd, data, size );
You should find a way to do this only when you do encounter '.' and '..', not on every call. -- Alexandre Julliard julliard(a)winehq.org
On Fri, Jul 22, 2011 at 12:30 PM, Alexandre Julliard <julliard(a)winehq.org> wrote:
Grazvydas Ignotas <notasas(a)gmail.com> writes:
res = getdents64( fd, data, size );
You should find a way to do this only when you do encounter '.' and '..', not on every call.
The main reason I did this on every call is to get d_off of second entry (second_entry_pos), i.e. to know when to return ".." in ReturnSingleEntry case. The only thing I can think of is caching that second entry d_off between calls, dropping it if dev or ino of fd changes. -- Gražvydas
Grazvydas Ignotas <notasas(a)gmail.com> writes:
On Fri, Jul 22, 2011 at 12:30 PM, Alexandre Julliard <julliard(a)winehq.org> wrote:
Grazvydas Ignotas <notasas(a)gmail.com> writes:
res = getdents64( fd, data, size );
You should find a way to do this only when you do encounter '.' and '..', not on every call.
The main reason I did this on every call is to get d_off of second entry (second_entry_pos), i.e. to know when to return ".." in ReturnSingleEntry case. The only thing I can think of is caching that second entry d_off between calls, dropping it if dev or ino of fd changes.
That would be acceptable, as long as it's really only done for the ReturnSingleEntry case. -- Alexandre Julliard julliard(a)winehq.org
participants (2)
-
Alexandre Julliard -
Grazvydas Ignotas