Merge tag 'x86_asm_for_v6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
[linux-block.git] / include / linux / nfs.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
1da177e4
LT
2/*
3 * NFS protocol definitions
4 *
5 * This file contains constants mostly for Version 2 of the protocol,
6 * but also has a couple of NFSv3 bits in (notably the error codes).
7 */
8#ifndef _LINUX_NFS_H
9#define _LINUX_NFS_H
10
997b7af2
DW
11#include <linux/sunrpc/msg_prot.h>
12#include <linux/string.h>
607ca46e 13#include <uapi/linux/nfs.h>
997b7af2 14
1da177e4
LT
15/*
16 * This is the kernel NFS client file handle representation
17 */
18#define NFS_MAXFHSIZE 128
19struct nfs_fh {
20 unsigned short size;
21 unsigned char data[NFS_MAXFHSIZE];
22};
23
24/*
25 * Returns a zero iff the size and data fields match.
26 * Checks only "size" bytes in the data field.
27 */
28static inline int nfs_compare_fh(const struct nfs_fh *a, const struct nfs_fh *b)
29{
30 return a->size != b->size || memcmp(a->data, b->data, a->size) != 0;
31}
32
33static inline void nfs_copy_fh(struct nfs_fh *target, const struct nfs_fh *source)
34{
35 target->size = source->size;
36 memcpy(target->data, source->data, source->size);
37}
38
1da177e4
LT
39enum nfs3_stable_how {
40 NFS_UNSTABLE = 0,
41 NFS_DATA_SYNC = 1,
5002c586
WAA
42 NFS_FILE_SYNC = 2,
43
44 /* used by direct.c to mark verf as invalid */
45 NFS_INVALID_STABLE_HOW = -1
1da177e4 46};
1da177e4 47#endif /* _LINUX_NFS_H */