aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_dir_sf.h
diff options
context:
space:
mode:
authorNathan Scott <nathans@sgi.com>2005-11-01 22:38:42 -0500
committerNathan Scott <nathans@sgi.com>2005-11-01 22:38:42 -0500
commita844f4510dce23c07f3923cb42138f5fdd745017 (patch)
treeffb37e9e60f02d5e92bd69bb53b568e1c991c17f /fs/xfs/xfs_dir_sf.h
parent61c1e689fbde7cb50a76262bba190715d86beab6 (diff)
[XFS] Remove xfs_macros.c, xfs_macros.h, rework headers a whole lot.
SGI-PV: 943122 SGI-Modid: xfs-linux:xfs-kern:23901a Signed-off-by: Nathan Scott <nathans@sgi.com>
Diffstat (limited to 'fs/xfs/xfs_dir_sf.h')
-rw-r--r--fs/xfs/xfs_dir_sf.h73
1 files changed, 34 insertions, 39 deletions
diff --git a/fs/xfs/xfs_dir_sf.h b/fs/xfs/xfs_dir_sf.h
index a61bcfc2a87d..2b75b767e152 100644
--- a/fs/xfs/xfs_dir_sf.h
+++ b/fs/xfs/xfs_dir_sf.h
@@ -76,49 +76,44 @@ typedef struct xfs_dir_sf_sort {
76 char *name; /* name value, pointer into buffer */ 76 char *name; /* name value, pointer into buffer */
77} xfs_dir_sf_sort_t; 77} xfs_dir_sf_sort_t;
78 78
79#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR_SF_GET_DIRINO) 79#define XFS_DIR_SF_GET_DIRINO(from,to) xfs_dir_sf_get_dirino(from, to)
80void xfs_dir_sf_get_dirino(xfs_dir_ino_t *from, xfs_ino_t *to); 80static inline void xfs_dir_sf_get_dirino(xfs_dir_ino_t *from, xfs_ino_t *to)
81#define XFS_DIR_SF_GET_DIRINO(from,to) xfs_dir_sf_get_dirino(from, to) 81{
82#else 82 *(to) = XFS_GET_DIR_INO8(*from);
83#define XFS_DIR_SF_GET_DIRINO(from,to) (*(to) = XFS_GET_DIR_INO8(*from)) 83}
84#endif 84
85#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR_SF_PUT_DIRINO) 85#define XFS_DIR_SF_PUT_DIRINO(from,to) xfs_dir_sf_put_dirino(from, to)
86void xfs_dir_sf_put_dirino(xfs_ino_t *from, xfs_dir_ino_t *to); 86static inline void xfs_dir_sf_put_dirino(xfs_ino_t *from, xfs_dir_ino_t *to)
87#define XFS_DIR_SF_PUT_DIRINO(from,to) xfs_dir_sf_put_dirino(from, to) 87{
88#else 88 XFS_PUT_DIR_INO8(*(from), *(to));
89#define XFS_DIR_SF_PUT_DIRINO(from,to) XFS_PUT_DIR_INO8(*(from), *(to)) 89}
90#endif 90
91#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR_SF_ENTSIZE_BYNAME) 91#define XFS_DIR_SF_ENTSIZE_BYNAME(len) xfs_dir_sf_entsize_byname(len)
92int xfs_dir_sf_entsize_byname(int len); 92static inline int xfs_dir_sf_entsize_byname(int len)
93#define XFS_DIR_SF_ENTSIZE_BYNAME(len) xfs_dir_sf_entsize_byname(len) 93{
94#else 94 return (uint)sizeof(xfs_dir_sf_entry_t)-1 + (len);
95#define XFS_DIR_SF_ENTSIZE_BYNAME(len) /* space a name uses */ \ 95}
96 ((uint)sizeof(xfs_dir_sf_entry_t)-1 + (len)) 96
97#endif
98#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR_SF_ENTSIZE_BYENTRY)
99int xfs_dir_sf_entsize_byentry(xfs_dir_sf_entry_t *sfep);
100#define XFS_DIR_SF_ENTSIZE_BYENTRY(sfep) xfs_dir_sf_entsize_byentry(sfep) 97#define XFS_DIR_SF_ENTSIZE_BYENTRY(sfep) xfs_dir_sf_entsize_byentry(sfep)
101#else 98static inline int xfs_dir_sf_entsize_byentry(xfs_dir_sf_entry_t *sfep)
102#define XFS_DIR_SF_ENTSIZE_BYENTRY(sfep) /* space an entry uses */ \ 99{
103 ((uint)sizeof(xfs_dir_sf_entry_t)-1 + (sfep)->namelen) 100 return (uint)sizeof(xfs_dir_sf_entry_t)-1 + (sfep)->namelen;
104#endif 101}
105#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR_SF_NEXTENTRY) 102
106xfs_dir_sf_entry_t *xfs_dir_sf_nextentry(xfs_dir_sf_entry_t *sfep);
107#define XFS_DIR_SF_NEXTENTRY(sfep) xfs_dir_sf_nextentry(sfep) 103#define XFS_DIR_SF_NEXTENTRY(sfep) xfs_dir_sf_nextentry(sfep)
108#else 104static inline xfs_dir_sf_entry_t *xfs_dir_sf_nextentry(xfs_dir_sf_entry_t *sfep)
109#define XFS_DIR_SF_NEXTENTRY(sfep) /* next entry in struct */ \ 105{
110 ((xfs_dir_sf_entry_t *) \ 106 return (xfs_dir_sf_entry_t *) \
111 ((char *)(sfep) + XFS_DIR_SF_ENTSIZE_BYENTRY(sfep))) 107 ((char *)(sfep) + XFS_DIR_SF_ENTSIZE_BYENTRY(sfep));
112#endif 108}
113#if XFS_WANT_FUNCS || (XFS_WANT_SPACE && XFSSO_XFS_DIR_SF_ALLFIT) 109
114int xfs_dir_sf_allfit(int count, int totallen);
115#define XFS_DIR_SF_ALLFIT(count,totallen) \ 110#define XFS_DIR_SF_ALLFIT(count,totallen) \
116 xfs_dir_sf_allfit(count,totallen) 111 xfs_dir_sf_allfit(count,totallen)
117#else 112static inline int xfs_dir_sf_allfit(int count, int totallen)
118#define XFS_DIR_SF_ALLFIT(count,totallen) /* will all entries fit? */ \ 113{
119 ((uint)sizeof(xfs_dir_sf_hdr_t) + \ 114 return ((uint)sizeof(xfs_dir_sf_hdr_t) + \
120 ((uint)sizeof(xfs_dir_sf_entry_t)-1)*(count) + (totallen)) 115 ((uint)sizeof(xfs_dir_sf_entry_t)-1)*(count) + (totallen));
121#endif 116}
122 117
123#if defined(XFS_DIR_TRACE) 118#if defined(XFS_DIR_TRACE)
124 119