xfs
[Top] [All Lists]

[PATCH 33/71] xfs: support FS_XFLAG_REFLINK on reflink filesystems

To: david@xxxxxxxxxxxxx, darrick.wong@xxxxxxxxxx
Subject: [PATCH 33/71] xfs: support FS_XFLAG_REFLINK on reflink filesystems
From: "Darrick J. Wong" <darrick.wong@xxxxxxxxxx>
Date: Thu, 25 Aug 2016 16:50:05 -0700
Cc: linux-xfs@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <147216879156.4420.2446767701729565218.stgit@xxxxxxxxxxxxxxxx>
References: <147216879156.4420.2446767701729565218.stgit@xxxxxxxxxxxxxxxx>
User-agent: StGit/0.17.1-dirty
Add support for reporting the "reflink" inode flag in the XFS-specific
getxflags ioctl, and allow the user to clear the flag if file size is
zero.

v2: Move the reflink flag out of the way of the DAX flag, and add the
new cowextsize flag.

v3: do not report (or allow changes to) FL_NOCOW_FL, since we don't
support a flag to prevent CoWing and the reflink flag is a poor
proxy.  We'll try to design away the need for the NOCOW flag.

Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
---
 include/darwin.h  |    8 ++++++++
 include/freebsd.h |    7 +++++++
 include/irix.h    |    7 +++++++
 include/linux.h   |    8 ++++++++
 4 files changed, 30 insertions(+)


diff --git a/include/darwin.h b/include/darwin.h
index 140386a..71a63a1 100644
--- a/include/darwin.h
+++ b/include/darwin.h
@@ -320,4 +320,12 @@ struct fsxattr {
 
 #endif
 
+#ifndef FS_XFLAG_REFLINK
+#define FS_XFLAG_REFLINK       0x00010000      /* file is reflinked */
+#endif
+
+#ifndef FS_XFLAG_COWEXTSIZE
+#define FS_XFLAG_COWEXTSIZE    0x00020000      /* CoW extent size allocator 
hint */
+#endif
+
 #endif /* __XFS_DARWIN_H__ */
diff --git a/include/freebsd.h b/include/freebsd.h
index 668dcea..e8970a5 100644
--- a/include/freebsd.h
+++ b/include/freebsd.h
@@ -209,5 +209,12 @@ struct fsxattr {
 
 #endif
 
+#ifndef FS_XFLAG_REFLINK
+#define FS_XFLAG_REFLINK       0x00010000      /* file is reflinked */
+#endif
+
+#ifndef FS_XFLAG_COWEXTSIZE
+#define FS_XFLAG_COWEXTSIZE    0x00020000      /* CoW extent size allocator 
hint */
+#endif
 
 #endif /* __XFS_FREEBSD_H__ */
diff --git a/include/irix.h b/include/irix.h
index 8b9d588..fea7c7c 100644
--- a/include/irix.h
+++ b/include/irix.h
@@ -454,6 +454,13 @@ struct fsxattr {
 
 #endif
 
+#ifndef FS_XFLAG_REFLINK
+#define FS_XFLAG_REFLINK       0x00010000      /* file is reflinked */
+#endif
+
+#ifndef FS_XFLAG_COWEXTSIZE
+#define FS_XFLAG_COWEXTSIZE    0x00020000      /* CoW extent size allocator 
hint */
+#endif
 
 /**
  * Abstraction of mountpoints.
diff --git a/include/linux.h b/include/linux.h
index 1663930..67337d6 100644
--- a/include/linux.h
+++ b/include/linux.h
@@ -209,4 +209,12 @@ struct fsxattr {
 
 #endif
 
+#ifndef FS_XFLAG_REFLINK
+#define FS_XFLAG_REFLINK       0x00010000      /* file is reflinked */
+#endif
+
+#ifndef FS_XFLAG_COWEXTSIZE
+#define FS_XFLAG_COWEXTSIZE    0x00020000      /* CoW extent size allocator 
hint */
+#endif
+
 #endif /* __XFS_LINUX_H__ */

<Prev in Thread] Current Thread [Next in Thread>