Fix various file system warnings

Change-Id: Ied10498c3ae14f9f2fd06914f23239df330fa296
This commit is contained in:
David van Moolenbroek 2013-08-31 22:59:44 +02:00 committed by Lionel Sambuc
parent cc810ee4d9
commit dc1c50abf2
6 changed files with 12 additions and 11 deletions

View file

@ -28,7 +28,7 @@ int fs_ftrunc(void)
if (end == 0) {
struct vattr va;
if (pn->pn_va.va_size == start)
if (pn->pn_va.va_size == (u_quad_t) start)
return(OK);
if (global_pu->pu_ops.puffs_node_setattr == NULL)
@ -160,8 +160,8 @@ int fs_rdlink()
char path[PATH_MAX];
PUFFS_MAKECRED(pcr, &global_kcred);
copylen = fs_m_in.REQ_MEM_SIZE < UMAX_FILE_POS ?
fs_m_in.REQ_MEM_SIZE : UMAX_FILE_POS;
copylen = (size_t) fs_m_in.REQ_MEM_SIZE < UMAX_FILE_POS ?
(size_t) fs_m_in.REQ_MEM_SIZE : UMAX_FILE_POS;
assert(copylen <= PATH_MAX);

View file

@ -74,8 +74,8 @@ processvattr(const char *path, const struct vattr *va, int regular)
return errno;
/* sloppy */
if (va->va_atime.tv_sec != (unsigned)PUFFS_VNOVAL
|| va->va_mtime.tv_sec != (unsigned)PUFFS_VNOVAL) {
if (va->va_atime.tv_sec != PUFFS_VNOVAL
|| va->va_mtime.tv_sec != PUFFS_VNOVAL) {
/* FIXME: nsec too */
tbuf.actime = va->va_atime.tv_sec;
tbuf.modtime = va->va_mtime.tv_sec;
@ -493,7 +493,7 @@ puffs_null_node_readdir(struct puffs_usermount *pu, puffs_cookie_t opc,
/* FIXME: DIRENT_SIZE macro? For now do calculations here */
int namelen;
char* cp;
int dirent_size;
size_t dirent_size;
entry = readdir(dp);

View file

@ -318,7 +318,7 @@ int fs_slink()
if (r != OK) return(r);
target[fs_m_in.REQ_MEM_SIZE] = '\0';
if (strlen(target) != fs_m_in.REQ_MEM_SIZE) {
if (strlen(target) != (size_t) fs_m_in.REQ_MEM_SIZE) {
/* This can happen if the user provides a buffer
* with a \0 in it. This can cause a lot of trouble
* when the symlink is used later. We could just use

View file

@ -169,7 +169,7 @@ fillvnopmask(struct puffs_ops *pops, uint8_t *opmask)
/*ARGSUSED*/
static void
__dead static void
puffs_defaulterror(struct puffs_usermount *pu, uint8_t type,
int error, const char *str, puffs_cookie_t cookie)
{
@ -190,7 +190,8 @@ puffs_getstate(struct puffs_usermount *pu)
void
puffs_setstacksize(struct puffs_usermount *pu, size_t ss)
{
long psize, minsize;
size_t minsize;
int psize;
int stackshift;
int bonus;

View file

@ -76,7 +76,7 @@ int fs_readwrite(void)
return(EINVAL);
puffs_vattr_null(&va);
if ( (pos + bytes_left) > pn->pn_va.va_size)
if ((u_quad_t)(pos + bytes_left) > pn->pn_va.va_size)
va.va_size = bytes_left + pos;
va.va_ctime = va.va_mtime = clock_timespec();
va.va_atime = pn->pn_va.va_atime;

View file

@ -93,7 +93,7 @@ int fs_statvfs()
struct statvfs st;
struct super_block *sp;
int r, scale;
uint64_t used;
u64_t used;
sp = get_super(fs_dev);