linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Phillip Susi <psusi@ubuntu.com>
To: Sankar P <sankar.curiosity@gmail.com>
Cc: Kernelnewbies@kernelnewbies.org, linux-fsdevel@vger.kernel.org
Subject: Re: How defragmentation works in linux filesystems ?
Date: Tue, 15 Jan 2013 16:23:51 -0500	[thread overview]
Message-ID: <50F5C8E7.8030607@ubuntu.com> (raw)
In-Reply-To: <CAMSEaH71w-4o2JP-6+4NjZbzP0drhpVysprsAPCHetuRtF7CzQ@mail.gmail.com>

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 1/7/2013 4:27 AM, Sankar P wrote:
> Hi,
> 
> Is there any technical article explaining how defragmentation works
> in linux filesystems, say btrfs or ext4 ?
> 
> Do they recreate the file data blocks and change the root pointer
> to the new extent ? Or do they do some kind of moving blocks around
> ? Or is it based on some other strategy ? Partial defragmentation
> (based on either byte offset or extents) is also supported by any
> of the file systems ?

e4defrag uses an ioctl to allocate a new donor inode with enough
contiguous blocks to hold the original, then atomically copy the
blocks and swap the pointers.

> Is there a standard way to trigger a defragmentation operation (an 
> ioctl ?) that my filesystem could implement so that any user space 
> tool that work with other fs will work with mine too ? (Like, how 
> FIEBMAP ioctl can help in giving the extent information for a file 
> from the userspace)

No.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.17 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJQ9cjmAAoJEJrBOlT6nu754ZkH/2ZGsCpKMDQoZN8/82scAlXl
DYZK/4ckttnxB5EiXSygBnGqdjAdR7IK+q+JJxUok7uLAAgGux1yKq4NX6pyd0f9
MIbMGYNHy1Mwn9uel+eGxPcvFF1s4p38tknZp1ZqBFbWpcnhJN5mTgBHHm+SLuLG
d7GsFMBHiHr0IyMW8gWxiLEs4jDXSU1N8lDAcxOZCinE+A5DAUtWTPx3moTk6JYU
u69pPQr/A5Krp1eLCIQCIPw4JkM1yWoX9Tfs2SL88okWxP+OD1JXfoOfKmzbUdLd
bs0wJSkyK/VddK1YJbXGEi0zH2c4ue3DyYu4Kc9JizxL8vQk+XJUJAJI9vexR58=
=G3lC
-----END PGP SIGNATURE-----

      reply	other threads:[~2013-01-15 21:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-07  9:27 How defragmentation works in linux filesystems ? Sankar P
2013-01-15 21:23 ` Phillip Susi [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=50F5C8E7.8030607@ubuntu.com \
    --to=psusi@ubuntu.com \
    --cc=Kernelnewbies@kernelnewbies.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=sankar.curiosity@gmail.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;
as well as URLs for NNTP newsgroup(s).