Whamcloud - gitweb
LU-9859 tracefile: convert list_for_each_entry_safe() to while(!list_empty())
[fs/lustre-release.git] / libcfs / libcfs / libcfs_string.c
index 2ff9708..40f7aaf 100644 (file)
 #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)
@@ -138,34 +111,6 @@ int cfs_str2mask(const char *str, const char *(*bit2str)(int bit),
 }
 EXPORT_SYMBOL(cfs_str2mask);
 
-/* get the first string out of @str */
-char *cfs_firststr(char *str, size_t size)
-{
-       size_t i = 0;
-       char *end;
-
-       /* trim leading spaces */
-       while (i < size && *str && isspace(*str)) {
-               ++i;
-               ++str;
-       }
-
-       /* string with all spaces */
-       if (*str == '\0')
-               goto out;
-
-       end = str;
-       while (i < size && *end != '\0' && !isspace(*end)) {
-               ++i;
-               ++end;
-       }
-
-       *end = '\0';
-out:
-       return str;
-}
-EXPORT_SYMBOL(cfs_firststr);
-
 /**
  * Extracts tokens from strings.
  *