64-bit RES_FILE_SIZE

Change-Id: Ia17b4b4722f87fb35142948b62d4a8392ded5f73
This commit is contained in:
Ben Gras 2014-02-24 17:02:03 +01:00 committed by Lionel Sambuc
parent fdd85c4d08
commit 4694fcc1d5
19 changed files with 22 additions and 44 deletions

View file

@ -42,8 +42,7 @@
#define RES_DEV m9_ull1 #define RES_DEV m9_ull1
#define RES_GID m9_s1 #define RES_GID m9_s1
#define RES_INODE_NR m9_l1 #define RES_INODE_NR m9_l1
#define RES_FILE_SIZE_HI m9_l2 #define RES_FILE_SIZE m9_ull2
#define RES_FILE_SIZE_LO m9_l3
#define RES_MODE m9_s2 #define RES_MODE m9_s2
#define RES_NBYTES m9_l5 #define RES_NBYTES m9_l5
#define RES_OFFSET m9_s2 #define RES_OFFSET m9_s2

View file

@ -30,7 +30,7 @@ int fs_readsuper(void)
root_va = &global_pu->pu_pn_root->pn_va; root_va = &global_pu->pu_pn_root->pn_va;
fs_m_out.RES_INODE_NR = root_va->va_fileid; fs_m_out.RES_INODE_NR = root_va->va_fileid;
fs_m_out.RES_MODE = root_va->va_mode; fs_m_out.RES_MODE = root_va->va_mode;
fs_m_out.RES_FILE_SIZE_LO = root_va->va_size; fs_m_out.RES_FILE_SIZE = root_va->va_size;
fs_m_out.RES_UID = root_va->va_uid; fs_m_out.RES_UID = root_va->va_uid;
fs_m_out.RES_GID = root_va->va_gid; fs_m_out.RES_GID = root_va->va_gid;
fs_m_out.RES_FLAGS = RES_NOFLAGS; fs_m_out.RES_FLAGS = RES_NOFLAGS;

View file

@ -101,7 +101,7 @@ int fs_create(void)
/* Reply message */ /* Reply message */
fs_m_out.RES_INODE_NR = pn->pn_va.va_fileid; fs_m_out.RES_INODE_NR = pn->pn_va.va_fileid;
fs_m_out.RES_MODE = pn->pn_va.va_mode; fs_m_out.RES_MODE = pn->pn_va.va_mode;
fs_m_out.RES_FILE_SIZE_LO = pn->pn_va.va_size; fs_m_out.RES_FILE_SIZE = pn->pn_va.va_size;
/* This values are needed for the execution */ /* This values are needed for the execution */
fs_m_out.RES_UID = pn->pn_va.va_uid; fs_m_out.RES_UID = pn->pn_va.va_uid;

View file

@ -108,7 +108,7 @@ int fs_lookup(void)
fs_m_out.RES_INODE_NR = pn->pn_va.va_fileid; fs_m_out.RES_INODE_NR = pn->pn_va.va_fileid;
fs_m_out.RES_MODE = pn->pn_va.va_mode; fs_m_out.RES_MODE = pn->pn_va.va_mode;
fs_m_out.RES_FILE_SIZE_LO = pn->pn_va.va_size; fs_m_out.RES_FILE_SIZE = pn->pn_va.va_size;
fs_m_out.RES_SYMLOOP = symlinks; fs_m_out.RES_SYMLOOP = symlinks;
fs_m_out.RES_UID = pn->pn_va.va_uid; fs_m_out.RES_UID = pn->pn_va.va_uid;
fs_m_out.RES_GID = pn->pn_va.va_gid; fs_m_out.RES_GID = pn->pn_va.va_gid;

View file

@ -117,8 +117,7 @@ int do_create(void)
m_out.RES_INODE_NR = INODE_NR(ino); m_out.RES_INODE_NR = INODE_NR(ino);
m_out.RES_MODE = get_mode(ino, attr.a_mode); m_out.RES_MODE = get_mode(ino, attr.a_mode);
m_out.RES_FILE_SIZE_HI = ex64hi(attr.a_size); m_out.RES_FILE_SIZE = attr.a_size;
m_out.RES_FILE_SIZE_LO = ex64lo(attr.a_size);
m_out.RES_UID = sffs_params->p_uid; m_out.RES_UID = sffs_params->p_uid;
m_out.RES_GID = sffs_params->p_gid; m_out.RES_GID = sffs_params->p_gid;
m_out.RES_DEV = NO_DEV; m_out.RES_DEV = NO_DEV;

View file

@ -331,8 +331,7 @@ int do_lookup(void)
m_out.RES_INODE_NR = INODE_NR(cur_ino); m_out.RES_INODE_NR = INODE_NR(cur_ino);
m_out.RES_MODE = get_mode(cur_ino, attr.a_mode); m_out.RES_MODE = get_mode(cur_ino, attr.a_mode);
m_out.RES_FILE_SIZE_HI = ex64hi(attr.a_size); m_out.RES_FILE_SIZE = attr.a_size;
m_out.RES_FILE_SIZE_LO = ex64lo(attr.a_size);
m_out.RES_UID = sffs_params->p_uid; m_out.RES_UID = sffs_params->p_uid;
m_out.RES_GID = sffs_params->p_gid; m_out.RES_GID = sffs_params->p_gid;
m_out.RES_DEV = NO_DEV; m_out.RES_DEV = NO_DEV;

View file

@ -57,8 +57,7 @@ int do_readsuper(void)
m_out.RES_INODE_NR = INODE_NR(ino); m_out.RES_INODE_NR = INODE_NR(ino);
m_out.RES_MODE = get_mode(ino, attr.a_mode); m_out.RES_MODE = get_mode(ino, attr.a_mode);
m_out.RES_FILE_SIZE_HI = ex64hi(attr.a_size); m_out.RES_FILE_SIZE = attr.a_size;
m_out.RES_FILE_SIZE_LO = ex64lo(attr.a_size);
m_out.RES_UID = sffs_params->p_uid; m_out.RES_UID = sffs_params->p_uid;
m_out.RES_GID = sffs_params->p_gid; m_out.RES_GID = sffs_params->p_gid;
m_out.RES_DEV = NO_DEV; m_out.RES_DEV = NO_DEV;

View file

@ -29,8 +29,7 @@ int fs_readsuper(void)
/* Return the root inode's properties. */ /* Return the root inode's properties. */
fs_m_out.RES_INODE_NR = get_inode_number(root); fs_m_out.RES_INODE_NR = get_inode_number(root);
fs_m_out.RES_MODE = root->i_stat.mode; fs_m_out.RES_MODE = root->i_stat.mode;
fs_m_out.RES_FILE_SIZE_HI = 0; fs_m_out.RES_FILE_SIZE = root->i_stat.size;
fs_m_out.RES_FILE_SIZE_LO = root->i_stat.size;
fs_m_out.RES_UID = root->i_stat.uid; fs_m_out.RES_UID = root->i_stat.uid;
fs_m_out.RES_GID = root->i_stat.gid; fs_m_out.RES_GID = root->i_stat.gid;
fs_m_out.RES_DEV = NO_DEV; fs_m_out.RES_DEV = NO_DEV;

View file

@ -303,8 +303,7 @@ int fs_lookup(void)
/* On success, leave the resulting file open and return its details. */ /* On success, leave the resulting file open and return its details. */
fs_m_out.RES_INODE_NR = get_inode_number(cur_ino); fs_m_out.RES_INODE_NR = get_inode_number(cur_ino);
fs_m_out.RES_MODE = cur_ino->i_stat.mode; fs_m_out.RES_MODE = cur_ino->i_stat.mode;
fs_m_out.RES_FILE_SIZE_HI = 0; fs_m_out.RES_FILE_SIZE = cur_ino->i_stat.size;
fs_m_out.RES_FILE_SIZE_LO = cur_ino->i_stat.size;
fs_m_out.RES_UID = cur_ino->i_stat.uid; fs_m_out.RES_UID = cur_ino->i_stat.uid;
fs_m_out.RES_GID = cur_ino->i_stat.gid; fs_m_out.RES_GID = cur_ino->i_stat.gid;
fs_m_out.RES_DEV = cur_ino->i_stat.dev; fs_m_out.RES_DEV = cur_ino->i_stat.dev;

View file

@ -155,7 +155,7 @@ int fs_readsuper()
/* Root inode properties */ /* Root inode properties */
fs_m_out.RES_INODE_NR = root_ip->i_num; fs_m_out.RES_INODE_NR = root_ip->i_num;
fs_m_out.RES_MODE = root_ip->i_mode; fs_m_out.RES_MODE = root_ip->i_mode;
fs_m_out.RES_FILE_SIZE_LO = root_ip->i_size; fs_m_out.RES_FILE_SIZE = root_ip->i_size;
fs_m_out.RES_UID = root_ip->i_uid; fs_m_out.RES_UID = root_ip->i_uid;
fs_m_out.RES_GID = root_ip->i_gid; fs_m_out.RES_GID = root_ip->i_gid;
fs_m_out.RES_FLAGS = RES_HASPEEK; fs_m_out.RES_FLAGS = RES_HASPEEK;

View file

@ -63,7 +63,7 @@ int fs_create()
/* Reply message */ /* Reply message */
fs_m_out.RES_INODE_NR = rip->i_num; fs_m_out.RES_INODE_NR = rip->i_num;
fs_m_out.RES_MODE = rip->i_mode; fs_m_out.RES_MODE = rip->i_mode;
fs_m_out.RES_FILE_SIZE_LO = rip->i_size; fs_m_out.RES_FILE_SIZE = rip->i_size;
/* This values are needed for the execution */ /* This values are needed for the execution */
fs_m_out.RES_UID = rip->i_uid; fs_m_out.RES_UID = rip->i_uid;

View file

@ -100,7 +100,7 @@ int fs_lookup()
fs_m_out.RES_INODE_NR = rip->i_num; fs_m_out.RES_INODE_NR = rip->i_num;
fs_m_out.RES_MODE = rip->i_mode; fs_m_out.RES_MODE = rip->i_mode;
fs_m_out.RES_FILE_SIZE_LO = rip->i_size; fs_m_out.RES_FILE_SIZE = rip->i_size;
fs_m_out.RES_SYMLOOP = symlinks; fs_m_out.RES_SYMLOOP = symlinks;
fs_m_out.RES_UID = rip->i_uid; fs_m_out.RES_UID = rip->i_uid;
fs_m_out.RES_GID = rip->i_gid; fs_m_out.RES_GID = rip->i_gid;

View file

