All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg Drokin <green@namesys.com>
To: Jeff Breidenbach <jeff@jab.org>
Cc: reiserfs-list@namesys.com
Subject: Re: fast approximate file count
Date: Sun, 22 Sep 2002 00:35:46 +0400	[thread overview]
Message-ID: <20020922003546.A19135@namesys.com> (raw)
In-Reply-To: <E17scwJ-0003ij-00@yodel.jab.org>

Hello!

On Fri, Sep 20, 2002 at 10:36:23PM -0700, Jeff Breidenbach wrote:
> While "find $DIR | wc -l" works and is quite accurate, it can take an
> enormously long time. While "df" and dividing by a guesstimate of
> the average file size is fast, I wonder if there is a way to do
> better. Is there a prgram that can take advantage of reiserfs
> specific metadata and quickly compute an approximate file count?
> Especially if the directory tree structure is very shallow?

If you never/very seldom delete files,
you can create new file (any size), execute ls -i on it, like this:
 549661 z

This number is OID, oid grows up in case that there were no deletions/gaps
from previous deletions in OID.
OID is total number of objects on FS in this case.

Counting is started from 2 for root dir. objects are files and directories.

Bye,
    Oleg

  reply	other threads:[~2002-09-21 20:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-21  5:36 fast approximate file count Jeff Breidenbach
2002-09-21 20:35 ` Oleg Drokin [this message]
     [not found]   ` <20020922054309.V8204@vestdata.no>
2002-09-22 10:36     ` Oleg Drokin
     [not found] ` <20020923020703.GA4570@tapu.f00f.org>
2002-09-23  2:30   ` Jeff Breidenbach
2002-09-23 13:07     ` Chris Mason

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=20020922003546.A19135@namesys.com \
    --to=green@namesys.com \
    --cc=jeff@jab.org \
    --cc=reiserfs-list@namesys.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.