[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 04/13] trans: improve the performance of dir_lookup in fakero
From: |
Samuel Thibault |
Subject: |
Re: [PATCH 04/13] trans: improve the performance of dir_lookup in fakeroot |
Date: |
Tue, 10 Dec 2013 01:05:23 +0100 |
User-agent: |
Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30) |
Justus Winter, le Mon 09 Dec 2013 15:16:32 +0100, a écrit :
> Previously any FS_RETRY_NORMAL requests were handed back to the
> client. Redo the lookup ourself instead. This saves us the burden to
> create a fake node for the intermediate step, hand it back to the
> client and handle another request from the client.
>
> With this change there is no need to fiddle with the permission bits
> as it was previously done.
Ack.
> * trans/fakeroot.c (netfs_S_dir_lookup): Redo the lookup transparently
> for the user if FS_RETRY_NORMAL is requested.
>
> fixup_improve_perf
> ---
> trans/fakeroot.c | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/trans/fakeroot.c b/trans/fakeroot.c
> index 1ab3216..6e3b5d4 100644
> --- a/trans/fakeroot.c
> +++ b/trans/fakeroot.c
> @@ -267,6 +267,14 @@ netfs_S_dir_lookup (struct protid *diruser,
> goto redo_lookup;
>
> case FS_RETRY_NORMAL:
> + if (retry_name[0] != '\0')
> + {
> + dir = file;
> + filename = retry_name;
> + goto redo_lookup;
> + }
> + break;
> +
> case FS_RETRY_MAGICAL:
> default:
> if (file == MACH_PORT_NULL)
> @@ -305,10 +313,6 @@ netfs_S_dir_lookup (struct protid *diruser,
> /* We already know about this node. */
> mach_port_deallocate (mach_task_self (), idport);
> pthread_mutex_lock (&np->lock);
> - if (retry_name[0] != '\0')
> - /* This was not the last component, remove O_WRITE to
> - avoid opening directories with it. */
> - flags &= ~O_WRITE;
> err = check_openmodes (np->nn, (flags & (O_RDWR|O_EXEC)), file);
> if (!err)
> netfs_nref (np);
> --
> 1.7.10.4
>
--
Samuel
--- christ gives channel operator status to Dieu
-+- #ens-mim and hell -+-
- More fixes for fakeroot-hurd, Justus Winter, 2013/12/09
- [PATCH 02/13] libihash: remove dead code, Justus Winter, 2013/12/09
- [PATCH 01/13] libfshelp: use a hash table in get-identity.c, Justus Winter, 2013/12/09
- [PATCH 03/13] trans: fix the use of the hash table in fakeroot.c, Justus Winter, 2013/12/09
- [PATCH 04/13] trans: improve the performance of dir_lookup in fakeroot, Justus Winter, 2013/12/09
- Re: [PATCH 04/13] trans: improve the performance of dir_lookup in fakeroot,
Samuel Thibault <=
- [PATCH 06/13] trans: fix locking issue in fakeroot, Justus Winter, 2013/12/09
- [PATCH 07/13] trans: return nodes locked when creating fake nodes in fakeroot, Justus Winter, 2013/12/09
- [PATCH 08/13] trans: fix reference counting and destruction of fake nodes, Justus Winter, 2013/12/09
- [PATCH 11/13] trans: improve the error handling in fakeauth, Justus Winter, 2013/12/09