git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH 2/2] optimize set_shared_perm()

From
Torsten Bögershausen <tboegi@web.de>
Date
Mar 30, 2013, 09:53 UTC
Message-ID
<5156B60C.6070707@web.de>
In-Reply-To
<7vli95nbs4.fsf@alter.siamese.dyndns.org>

On 29.03.13 22:20, Junio C Hamano wrote: [snip]

Show 15 quoted lines
> The last two points can become a separate "preparation" step.  The
> result would be easier to read.
> 
> Your updated adjust_shared_perm() does not begin with:
> 
> 	if (!shared_repository)
>         	return 0;
> 
> as the original, but it always first calls to get_st_mode_bits()
> which makes a call to lstat(2).
> 
> That smells like a huge regression for !shared_repository case,
> unless you have updated the existing callers of adjust_shared_perm()
> not to call it when !shared_repository.
> 

Thanks for carefull review: The achieved effect of the code is the same, but the developer is to blame.

I send a new patch of 2/2 in a minute, splitted into 2 commits.
Highlights of part 2:
a) move "if (!shared_repository)" to the right place
b) Simplify calc_shared_perm() even more: Remove the variable "int shared"
c) Remove calc_shared_perm_dir(), the functionality is baked into
   adjust_shared_perm()
Previous: Junio C Hamano
Message 3 of 3 in “optimize set_shared_perm()”
  1. 2/2 optimize set_shared_perm()Torsten Bögershausen, Mar 25, 2013
  2. Junio C HamanoMar 29, 2013
  3. Torsten BögershausenMar 30, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.