All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Vladimir V. Saveliev" <vs@namesys.com>
To: mingz@ele.uri.edu
Cc: reiserfs <reiserfs-list@namesys.com>
Subject: Re: tail option limit
Date: Mon, 29 Aug 2005 22:01:02 +0400	[thread overview]
Message-ID: <43134D5E.5090102@namesys.com> (raw)
In-Reply-To: <1125326954.5544.67.camel@localhost.localdomain>

Hello

Ming Zhang wrote:
> Hi,
> 
> I saw from document that small files will be packed into meta-data thus
> save an extra data block read.
> 
> how small is the boundary? i guess it has related with file block size.
> 
> assume it is 4KB by default.
> 
> so will
> 
> < 4KB be packed?
> 
> = 4KB be packed?
> 
>>4KB be packed? (it is NO here i bet.)
> 

It depends.
reiserfs by default packs into metadata blocks only last incomplete block of file. It is called tail.
For example, if file is 4098 bytes long - first 4096 bytes are stored in full data block (so called unformatted node).
2 last bytes (tail) are stored in one or two meta data blocks.
Files longer 4 * 4096 never get their data stored in meta data blocks.
Tail size depends on file size.
The code looks like:

#define STORE_TAIL_IN_UNFM_S1(n_file_size,n_tail_size,n_block_size) \
(\
  (!(n_tail_size)) || \
  (((n_tail_size) > MAX_DIRECT_ITEM_LEN(n_block_size)) || \
   ( (n_file_size) >= (n_block_size) * 4 ) || \
   ( ( (n_file_size) >= (n_block_size) * 3 ) && \
     ( (n_tail_size) >=   (MAX_DIRECT_ITEM_LEN(n_block_size))/4) ) || \
   ( ( (n_file_size) >= (n_block_size) * 2 ) && \
     ( (n_tail_size) >=   (MAX_DIRECT_ITEM_LEN(n_block_size))/2) ) || \
   ( ( (n_file_size) >= (n_block_size) ) && \
     ( (n_tail_size) >=   (MAX_DIRECT_ITEM_LEN(n_block_size) * 3)/4) ) ) \
)


Reiser4 by default stores whole file in metadata blocks if it is shorter than 16384.
Longer files are stored in full data blocks completely.


> Thanks!
> 
> Ming
> 
> 
> 


  reply	other threads:[~2005-08-29 18:01 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-08-29 14:49 tail option limit Ming Zhang
2005-08-29 18:01 ` Vladimir V. Saveliev [this message]
2005-08-29 18:46   ` Ming Zhang

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=43134D5E.5090102@namesys.com \
    --to=vs@namesys.com \
    --cc=mingz@ele.uri.edu \
    --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.