drm/tests: Add test for drm_atomic_helper_check_modeset()
[drm/drm-misc.git] / fs / xfs / xfs_exchrange.h
blobbc1298aba806baa2152f3890cd4df3b0fb2c7911
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3 * Copyright (c) 2020-2024 Oracle. All Rights Reserved.
4 * Author: Darrick J. Wong <djwong@kernel.org>
5 */
6 #ifndef __XFS_EXCHRANGE_H__
7 #define __XFS_EXCHRANGE_H__
9 /* Update the mtime/cmtime of file1 and file2 */
10 #define __XFS_EXCHANGE_RANGE_UPD_CMTIME1 (1ULL << 63)
11 #define __XFS_EXCHANGE_RANGE_UPD_CMTIME2 (1ULL << 62)
13 /* Freshness check required */
14 #define __XFS_EXCHANGE_RANGE_CHECK_FRESH2 (1ULL << 61)
16 #define XFS_EXCHANGE_RANGE_PRIV_FLAGS (__XFS_EXCHANGE_RANGE_UPD_CMTIME1 | \
17 __XFS_EXCHANGE_RANGE_UPD_CMTIME2 | \
18 __XFS_EXCHANGE_RANGE_CHECK_FRESH2)
20 struct xfs_exchrange {
21 struct file *file1;
22 struct file *file2;
24 loff_t file1_offset;
25 loff_t file2_offset;
26 u64 length;
28 u64 flags; /* XFS_EXCHANGE_RANGE flags */
30 /* file2 metadata for freshness checks */
31 u64 file2_ino;
32 struct timespec64 file2_mtime;
33 struct timespec64 file2_ctime;
34 u32 file2_gen;
37 long xfs_ioc_exchange_range(struct file *file,
38 struct xfs_exchange_range __user *argp);
39 long xfs_ioc_start_commit(struct file *file,
40 struct xfs_commit_range __user *argp);
41 long xfs_ioc_commit_range(struct file *file,
42 struct xfs_commit_range __user *argp);
44 struct xfs_exchmaps_req;
46 void xfs_exchrange_ilock(struct xfs_trans *tp, struct xfs_inode *ip1,
47 struct xfs_inode *ip2);
48 void xfs_exchrange_iunlock(struct xfs_inode *ip1, struct xfs_inode *ip2);
50 int xfs_exchrange_estimate(struct xfs_exchmaps_req *req);
52 #endif /* __XFS_EXCHRANGE_H__ */