xfs_filestream.h 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /*
  2. * Copyright (c) 2006-2007 Silicon Graphics, Inc.
  3. * All Rights Reserved.
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License as
  7. * published by the Free Software Foundation.
  8. *
  9. * This program is distributed in the hope that it would be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write the Free Software Foundation,
  16. * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  17. */
  18. #ifndef __XFS_FILESTREAM_H__
  19. #define __XFS_FILESTREAM_H__
  20. struct xfs_mount;
  21. struct xfs_inode;
  22. struct xfs_perag;
  23. struct xfs_bmalloca;
  24. #ifdef XFS_FILESTREAMS_TRACE
  25. #define XFS_FSTRM_KTRACE_INFO 1
  26. #define XFS_FSTRM_KTRACE_AGSCAN 2
  27. #define XFS_FSTRM_KTRACE_AGPICK1 3
  28. #define XFS_FSTRM_KTRACE_AGPICK2 4
  29. #define XFS_FSTRM_KTRACE_UPDATE 5
  30. #define XFS_FSTRM_KTRACE_FREE 6
  31. #define XFS_FSTRM_KTRACE_ITEM_LOOKUP 7
  32. #define XFS_FSTRM_KTRACE_ASSOCIATE 8
  33. #define XFS_FSTRM_KTRACE_MOVEAG 9
  34. #define XFS_FSTRM_KTRACE_ORPHAN 10
  35. #define XFS_FSTRM_KTRACE_SIZE 16384
  36. extern ktrace_t *xfs_filestreams_trace_buf;
  37. #endif
  38. /* allocation selection flags */
  39. typedef enum xfs_fstrm_alloc {
  40. XFS_PICK_USERDATA = 1,
  41. XFS_PICK_LOWSPACE = 2,
  42. } xfs_fstrm_alloc_t;
  43. /* prototypes for filestream.c */
  44. int xfs_filestream_init(void);
  45. void xfs_filestream_uninit(void);
  46. int xfs_filestream_mount(struct xfs_mount *mp);
  47. void xfs_filestream_unmount(struct xfs_mount *mp);
  48. xfs_agnumber_t xfs_filestream_lookup_ag(struct xfs_inode *ip);
  49. int xfs_filestream_associate(struct xfs_inode *dip, struct xfs_inode *ip);
  50. void xfs_filestream_deassociate(struct xfs_inode *ip);
  51. int xfs_filestream_new_ag(struct xfs_bmalloca *ap, xfs_agnumber_t *agp);
  52. /* filestreams for the inode? */
  53. static inline int
  54. xfs_inode_is_filestream(
  55. struct xfs_inode *ip)
  56. {
  57. return (ip->i_mount->m_flags & XFS_MOUNT_FILESTREAMS) ||
  58. xfs_iflags_test(ip, XFS_IFILESTREAM) ||
  59. (ip->i_d.di_flags & XFS_DIFLAG_FILESTREAM);
  60. }
  61. #endif /* __XFS_FILESTREAM_H__ */