@ -48,7 +48,7 @@ int fs_readsuper() {
/* Return some root inode properties */ /* Return some root inode properties */
fs_m_out.RES_INODE_NR = ID_DIR_RECORD(v_pri.dir_rec_root); fs_m_out.RES_INODE_NR = ID_DIR_RECORD(v_pri.dir_rec_root);
fs_m_out.RES_MODE = v_pri.dir_rec_root->d_mode; fs_m_out.RES_MODE = v_pri.dir_rec_root->d_mode;
fs_m_out.RES_FILE_SIZE_LO = v_pri.dir_rec_root->d_file_size; fs_m_out.RES_FILE_SIZE = v_pri.dir_rec_root->d_file_size;
fs_m_out.RES_UID = SYS_UID; /* Always root */ fs_m_out.RES_UID = SYS_UID; /* Always root */
fs_m_out.RES_GID = SYS_GID; /* operator */ fs_m_out.RES_GID = SYS_GID; /* operator */
fs_m_out.RES_FLAGS = RES_NOFLAGS; fs_m_out.RES_FLAGS = RES_NOFLAGS;

View file

@ -60,7 +60,7 @@ int fs_lookup() {
fs_m_out.RES_INODE_NR = ID_DIR_RECORD(dir); fs_m_out.RES_INODE_NR = ID_DIR_RECORD(dir);
fs_m_out.RES_MODE = dir->d_mode; fs_m_out.RES_MODE = dir->d_mode;
fs_m_out.RES_FILE_SIZE_LO = dir->d_file_size; fs_m_out.RES_FILE_SIZE = dir->d_file_size;
fs_m_out.RES_SYMLOOP = 0; fs_m_out.RES_SYMLOOP = 0;
fs_m_out.RES_UID = SYS_UID; /* root */ fs_m_out.RES_UID = SYS_UID; /* root */
fs_m_out.RES_GID = SYS_GID; /* operator */ fs_m_out.RES_GID = SYS_GID; /* operator */

View file

@ -103,7 +103,7 @@ int fs_readsuper()
/* Root inode properties */ /* Root inode properties */
fs_m_out.RES_INODE_NR = root_ip->i_num; fs_m_out.RES_INODE_NR = root_ip->i_num;
fs_m_out.RES_MODE = root_ip->i_mode; fs_m_out.RES_MODE = root_ip->i_mode;
fs_m_out.RES_FILE_SIZE_LO = root_ip->i_size; fs_m_out.RES_FILE_SIZE = root_ip->i_size;
fs_m_out.RES_UID = root_ip->i_uid; fs_m_out.RES_UID = root_ip->i_uid;
fs_m_out.RES_GID = root_ip->i_gid; fs_m_out.RES_GID = root_ip->i_gid;
fs_m_out.RES_FLAGS = RES_HASPEEK; fs_m_out.RES_FLAGS = RES_HASPEEK;

View file

@ -54,7 +54,7 @@ int fs_create()
/* Reply message */ /* Reply message */
fs_m_out.RES_INODE_NR = rip->i_num; fs_m_out.RES_INODE_NR = rip->i_num;
fs_m_out.RES_MODE = rip->i_mode; fs_m_out.RES_MODE = rip->i_mode;
fs_m_out.RES_FILE_SIZE_LO = rip->i_size; fs_m_out.RES_FILE_SIZE = rip->i_size;
/* These values are needed for the execution */ /* These values are needed for the execution */
fs_m_out.RES_UID = rip->i_uid; fs_m_out.RES_UID = rip->i_uid;

View file

@ -99,7 +99,7 @@ int fs_lookup()
fs_m_out.RES_INODE_NR = rip->i_num; fs_m_out.RES_INODE_NR = rip->i_num;
fs_m_out.RES_MODE = rip->i_mode; fs_m_out.RES_MODE = rip->i_mode;
fs_m_out.RES_FILE_SIZE_LO = rip->i_size; fs_m_out.RES_FILE_SIZE = rip->i_size;
fs_m_out.RES_SYMLOOP = symlinks; fs_m_out.RES_SYMLOOP = symlinks;
fs_m_out.RES_UID = rip->i_uid; fs_m_out.RES_UID = rip->i_uid;
fs_m_out.RES_GID = rip->i_gid; fs_m_out.RES_GID = rip->i_gid;

View file

@ -44,7 +44,7 @@ int fs_newnode(message *fs_m_in, message *fs_m_out)
/* Fill in the fields of the response message */ /* Fill in the fields of the response message */
fs_m_out->RES_INODE_NR = rip->i_num; fs_m_out->RES_INODE_NR = rip->i_num;
fs_m_out->RES_MODE = rip->i_mode; fs_m_out->RES_MODE = rip->i_mode;
fs_m_out->RES_FILE_SIZE_LO = rip->i_size; fs_m_out->RES_FILE_SIZE = rip->i_size;
fs_m_out->RES_UID = rip->i_uid; fs_m_out->RES_UID = rip->i_uid;
fs_m_out->RES_GID = rip->i_gid; fs_m_out->RES_GID = rip->i_gid;
fs_m_out->RES_DEV = dev; fs_m_out->RES_DEV = dev;

View file

@ -188,11 +188,7 @@ int req_create(
res->fs_e = m.m_source; res->fs_e = m.m_source;
res->inode_nr = (ino_t) m.RES_INODE_NR; res->inode_nr = (ino_t) m.RES_INODE_NR;
res->fmode = (mode_t) m.RES_MODE; res->fmode = (mode_t) m.RES_MODE;
if (vmp->m_fs_flags & RES_64BIT) { res->fsize = m.RES_FILE_SIZE;
res->fsize = make64(m.RES_FILE_SIZE_LO, m.RES_FILE_SIZE_HI);
} else {
res->fsize = m.RES_FILE_SIZE_LO;
}
res->uid = (uid_t) m.RES_UID; res->uid = (uid_t) m.RES_UID;
res->gid = (gid_t) m.RES_GID; res->gid = (gid_t) m.RES_GID;
res->dev = NO_DEV; res->dev = NO_DEV;
@ -463,11 +459,7 @@ int req_lookup(
case OK: case OK:
res->inode_nr = (ino_t) m.RES_INODE_NR; res->inode_nr = (ino_t) m.RES_INODE_NR;
res->fmode = (mode_t) m.RES_MODE; res->fmode = (mode_t) m.RES_MODE;
if (vmp->m_fs_flags & RES_64BIT) { res->fsize = m.RES_FILE_SIZE;
res->fsize = make64(m.RES_FILE_SIZE_LO, m.RES_FILE_SIZE_HI);
} else {
res->fsize = m.RES_FILE_SIZE_LO;
}
res->dev = m.RES_DEV; res->dev = m.RES_DEV;
res->uid = (uid_t) m.RES_UID; res->uid = (uid_t) m.RES_UID;
res->gid = (gid_t) m.RES_GID; res->gid = (gid_t) m.RES_GID;
@ -620,11 +612,7 @@ int req_newnode(
res->fs_e = m.m_source; res->fs_e = m.m_source;
res->inode_nr = (ino_t) m.RES_INODE_NR; res->inode_nr = (ino_t) m.RES_INODE_NR;
res->fmode = (mode_t) m.RES_MODE; res->fmode = (mode_t) m.RES_MODE;
if (vmp->m_fs_flags & RES_64BIT) { res->fsize = m.RES_FILE_SIZE;
res->fsize = make64(m.RES_FILE_SIZE_LO, m.RES_FILE_SIZE_HI);
} else {
res->fsize = m.RES_FILE_SIZE_LO;
}
res->dev = m.RES_DEV; res->dev = m.RES_DEV;
res->uid = (uid_t) m.RES_UID; res->uid = (uid_t) m.RES_UID;
res->gid = (gid_t) m.RES_GID; res->gid = (gid_t) m.RES_GID;
@ -771,11 +759,7 @@ int req_readsuper(
res->fs_e = m.m_source; res->fs_e = m.m_source;
res->inode_nr = (ino_t) m.RES_INODE_NR; res->inode_nr = (ino_t) m.RES_INODE_NR;
res->fmode = (mode_t) m.RES_MODE; res->fmode = (mode_t) m.RES_MODE;
if (m.RES_FLAGS & RES_64BIT) { res->fsize = m.RES_FILE_SIZE;
res->fsize = make64(m.RES_FILE_SIZE_LO, m.RES_FILE_SIZE_HI);
} else {
res->fsize = m.RES_FILE_SIZE_LO;
}
res->uid = (uid_t) m.RES_UID; res->uid = (uid_t) m.RES_UID;
res->gid = (gid_t) m.RES_GID; res->gid = (gid_t) m.RES_GID;
*fs_flags = m.RES_FLAGS; *fs_flags = m.RES_FLAGS;