]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - include/uapi/linux/falloc.h
fs: Add support FALLOC_FL_INSERT_RANGE for fallocate
[linux.git] / include / uapi / linux / falloc.h
index d1197ae3723ce5193b0526ea8dfa0511d39c8407..3e445a760f14b384bd78636f5f90b2bcb4f723cf 100644 (file)
  */
 #define FALLOC_FL_ZERO_RANGE           0x10
 
+/*
+ * FALLOC_FL_INSERT_RANGE is use to insert space within the file size without
+ * overwriting any existing data. The contents of the file beyond offset are
+ * shifted towards right by len bytes to create a hole.  As such, this
+ * operation will increase the size of the file by len bytes.
+ *
+ * Different filesystems may implement different limitations on the granularity
+ * of the operation. Most will limit operations to filesystem block size
+ * boundaries, but this boundary may be larger or smaller depending on
+ * the filesystem and/or the configuration of the filesystem or file.
+ *
+ * Attempting to insert space using this flag at OR beyond the end of
+ * the file is considered an illegal operation - just use ftruncate(2) or
+ * fallocate(2) with mode 0 for such type of operations.
+ */
+#define FALLOC_FL_INSERT_RANGE         0x20
+
 #endif /* _UAPI_FALLOC_H_ */