From: Brian Foster <bfoster@redhat.com>
To: "lihongliang@sobey.com" <lihongliang@sobey.com>
Cc: xfs <xfs@oss.sgi.com>
Subject: Re: I think that get direct directory size int the xfs file system
Date: Tue, 27 Jan 2015 07:44:59 -0500 [thread overview]
Message-ID: <20150127124459.GA2115@laptop.bfoster> (raw)
In-Reply-To: <201501261707321631278@sobey.com>
On Mon, Jan 26, 2015 at 05:07:37PM +0800, lihongliang@sobey.com wrote:
> Hello
> Can get direct directory size int the XFS file system?
> example:
> root@ficsNode1 test1]# mount | grep xfs
> /dev/sdc on /xfs type xfs (rw,uquota)
> [root@ficsNode1 test1]# pwd
> /xfs/test1
> [root@ficsNode1 test1]# ls -lh
> total 5M
> -rw-r--r-- 1 root root 1.0M Jan 26 09:33 block1
> -rw-r--r-- 1 root root 1.0M Jan 26 09:33 block2
> -rw-r--r-- 1 root root 1.0M Jan 26 09:33 block3
> -rw-r--r-- 1 root root 1.0M Jan 26 09:33 block4
> -rw-r--r-- 1 root root 1.0M Jan 26 09:33 block5
> [root@ficsNode1 test1]#
>
> can I get direct it by call system function the that the /xfs/test1 is 5M?
>
No, because that 5MB data point is not a direct attribute of the
directory. It's the sum of the space used by files within the directory.
The blocks used by the directory itself are filled with directory
entries (e.g., data structures that contain the file names listed above
along with a reference to an inode).
A tool like ls or du is used to process a directory to obtain cumulative
data such as the total space used by files in some particular subtree.
Brian
>
> lihongliang@sobey.com
> _______________________________________________
> xfs mailing list
> xfs@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
prev parent reply other threads:[~2015-01-27 12:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-26 9:07 I think that get direct directory size int the xfs file system lihongliang
2015-01-27 12:44 ` Brian Foster [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150127124459.GA2115@laptop.bfoster \
--to=bfoster@redhat.com \
--cc=lihongliang@sobey.com \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox