All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: intelfx@intelfx.name
To: linux-btrfs@vger.kernel.org
Subject: What's the difference between `btrfs sub del -c` and `btrfs fi sync`?
Date: Sat, 27 Apr 2024 00:52:15 +0200	[thread overview]
Message-ID: <63a537d0467f3bb7683bd412c25c006f8d092ced.camel@intelfx.name> (raw)

Hi,

I've been trying to read btrfs-progs code to understand btrfs ioctls
and one thing evades my understanding.

A `btrfs subvolume delete --commit-{after,each}` operation involves
issuing two ioctls at the commit time: BTRFS_IOC_START_SYNC immediately
followed by BTRFS_IOC_WAIT_SYNC. Notably, the relevant comment says
"<...> issue SYNC ioctl <...>" and the function that encapsulates the
two ioctls is called `wait_for_commit()`.

On the other hand, a `btrfs filesystem sync` operation involves issuing
just one ioctl, BTRFS_IOC_SYNC (encapsulated in a function called
`btrfs_util_sync_fd()`).

I tried to look at the kernel code for the three ioctls but to my
untrained eye, they look like they are doing different things with
different side effects.

What is the difference, and why is it needed (i.e. why are there two
sets of sync-related ioctls)?

Cheers,
-- 
Ivan Shapovalov / intelfx /

             reply	other threads:[~2024-04-26 22:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-26 22:52 intelfx [this message]
2024-04-26 23:06 ` What's the difference between `btrfs sub del -c` and `btrfs fi sync`? Qu Wenruo
2024-04-26 23:14   ` intelfx
2024-04-27  0:04     ` Qu Wenruo
2024-04-28 10:20       ` intelfx
2024-05-02 13:16         ` David Sterba

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=63a537d0467f3bb7683bd412c25c006f8d092ced.camel@intelfx.name \
    --to=intelfx@intelfx.name \
    --cc=linux-btrfs@vger.kernel.org \
    /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.