dir.h 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
  3. * Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved.
  4. *
  5. * This copyrighted material is made available to anyone wishing to use,
  6. * modify, copy, or redistribute it subject to the terms and conditions
  7. * of the GNU General Public License v.2.
  8. */
  9. #ifndef __DIR_DOT_H__
  10. #define __DIR_DOT_H__
  11. /**
  12. * gfs2_filldir_t - Report a directory entry to the caller of gfs2_dir_read()
  13. * @opaque: opaque data used by the function
  14. * @name: the name of the directory entry
  15. * @length: the length of the name
  16. * @offset: the entry's offset in the directory
  17. * @inum: the inode number the entry points to
  18. * @type: the type of inode the entry points to
  19. *
  20. * Returns: 0 on success, 1 if buffer full
  21. */
  22. typedef int (*gfs2_filldir_t) (void *opaque,
  23. const char *name, unsigned int length,
  24. uint64_t offset,
  25. struct gfs2_inum *inum, unsigned int type);
  26. int gfs2_filecmp(struct qstr *file1, char *file2, int len_of_file2);
  27. int gfs2_dirent_alloc(struct gfs2_inode *dip, struct buffer_head *bh,
  28. int name_len, struct gfs2_dirent **dent_out);
  29. int gfs2_dir_search(struct gfs2_inode *dip, struct qstr *filename,
  30. struct gfs2_inum *inum, unsigned int *type);
  31. int gfs2_dir_add(struct gfs2_inode *dip, struct qstr *filename,
  32. struct gfs2_inum *inum, unsigned int type);
  33. int gfs2_dir_del(struct gfs2_inode *dip, struct qstr *filename);
  34. int gfs2_dir_read(struct gfs2_inode *dip, uint64_t * offset, void *opaque,
  35. gfs2_filldir_t filldir);
  36. int gfs2_dir_mvino(struct gfs2_inode *dip, struct qstr *filename,
  37. struct gfs2_inum *new_inum, unsigned int new_type);
  38. int gfs2_dir_exhash_dealloc(struct gfs2_inode *dip);
  39. int gfs2_diradd_alloc_required(struct gfs2_inode *dip, struct qstr *filename,
  40. int *alloc_required);
  41. int gfs2_get_dir_meta(struct gfs2_inode *ip, struct gfs2_user_buffer *ub);
  42. #endif /* __DIR_DOT_H__ */