yaffs_linux.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
  3. *
  4. * Copyright (C) 2002-2011 Aleph One Ltd.
  5. * for Toby Churchill Ltd and Brightstar Engineering
  6. *
  7. * Created by Charles Manning <charles@aleph1.co.uk>
  8. *
  9. * This program is free software; you can redistribute it and/or modify
  10. * it under the terms of the GNU Lesser General Public License version 2.1 as
  11. * published by the Free Software Foundation.
  12. *
  13. * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
  14. */
  15. #ifndef __YAFFS_LINUX_H__
  16. #define __YAFFS_LINUX_H__
  17. #include "yportenv.h"
  18. struct yaffs_linux_context {
  19. struct list_head context_list; /* List of these we have mounted */
  20. struct yaffs_dev *dev;
  21. struct super_block *super;
  22. struct task_struct *bg_thread; /* Background thread for this device */
  23. int bg_running;
  24. struct mutex gross_lock; /* Gross locking mutex*/
  25. u8 *spare_buffer; /* For mtdif2 use. Don't know the buffer size
  26. * at compile time so we have to allocate it.
  27. */
  28. struct list_head search_contexts;
  29. struct task_struct *readdir_process;
  30. unsigned mount_id;
  31. int dirty;
  32. };
  33. #define yaffs_dev_to_lc(dev) ((struct yaffs_linux_context *)((dev)->os_context))
  34. #define yaffs_dev_to_mtd(dev) ((struct mtd_info *)((dev)->driver_context))
  35. #if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 6, 17))
  36. #define WRITE_SIZE_STR "writesize"
  37. #define WRITE_SIZE(mtd) ((mtd)->writesize)
  38. #else
  39. #define WRITE_SIZE_STR "oobblock"
  40. #define WRITE_SIZE(mtd) ((mtd)->oobblock)
  41. #endif
  42. #endif