File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -846,27 +846,12 @@ u64 nfs_timespec_to_change_attr(const struct timespec64 *ts)
846846}
847847
848848#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- }
860849static inline u32 nfs_stateid_hash (const nfs4_stateid * stateid )
861850{
862851 return ~crc32_le (0xFFFFFFFF , & stateid -> other [0 ],
863852 NFS4_STATEID_OTHER_SIZE );
864853}
865854#else
866- static inline u32 nfs_fhandle_hash (const struct nfs_fh * fh )
867- {
868- return 0 ;
869- }
870855static inline u32 nfs_stateid_hash (nfs4_stateid * stateid )
871856{
872857 return 0 ;
Original file line number Diff line number Diff line change 1010
1111#include <linux/sunrpc/msg_prot.h>
1212#include <linux/string.h>
13+ #include <linux/crc32.h>
1314#include <uapi/linux/nfs.h>
1415
1516/*
@@ -44,4 +45,23 @@ enum nfs3_stable_how {
4445 /* used by direct.c to mark verf as invalid */
4546 NFS_INVALID_STABLE_HOW = -1
4647};
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 */
4767#endif /* _LINUX_NFS_H */
You can’t perform that action at this time.
0 commit comments