Some clean up and more modular cache management
[yaffs2.git] / direct / ydirectenv.h
index b15147cad55fccf8e53578915d94b273070a0711..b477343d683f52f8f2d710603321c7feaa4426ec 100644 (file)
@@ -1,8 +1,7 @@
 /*
  * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
  *
- * Copyright (C) 2002-2011 Aleph One Ltd.
- *   for Toby Churchill Ltd and Brightstar Engineering
+ * Copyright (C) 2002-2018 Aleph One Ltd.
  *
  * Created by Charles Manning <charles@aleph1.co.uk>
  *
@@ -39,6 +38,9 @@ void yaffs_bug_fn(const char *file_name, int line_no);
 #define Y_LOFF_T loff_t
 #endif
 
+/* Some RTOSs (eg. VxWorks) need strnlen. */
+size_t strnlen(const char *s, size_t maxlen);
+
 #define yaffs_strcat(a, b)     strcat(a, b)
 #define yaffs_strcpy(a, b)     strcpy(a, b)
 #define yaffs_strncpy(a, b, c) strncpy(a, b, c)
@@ -71,11 +73,15 @@ void yaffs_bug_fn(const char *file_name, int line_no);
 
 #define cond_resched()  do {} while (0)
 
+#ifdef CONFIG_YAFFS_NO_TRACE
+#define yaffs_trace(...) do { } while (0)
+#else
 #define yaffs_trace(msk, fmt, ...) do { \
        if (yaffs_trace_mask & (msk)) \
                printf("yaffs: " fmt "\n", ##__VA_ARGS__); \
 } while (0)
 
+#endif
 
 #define YAFFS_LOSTNFOUND_NAME          "lost+found"
 #define YAFFS_LOSTNFOUND_PREFIX                "obj"