anchao opened a new pull request, #21029:
URL: https://github.com/apache/nuttx/pull/21029

   ## Summary                                                                
                                                                             
   Add a fast path to inode search setup for simple absolute paths that are  
   already in canonical form.                                                
                                                                             
   For common paths such as `/dev/ttyS0`, `/proc/meminfo`, or `/tmp/a`,      
   `inode_search_setup()` no longer allocates a `PATH_MAX` temporary buffer, 
   copies the path into it, and canonicalizes it back to the same string.    
   Instead, when the path needs no root prefixing or normalization, inode    
   search can use the caller-provided path directly.                         
                                                                             
   The existing mutable-buffer path is still used for cases that may require 
   path expansion or canonicalization, including relative paths, chroot root 
   prefixing, `.` / `..` segments, duplicate slashes, trailing slashes, and  
   `nofollow` lookups.                                                       
                                                                             
   ## Benefits                                                               
                                                                             
   - Reduces temporary buffer usage on common VFS inode lookups.             
   - Avoids unnecessary path copying and canonicalization for already-simple 
     absolute paths.                                                         
   - Lowers pressure on the libc tempbuffer pool and avoids possible heap    
     fallback when the pool is exhausted.                                    
   - Preserves existing behavior for non-canonical, chroot, relative, and    
     symbolic-link-sensitive lookup paths.                                   
                                                                             
   ## Testing                                                                
   
   sim/nsh


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to