File tree Expand file tree Collapse file tree 2 files changed +20
-15
lines changed Expand file tree Collapse file tree 2 files changed +20
-15
lines changed Original file line number Diff line number Diff line change @@ -846,27 +846,12 @@ u64 nfs_timespec_to_change_attr(const struct timespec64 *ts)
846
846
}
847
847
848
848
#ifdef CONFIG_CRC32
849
- /**
850
- * nfs_fhandle_hash - calculate the crc32 hash for the filehandle
851
- * @fh - pointer to filehandle
852
- *
853
- * returns a crc32 hash for the filehandle that is compatible with
854
- * the one displayed by "wireshark".
855
- */
856
- static inline u32 nfs_fhandle_hash (const struct nfs_fh * fh )
857
- {
858
- return ~crc32_le (0xFFFFFFFF , & fh -> data [0 ], fh -> size );
859
- }
860
849
static inline u32 nfs_stateid_hash (const nfs4_stateid * stateid )
861
850
{
862
851
return ~crc32_le (0xFFFFFFFF , & stateid -> other [0 ],
863
852
NFS4_STATEID_OTHER_SIZE );
864
853
}
865
854
#else
866
- static inline u32 nfs_fhandle_hash (const struct nfs_fh * fh )
867
- {
868
- return 0 ;
869
- }
870
855
static inline u32 nfs_stateid_hash (nfs4_stateid * stateid )
871
856
{
872
857
return 0 ;
Original file line number Diff line number Diff line change 10
10
11
11
#include <linux/sunrpc/msg_prot.h>
12
12
#include <linux/string.h>
13
+ #include <linux/crc32.h>
13
14
#include <uapi/linux/nfs.h>
14
15
15
16
/*
@@ -44,4 +45,23 @@ enum nfs3_stable_how {
44
45
/* used by direct.c to mark verf as invalid */
45
46
NFS_INVALID_STABLE_HOW = -1
46
47
};
48
+
49
+ #ifdef CONFIG_CRC32
50
+ /**
51
+ * nfs_fhandle_hash - calculate the crc32 hash for the filehandle
52
+ * @fh - pointer to filehandle
53
+ *
54
+ * returns a crc32 hash for the filehandle that is compatible with
55
+ * the one displayed by "wireshark".
56
+ */
57
+ static inline u32 nfs_fhandle_hash (const struct nfs_fh * fh )
58
+ {
59
+ return ~crc32_le (0xFFFFFFFF , & fh -> data [0 ], fh -> size );
60
+ }
61
+ #else /* CONFIG_CRC32 */
62
+ static inline u32 nfs_fhandle_hash (const struct nfs_fh * fh )
63
+ {
64
+ return 0 ;
65
+ }
66
+ #endif /* CONFIG_CRC32 */
47
67
#endif /* _LINUX_NFS_H */
You can’t perform that action at this time.
0 commit comments