build userspace with -funsigned-char anyway.
*/
extern void hash_init(void);
-extern xfs_dahash_t xfs_da_hashname(char *name, int namelen);
extern int libxfs_alloc_file_space (xfs_inode_t *, xfs_off_t,
xfs_off_t, int, int);
-extern xfs_dahash_t libxfs_da_hashname (char *, int);
+extern xfs_dahash_t libxfs_da_hashname (uchar_t *, int);
extern int libxfs_attr_leaf_newentsize (xfs_da_args_t *, int, int *);
extern xfs_filblks_t libxfs_bmbt_get_blockcount (xfs_bmbt_rec_t *);
typedef __int64_t xfs_daddr_t;
typedef char* xfs_caddr_t;
+typedef unsigned char uchar_t;
+
/* long and pointer must be either 32 bit or 64 bit */
#undef HAVE_64BIT_LONG
#undef HAVE_32BIT_LONG
* Structure to ease passing around component names.
*/
typedef struct xfs_da_args {
- char *name; /* string (maybe not NULL terminated) */
+ uchar_t *name; /* string (maybe not NULL terminated) */
int namelen; /* length of string (maybe no NULL) */
- char *value; /* set of bytes (maybe contain NULLs) */
+ uchar_t *value; /* set of bytes (maybe contain NULLs) */
int valuelen; /* length of value */
int flags; /* argument flags (eg: ATTR_NOCREATE) */
xfs_dahash_t hashval; /* hash value of name */
int xfs_da_shrink_inode(xfs_da_args_t *args, xfs_dablk_t dead_blkno,
xfs_dabuf_t *dead_buf);
-uint xfs_da_hashname(char *name_string, int name_length);
+uint xfs_da_hashname(uchar_t *name_string, int name_length);
uint xfs_da_log2_roundup(uint i);
xfs_da_state_t *xfs_da_state_alloc(void);
void xfs_da_state_free(xfs_da_state_t *state);
#define XFS_ITRUNC_MAYBE 0x2
/*
- * if XFS_BIG_FILES, 2^(32+PAGE_SHIFT) - 1 (due to linux page cache),
+ * if XFS_BIG_FILES, 2^(31+PAGE_SHIFT) - 1 (due to linux page cache),
* else 2^40 - 1 (40=31+9) (might be an int holding a block #)
* For the not XFS_BIG_FILES case, the value could be 1 higher but we don't
* do that, for symmetry.
*
* NOTE: XFS itself can handle 2^63 - 1 (largest positive value of xfs_fsize_t)
- * but Linux can't go above 2^(32+PAGE_SHIFT)-1: the Linux VM uses a 32 bit
- * page number index to index cache data, so 2^32 * PAGE_SIZE is as big as
+ * but Linux can't go above 2^(31+PAGE_SHIFT)-1: the Linux VM uses a 32 bit
+ * signed variable to index cache data, so 2^31 * PAGE_SIZE is as big as
* you can go.
*/
#if XFS_BIG_FILES
-#define XFS_MAX_FILE_OFFSET ((long long)((1ULL<<(32+PAGE_SHIFT))-1ULL))
+#define XFS_MAX_FILE_OFFSET ((long long)((1ULL<<(31+PAGE_SHIFT))-1ULL))
#else
#define XFS_MAX_FILE_OFFSET ((1LL<<40)-1LL)
#endif
* This is implemented with some source-level loop unrolling.
*/
xfs_dahash_t
-xfs_da_hashname(char *name, int namelen)
+xfs_da_hashname(uchar_t *name, int namelen)
{
xfs_dahash_t hash;