linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* What's the difference between `btrfs sub del -c` and `btrfs fi sync`?
@ 2024-04-26 22:52 intelfx
  2024-04-26 23:06 ` Qu Wenruo
  0 siblings, 1 reply; 6+ messages in thread
From: intelfx @ 2024-04-26 22:52 UTC (permalink / raw)
  To: linux-btrfs

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 /

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-05-02 13:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-26 22:52 What's the difference between `btrfs sub del -c` and `btrfs fi sync`? intelfx
2024-04-26 23:06 ` 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

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).