[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 4/5] trans/fakeroot: remove dead code
From: |
Samuel Thibault |
Subject: |
Re: [PATCH 4/5] trans/fakeroot: remove dead code |
Date: |
Wed, 11 Dec 2013 00:22:15 +0100 |
User-agent: |
Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30) |
Justus Winter, le Tue 10 Dec 2013 17:50:29 +0100, a écrit :
> * trans/fakeroot.c (netfs_S_dir_lookup): Remove dead code.
Ack.
> ---
> trans/fakeroot.c | 67
> +++++++++++++++++++++++-------------------------------
> 1 file changed, 29 insertions(+), 38 deletions(-)
>
> diff --git a/trans/fakeroot.c b/trans/fakeroot.c
> index f278db1..58f1112 100644
> --- a/trans/fakeroot.c
> +++ b/trans/fakeroot.c
> @@ -331,51 +331,42 @@ netfs_S_dir_lookup (struct protid *diruser,
> }
>
> mach_port_deallocate (mach_task_self (), fsidport);
> - if (fsidport == netfs_fsys_identity)
> - {
> - /* Talking to ourselves! We just looked up one of our
> - own nodes. Find the node and return it. */
> - assert (! "reached");
> - }
> - else
> + pthread_mutex_lock (&idport_ihash_lock);
> + pthread_mutex_lock (&dnp->lock);
> + struct netnode *nn = hurd_ihash_find (&idport_ihash, idport);
> + if (nn != NULL)
> {
> - pthread_mutex_lock (&idport_ihash_lock);
> - pthread_mutex_lock (&dnp->lock);
> - struct netnode *nn = hurd_ihash_find (&idport_ihash, idport);
> - if (nn != NULL)
> - {
> - assert (nn->np->nn == nn);
> - np = nn->np;
> - /* We already know about this node. */
> - mach_port_deallocate (mach_task_self (), idport);
> -
> - if (np == dnp)
> - {
> - /* dnp is already locked. */
> - }
> - else
> - {
> - pthread_mutex_lock (&np->lock);
> - pthread_mutex_unlock (&dnp->lock);
> - }
> -
> - /* If the looked-up file carries a fake reference, we
> - use that and clear the FAKE_REFERENCE flag. */
> - if (np->nn->faked & FAKE_REFERENCE)
> - np->nn->faked &= ~FAKE_REFERENCE;
> - else
> - netfs_nref (np);
> + assert (nn->np->nn == nn);
> + np = nn->np;
> + /* We already know about this node. */
> + mach_port_deallocate (mach_task_self (), idport);
>
> - err = check_openmodes (np->nn, (flags & (O_RDWR|O_EXEC)), file);
> - pthread_mutex_unlock (&idport_ihash_lock);
> + if (np == dnp)
> + {
> + /* dnp is already locked. */
> }
> else
> {
> - err = new_node (file, idport, 1, flags, &np);
> + pthread_mutex_lock (&np->lock);
> pthread_mutex_unlock (&dnp->lock);
> - if (!err)
> - err = netfs_validate_stat (np, diruser->user);
> }
> +
> + /* If the looked-up file carries a fake reference, we
> + use that and clear the FAKE_REFERENCE flag. */
> + if (np->nn->faked & FAKE_REFERENCE)
> + np->nn->faked &= ~FAKE_REFERENCE;
> + else
> + netfs_nref (np);
> +
> + err = check_openmodes (np->nn, (flags & (O_RDWR|O_EXEC)), file);
> + pthread_mutex_unlock (&idport_ihash_lock);
> + }
> + else
> + {
> + err = new_node (file, idport, 1, flags, &np);
> + pthread_mutex_unlock (&dnp->lock);
> + if (!err)
> + err = netfs_validate_stat (np, diruser->user);
> }
> if (err)
> goto lose;
> --
> 1.7.10.4
>
--
Samuel
<h> t: bah c'est tendre le pattern pour se faire matcher, hein
- Re: [PATCH 13/13] console-client: remove spurious pthread_spin_unlocks, (continued)
Re: More fixes for fakeroot-hurd, Samuel Thibault, 2013/12/09
[PATCH 1/5] utils/settrans: fix the teardown of chrooted environments, Justus Winter, 2013/12/10
- [PATCH 2/5] trans/fakeroot: fix ownership of newly created files, Justus Winter, 2013/12/10
- [PATCH 3/5] trans/fakeroot: drop else, Justus Winter, 2013/12/10
- [PATCH 4/5] trans/fakeroot: remove dead code, Justus Winter, 2013/12/10
- Re: [PATCH 4/5] trans/fakeroot: remove dead code,
Samuel Thibault <=
- [PATCH 5/5] trans/fakeroot: remove dead code, Justus Winter, 2013/12/10
- updated 1st patch, Justus Winter, 2013/12/10
Re: [PATCH 1/5] utils/settrans: fix the teardown of chrooted environments, Samuel Thibault, 2013/12/10