#include <libcfs/libcfs.h>
#include <libcfs/libcfs_string.h>
-char *cfs_strrstr(const char *haystack, const char *needle)
-{
- char *ptr;
-
- if (unlikely(haystack == NULL || needle == NULL))
- return NULL;
-
- if (strlen(needle) == 1)
- return strrchr(haystack, needle[0]);
-
- ptr = strstr(haystack, needle);
- if (ptr != NULL) {
- while (1) {
- char *tmp;
-
- tmp = strstr(&ptr[1], needle);
- if (tmp == NULL)
- return ptr;
-
- ptr = tmp;
- }
- }
-
- return NULL;
-}
-EXPORT_SYMBOL(cfs_strrstr);
-
/* Convert a text string to a bitmask */
int cfs_str2mask(const char *str, const char *(*bit2str)(int bit),
int *oldmask, int minmask, int allmask)