All of lore.kernel.org
 help / color / mirror / Atom feed
* How about adding an ioctl to convert a directory to a subvolume?
@ 2017-11-27  9:41 Lu Fengqi
  2017-11-27 10:13 ` Qu Wenruo
  2017-11-28 18:48 ` David Sterba
  0 siblings, 2 replies; 11+ messages in thread
From: Lu Fengqi @ 2017-11-27  9:41 UTC (permalink / raw)
  To: linux-btrfs

Hi all,

As we all know, under certain circumstances, it is more appropriate to
create some subvolumes rather than keep everything in the same
subvolume. As the condition of demand change, the user may need to
convert a previous directory to a subvolume. For this reason,how about
adding an ioctl to convert a directory to a subvolume?

Users can convert by the scripts mentioned in this
thread(https://www.spinics.net/lists/linux-btrfs/msg33252.html), but is
it easier to use the off-the-shelf btrfs subcommand?

After an initial consideration, our implementation is broadly divided
into the following steps:
1. Freeze the filesystem or set the subvolume above the source directory
to read-only;
2. Perform a pre-check, for example, check if a cross-device link
creation during the conversion;
3. Perform conversion, such as creating a new subvolume and moving the
contents of the source directory;
4. Thaw the filesystem or restore the subvolume writable property.

In fact, I am not so sure whether this use of freeze is appropriate
because the source directory the user needs to convert may be located
at / or /home and this pre-check and conversion process may take a long
time, which can lead to some shell and graphical application suspended.

Please give your comments if any.

-- 
Thanks,
Lu



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

end of thread, other threads:[~2017-11-29 11:24 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-27  9:41 How about adding an ioctl to convert a directory to a subvolume? Lu Fengqi
2017-11-27 10:13 ` Qu Wenruo
2017-11-27 13:02   ` Austin S. Hemmelgarn
2017-11-27 13:17     ` Qu Wenruo
2017-11-27 13:49       ` Austin S. Hemmelgarn
2017-11-28  8:29   ` Lu Fengqi
2017-11-28  8:35     ` Qu Wenruo
2017-11-28 18:48 ` David Sterba
2017-11-28 19:54   ` Austin S. Hemmelgarn
2017-11-28 20:04   ` Timofey Titovets
2017-11-29 11:23   ` Lu Fengqi

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.