ext4_common.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /*
  2. * (C) Copyright 2011 - 2012 Samsung Electronics
  3. * EXT4 filesystem implementation in Uboot by
  4. * Uma Shankar <uma.shankar@samsung.com>
  5. * Manjunatha C Achar <a.manjunatha@samsung.com>
  6. *
  7. * ext4ls and ext4load : based on ext2 ls load support in Uboot.
  8. *
  9. * (C) Copyright 2004
  10. * esd gmbh <www.esd-electronics.com>
  11. * Reinhard Arlt <reinhard.arlt@esd-electronics.com>
  12. *
  13. * based on code from grub2 fs/ext2.c and fs/fshelp.c by
  14. * GRUB -- GRand Unified Bootloader
  15. * Copyright (C) 2003, 2004 Free Software Foundation, Inc.
  16. *
  17. * This program is free software; you can redistribute it and/or modify
  18. * it under the terms of the GNU General Public License as published by
  19. * the Free Software Foundation; either version 2 of the License, or
  20. * (at your option) any later version.
  21. *
  22. * This program is distributed in the hope that it will be useful,
  23. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  24. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  25. * GNU General Public License for more details.
  26. *
  27. * You should have received a copy of the GNU General Public License
  28. * along with this program; if not, write to the Free Software
  29. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  30. */
  31. #ifndef __EXT4_COMMON__
  32. #define __EXT4_COMMON__
  33. #include <ext_common.h>
  34. #include <ext4fs.h>
  35. #include <malloc.h>
  36. #include <asm/errno.h>
  37. #define YES 1
  38. #define NO 0
  39. #define TRUE 1
  40. #define FALSE 0
  41. #define RECOVER 1
  42. #define SCAN 0
  43. #define S_IFLNK 0120000 /* symbolic link */
  44. #define BLOCK_NO_ONE 1
  45. #define SUPERBLOCK_SECTOR 2
  46. #define SUPERBLOCK_SIZE 1024
  47. #define F_FILE 1
  48. #define zalloc(size) calloc(1, size)
  49. extern unsigned long part_offset;
  50. int ext4fs_read_inode(struct ext2_data *data, int ino,
  51. struct ext2_inode *inode);
  52. int ext4fs_read_file(struct ext2fs_node *node, int pos,
  53. unsigned int len, char *buf);
  54. int ext4fs_find_file(const char *path, struct ext2fs_node *rootnode,
  55. struct ext2fs_node **foundnode, int expecttype);
  56. int ext4fs_iterate_dir(struct ext2fs_node *dir, char *name,
  57. struct ext2fs_node **fnode, int *ftype);
  58. #endif