diff options
| author | Anna Schumaker <anna.schumaker@oracle.com> | 2025-04-11 22:47:32 +0300 |
|---|---|---|
| committer | Anna Schumaker <anna.schumaker@oracle.com> | 2025-05-29 00:17:13 +0300 |
| commit | d2e1d783f2c619cf9d8242b67a0ab0d2915f2920 (patch) | |
| tree | 02f4984704ffd936beff6713ecc07be3229a990d /include/linux | |
| parent | 4c10fa44bc5f700e2ea21de2fbae520ba21f19d9 (diff) | |
| download | linux-d2e1d783f2c619cf9d8242b67a0ab0d2915f2920.tar.xz | |
NFS: Add support for fallocate(FALLOC_FL_ZERO_RANGE)
This implements a suggestion from Trond that we can mimic
FALLOC_FL_ZERO_RANGE by sending a compound that first does a DEALLOCATE
to punch a hole in a file, and then an ALLOCATE to fill the hole with
zeroes. There might technically be a race here, but once the DEALLOCATE
finishes any reads from the region would return zeroes anyway, so I
don't expect it to cause problems.
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/nfs4.h | 1 | ||||
| -rw-r--r-- | include/linux/nfs_fs_sb.h | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index d8cad844870a..07635f87a3fd 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h @@ -678,6 +678,7 @@ enum { NFSPROC4_CLNT_SEEK, NFSPROC4_CLNT_ALLOCATE, NFSPROC4_CLNT_DEALLOCATE, + NFSPROC4_CLNT_ZERO_RANGE, NFSPROC4_CLNT_LAYOUTSTATS, NFSPROC4_CLNT_CLONE, NFSPROC4_CLNT_COPY, diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index e02f4c4e9cc4..63141320c2a8 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h @@ -304,6 +304,7 @@ struct nfs_server { #define NFS_CAP_CASE_PRESERVING (1U << 7) #define NFS_CAP_REBOOT_LAYOUTRETURN (1U << 8) #define NFS_CAP_OFFLOAD_STATUS (1U << 9) +#define NFS_CAP_ZERO_RANGE (1U << 10) #define NFS_CAP_OPEN_XOR (1U << 12) #define NFS_CAP_DELEGTIME (1U << 13) #define NFS_CAP_POSIX_LOCK (1U << 14) |
