Re: Meaning of Size Directories

2021-03-16 Thread David Howells
John Reiser wrote: > On 3/16/21, David Howells wrote: > > John Reiser wrote: > > > >> See the manual page "man 2 getdents". > > Um, which bit? I don't see anything obvious to that end. > > On that manual page: > = > The system call getdents() reads several linux_dirent structures from

Re: Meaning of Size Directories

2021-03-16 Thread Florian Weimer
* Steven Whitehouse: > If you are looking for a hint on how large a buffer to allocate, then > st_blksize is generally used as a hint for directory reads, or > otherwise, a fixed size buffer or a page or two. The st_size field is > meaningless for directories and you'll get all kinds of odd

Re: Meaning of Size Directories

2021-03-16 Thread Eric Sandeen
On 3/16/21 11:51 AM, John Reiser wrote: > On 3/16/21, David Howells wrote: >> John Reiser wrote: >> >>> See the manual page "man 2 getdents". >> >> Um, which bit?  I don't see anything obvious to that end. > > On that manual page: > = > The system call getdents() reads several linux_dirent

Re: Meaning of Size Directories

2021-03-16 Thread Steven Whitehouse
Hi, On 16/03/2021 16:51, John Reiser wrote: On 3/16/21, David Howells wrote: John Reiser wrote: See the manual page "man 2 getdents". Um, which bit?  I don't see anything obvious to that end. On that manual page: = The system call getdents() reads several linux_dirent structures

Re: Meaning of Size Directories

2021-03-16 Thread John Reiser
On 3/16/21, David Howells wrote: John Reiser wrote: See the manual page "man 2 getdents". Um, which bit? I don't see anything obvious to that end. On that manual page: = The system call getdents() reads several linux_dirent structures from the directory referred to by the open file

Re: Meaning of Size Directories

2021-03-16 Thread David Howells
John Reiser wrote: > See the manual page "man 2 getdents". Um, which bit? I don't see anything obvious to that end. On AFS directories are handled as files that the filesystem downloads and parses locally. The size returned in st_size is the size of the directory content blob. David

Re: Meaning of Size Directories

2021-02-26 Thread Roberto Ragusa
On 2/26/21 7:07 AM, Eric Sandeen wrote: In short, "size" of a dir doesn't tell you much. In ext4 it tells you (proportionally to other dirs) how many files you have got at maximum in that directory in its entire history. :-) Regards. -- Roberto Ragusamail at robertoragusa.it

Re: Meaning of Size Directories

2021-02-26 Thread Florian Weimer
* Eric Sandeen: > So, as one example on ext4 - directories never shrink. > # rm -f dir/* > # ls -ld dir > drwxr-xr-x. 2 root root 69632 Feb 26 00:49 dir > > 69632 byte directory with no files in it, wh. e2fsck -D will shrink such directories in an offline operation, I think. Thanks,

Re: Meaning of Size Directories

2021-02-25 Thread Tomasz Torcz
Dnia Thu, Feb 25, 2021 at 06:20:34PM -0300, Sergio Belkin napisał(a): > Hi, > Tools such as ls or stat report the size of a directory. Of course it is > not the content size. It depends on the filesystem. For Cephfs, directory size _is_ the content size: % ls -lh drwxrwxr-x. 3 zdzichu zdzichu

Re: Meaning of Size Directories

2021-02-25 Thread Eric Sandeen
On 2/25/21 6:56 PM, John Reiser wrote: >> Tools such as ls or stat report the size of a directory. Of course it is not >> the content size. >> stat -c %s  /home/sergio/.config >> 6550 >> >> What does 6550 mean in btrfs context? > > Regardless of filesystem type, the size of a directory is the

Re: Meaning of Size Directories

2021-02-25 Thread Sergio Belkin
El jue, 25 feb 2021 a las 21:58, John Reiser () escribió: > > Tools such as ls or stat report the size of a directory. Of course it is > not the content size. > > stat -c %s /home/sergio/.config > > 6550 > > > > What does 6550 mean in btrfs context? > > Regardless of filesystem type, the size of

Re: Meaning of Size Directories

2021-02-25 Thread John Reiser
Tools such as ls or stat report the size of a directory. Of course it is not the content size. stat -c %s  /home/sergio/.config 6550 What does 6550 mean in btrfs context? Regardless of filesystem type, the size of a directory is the sum of the sizes of the struct linux_dirent (or

Re: Meaning of Size Directories

2021-02-25 Thread Chris Murphy
On Thu, Feb 25, 2021 at 2:21 PM Sergio Belkin wrote: > > Hi, > Tools such as ls or stat report the size of a directory. Of course it is not > the content size. > stat -c %s /home/sergio/.config > 6550 > > What does 6550 mean in btrfs context? stat -c %s reports the st_size of the directory

Re: Meaning of Size Directories

2021-02-25 Thread Artur Frenszek-Iwicki
I know next to nothing about btrfs, but on ext family of filesystems, directories are technically just special files. Those files contain a simple list of directory entries (i.e. filename <-> inode number pairs). So I guess in the case of ext, stat reports the size of this list.

Meaning of Size Directories

2021-02-25 Thread Sergio Belkin
Hi, Tools such as ls or stat report the size of a directory. Of course it is not the content size. stat -c %s /home/sergio/.config 6550 What does 6550 mean in btrfs context? Thanks in advance! -- -- Sergio Belkin LPIC-2 Certified - http://www.lpi.org