]> Zhao Yanbai Git Server - minix.git/commitdiff
Message types for VFS lookup
authorLionel Sambuc <lionel@minix3.org>
Mon, 28 Apr 2014 15:45:52 +0000 (17:45 +0200)
committerLionel Sambuc <lionel@minix3.org>
Mon, 28 Jul 2014 15:05:25 +0000 (17:05 +0200)
Change-Id: Ic4d2a616ebc986c4b405b6b9ee0bd7c3b59e81d2

include/minix/ipc.h
lib/libpuffs/path.c
lib/libsffs/lookup.c
lib/libvtreefs/path.c
servers/ext2/path.c
servers/iso9660fs/path.c
servers/mfs/path.c
servers/vfs/request.c

index f0989f95caf9c5ce086b6385a5a3e1444f13f235..84a52817e7551a7372be26f6825edf8c53cecd3a 100644 (file)
@@ -146,6 +146,39 @@ typedef struct {
 } mess_sigcalls;
 _ASSERT_MSG_SIZE(mess_sigcalls);
 
+typedef struct {
+       ino_t dir_ino;
+       ino_t root_ino;
+
+       uint32_t flags;
+       size_t path_len;
+       size_t path_size;
+       size_t ucred_size;
+       cp_grant_id_t grant_path;
+       cp_grant_id_t grant_ucred;
+       uid_t uid;
+       gid_t gid;
+
+       uint8_t data[8];
+} mess_vfs_fs_lookup;
+_ASSERT_MSG_SIZE(mess_vfs_fs_lookup);
+
+typedef struct {
+       off_t offset;
+       off_t file_size;
+       dev_t device;
+       ino_t inode;
+
+       mode_t mode;
+       uid_t uid;
+       gid_t gid;
+
+       uint16_t symloop;
+
+       uint8_t data[10];
+} mess_fs_vfs_lookup;
+_ASSERT_MSG_SIZE(mess_fs_vfs_lookup);
+
 typedef struct {
        dev_t device;
 
@@ -242,6 +275,8 @@ typedef struct {
        mess_mmap m_mmap;
        mess_notify m_notify;
        mess_sigcalls m_sigcalls;
+       mess_vfs_fs_lookup m_vfs_fs_lookup;
+       mess_fs_vfs_lookup m_fs_vfs_lookup;
        mess_vfs_fs_readsuper m_vfs_fs_readsuper;
        mess_fs_vfs_readsuper m_fs_vfs_readsuper;
        mess_vfs_utimens m_vfs_utimens;
index 40030a6b1d422928588d2024e7c7f84091acb708..be93ab2353bf7092885d106445cfda995f948bc1 100644 (file)
@@ -41,15 +41,15 @@ int fs_lookup(void)
   int r, r1, flags, symlinks;
   unsigned int len;
   size_t offset = 0, path_size;
-  pino_t dir_ino, root_ino;
+  ino_t dir_ino, root_ino;
   struct puffs_node *pn;
 
-  grant                = (cp_grant_id_t) fs_m_in.REQ_GRANT;
-  path_size    = (size_t) fs_m_in.REQ_PATH_SIZE;       /* Size of the buffer */
-  len          = (int) fs_m_in.REQ_PATH_LEN;   /* including terminating nul */
-  dir_ino      = (pino_t) fs_m_in.REQ_DIR_INO;
-  root_ino     = (pino_t) fs_m_in.REQ_ROOT_INO;
-  flags                = (int) fs_m_in.REQ_FLAGS;
+  grant                = fs_m_in.m_vfs_fs_lookup.grant_path;
+  path_size    = fs_m_in.m_vfs_fs_lookup.path_size;    /* Size of the buffer */
+  len          = fs_m_in.m_vfs_fs_lookup.path_len;     /* including terminating nul */
+  dir_ino      = fs_m_in.m_vfs_fs_lookup.dir_ino;
+  root_ino     = fs_m_in.m_vfs_fs_lookup.root_ino;
+  flags                = fs_m_in.m_vfs_fs_lookup.flags;
 
   /* Check length. */
   if (len > sizeof(user_path)) return(E2BIG);  /* too big for buffer */
@@ -65,13 +65,13 @@ int fs_lookup(void)
 
   memset(&credentials, 0, sizeof(credentials));
   if(!(flags & PATH_GET_UCRED)) { /* Do we have to copy uid/gid credentials? */
-        caller_uid      = (uid_t) fs_m_in.REQ_UID;
-        caller_gid      = (gid_t) fs_m_in.REQ_GID;
+        caller_uid      = fs_m_in.m_vfs_fs_lookup.uid;
+        caller_gid      = fs_m_in.m_vfs_fs_lookup.gid;
   } else {
        if((r=fs_lookup_credentials(&credentials,
                &caller_uid, &caller_gid,
-               (cp_grant_id_t) fs_m_in.REQ_GRANT2,
-               (size_t) fs_m_in.REQ_UCRED_SIZE)) != OK)
+               fs_m_in.m_vfs_fs_lookup.grant_ucred,
+               fs_m_in.m_vfs_fs_lookup.ucred_size)) != OK)
                return r;
   }
 
@@ -91,8 +91,8 @@ int fs_lookup(void)
 
   if (r == ELEAVEMOUNT || r == ESYMLINK) {
        /* Report offset and the error */
-       fs_m_out.RES_OFFSET = offset;
-       fs_m_out.RES_SYMLOOP = symlinks;
+       fs_m_out.m_fs_vfs_lookup.offset = offset;
+       fs_m_out.m_fs_vfs_lookup.symloop = symlinks;
        
        return(r);
   }
@@ -106,19 +106,19 @@ int fs_lookup(void)
        pn->pn_count++;
   }
 
-  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_FILE_SIZE       = pn->pn_va.va_size;
-  fs_m_out.RES_SYMLOOP         = symlinks;
-  fs_m_out.RES_UID             = pn->pn_va.va_uid;
-  fs_m_out.RES_GID             = pn->pn_va.va_gid;
+  fs_m_out.m_fs_vfs_lookup.inode       = pn->pn_va.va_fileid;
+  fs_m_out.m_fs_vfs_lookup.mode                = pn->pn_va.va_mode;
+  fs_m_out.m_fs_vfs_lookup.file_size   = pn->pn_va.va_size;
+  fs_m_out.m_fs_vfs_lookup.symloop     = symlinks;
+  fs_m_out.m_fs_vfs_lookup.uid         = pn->pn_va.va_uid;
+  fs_m_out.m_fs_vfs_lookup.gid         = pn->pn_va.va_gid;
 
   /* This is only valid for block and character specials. But it doesn't
-   * cause any harm to set RES_DEV always. */
-  fs_m_out.RES_DEV             = pn->pn_va.va_rdev;
+   * cause any harm to always set the device field. */
+  fs_m_out.m_fs_vfs_lookup.device      = pn->pn_va.va_rdev;
 
   if (r == EENTERMOUNT) {
-       fs_m_out.RES_OFFSET     = offset;
+       fs_m_out.m_fs_vfs_lookup.offset = offset;
   }
   
   return(r);
index 9c27436dbe467b687e500ac9b9bc6c9adab4e148..ca484649b390493f30d9e4e5ec71ef015dc02ff6 100644 (file)
@@ -203,7 +203,7 @@ int do_lookup(void)
 {
 /* Resolve a path string to an inode.
  */
-  pino_t dir_ino_nr, root_ino_nr;
+  ino_t dir_ino_nr, root_ino_nr;
   struct inode *cur_ino, *root_ino;
   struct inode *next_ino = NULL;
   struct sffs_attr attr;
@@ -211,19 +211,19 @@ int do_lookup(void)
   char name[NAME_MAX+1];
   char *ptr, *last;
   vfs_ucred_t ucred;
-  pmode_t mask;
+  mode_t mask;
   size_t len;
   int r;
 
-  dir_ino_nr = m_in.REQ_DIR_INO;
-  root_ino_nr = m_in.REQ_ROOT_INO;
-  len = m_in.REQ_PATH_LEN;
+  dir_ino_nr = m_in.m_vfs_fs_lookup.dir_ino;
+  root_ino_nr = m_in.m_vfs_fs_lookup.root_ino;
+  len = m_in.m_vfs_fs_lookup.path_len;
 
   /* Fetch the path name. */
   if (len < 1 || len > PATH_MAX)
        return EINVAL;
 
-  r = sys_safecopyfrom(m_in.m_source, m_in.REQ_GRANT, 0,
+  r = sys_safecopyfrom(m_in.m_source, m_in.m_vfs_fs_lookup.grant_path, 0,
        (vir_bytes) buf, len);
 
   if (r != OK)
@@ -238,22 +238,22 @@ int do_lookup(void)
   /* Fetch the credentials, and generate a search access mask to test against
    * directory modes.
    */
-  if (m_in.REQ_FLAGS & PATH_GET_UCRED) {
-       if (m_in.REQ_UCRED_SIZE != sizeof(ucred)) {
+  if (m_in.m_vfs_fs_lookup.flags & PATH_GET_UCRED) {
+       if (m_in.m_vfs_fs_lookup.ucred_size != sizeof(ucred)) {
                printf("%s: bad credential structure size\n", sffs_name);
 
                return EINVAL;
        }
 
-       r = sys_safecopyfrom(m_in.m_source, m_in.REQ_GRANT2, 0,
-               (vir_bytes) &ucred, m_in.REQ_UCRED_SIZE);
+       r = sys_safecopyfrom(m_in.m_source, m_in.m_vfs_fs_lookup.grant_ucred, 0,
+               (vir_bytes) &ucred, m_in.m_vfs_fs_lookup.ucred_size);
 
        if (r != OK)
                return r;
   }
   else {
-       ucred.vu_uid = m_in.REQ_UID;
-       ucred.vu_gid = m_in.REQ_GID;
+       ucred.vu_uid = m_in.m_vfs_fs_lookup.uid;
+       ucred.vu_gid = m_in.m_vfs_fs_lookup.gid;
        ucred.vu_ngroups = 0;
   }
 
@@ -322,19 +322,19 @@ int do_lookup(void)
        assert(r != EENTERMOUNT && r != ESYMLINK);
 
        if (r == ELEAVEMOUNT) {
-               m_out.RES_OFFSET = (int) (last - buf);
-               m_out.RES_SYMLOOP = 0;
+               m_out.m_fs_vfs_lookup.offset = (last - buf);
+               m_out.m_fs_vfs_lookup.symloop = 0;
        }
 
        return r;
   }
 
-  m_out.RES_INODE_NR = INODE_NR(cur_ino);
-  m_out.RES_MODE = get_mode(cur_ino, attr.a_mode);
-  m_out.RES_FILE_SIZE = attr.a_size;
-  m_out.RES_UID = sffs_params->p_uid;
-  m_out.RES_GID = sffs_params->p_gid;
-  m_out.RES_DEV = NO_DEV;
+  m_out.m_fs_vfs_lookup.inode = INODE_NR(cur_ino);
+  m_out.m_fs_vfs_lookup.mode = get_mode(cur_ino, attr.a_mode);
+  m_out.m_fs_vfs_lookup.file_size = attr.a_size;
+  m_out.m_fs_vfs_lookup.uid = sffs_params->p_uid;
+  m_out.m_fs_vfs_lookup.gid = sffs_params->p_gid;
+  m_out.m_fs_vfs_lookup.device = NO_DEV;
 
   return OK;
 }
index 9360ed78d28794f6ed97158beb1ec04397935b03..18bf37260055132a0e95f33f0b291cd2f68e9400 100644 (file)
@@ -149,7 +149,7 @@ int fs_lookup(void)
 {
        /* Resolve a path string to an inode.
         */
-       pino_t dir_ino_nr, root_ino_nr;
+       ino_t dir_ino_nr, root_ino_nr;
        struct inode *cur_ino, *next_ino, *root_ino;
        char path[PATH_MAX], name[PNAME_MAX+1];
        char *ptr, *last;
@@ -157,33 +157,35 @@ int fs_lookup(void)
        size_t len;
        int r, r2, symloop;
 
-       dir_ino_nr = fs_m_in.REQ_DIR_INO;
-       root_ino_nr = fs_m_in.REQ_ROOT_INO;
-       len = fs_m_in.REQ_PATH_LEN;
+       dir_ino_nr = fs_m_in.m_vfs_fs_lookup.dir_ino;
+       root_ino_nr = fs_m_in.m_vfs_fs_lookup.root_ino;
+       len = fs_m_in.m_vfs_fs_lookup.path_len;
 
        /* Fetch the path name. */
        if (len < 1 || len > PATH_MAX)
                return EINVAL;
 
-       r = sys_safecopyfrom(fs_m_in.m_source, fs_m_in.REQ_GRANT, 0,
-               (vir_bytes) path, (phys_bytes) len);
+       r = sys_safecopyfrom(fs_m_in.m_source,
+               fs_m_in.m_vfs_fs_lookup.grant_path, 0, (vir_bytes) path,
+               (phys_bytes) len);
        if (r != OK) return r;
 
        if (path[len-1] != 0) return EINVAL;
 
        /* Fetch the caller's credentials. */
-       if (fs_m_in.REQ_FLAGS & PATH_GET_UCRED) {
-               assert(fs_m_in.REQ_UCRED_SIZE == sizeof(ucred));
+       if (fs_m_in.m_vfs_fs_lookup.flags & PATH_GET_UCRED) {
+               assert(fs_m_in.m_vfs_fs_lookup.ucred_size == sizeof(ucred));
 
-               r = sys_safecopyfrom(fs_m_in.m_source, fs_m_in.REQ_GRANT2, 0,
-                       (vir_bytes) &ucred, fs_m_in.REQ_UCRED_SIZE);
+               r = sys_safecopyfrom(fs_m_in.m_source,
+                       fs_m_in.m_vfs_fs_lookup.grant_ucred, 0,
+                       (vir_bytes) &ucred, fs_m_in.m_vfs_fs_lookup.ucred_size);
 
                if (r != OK)
                        return r;
        }
        else {
-               ucred.vu_uid = fs_m_in.REQ_UID;
-               ucred.vu_gid = fs_m_in.REQ_GID;
+               ucred.vu_uid = fs_m_in.m_vfs_fs_lookup.uid;
+               ucred.vu_gid = fs_m_in.m_vfs_fs_lookup.gid;
                ucred.vu_ngroups = 0;
        }
 
@@ -228,7 +230,7 @@ int fs_lookup(void)
                        /* Perform symlink resolution if we have to. */
                        if (r == OK && S_ISLNK(next_ino->i_stat.mode) &&
                                (ptr[0] != '\0' ||
-                               !(fs_m_in.REQ_FLAGS & PATH_RET_SYMLINK))) {
+                               !(fs_m_in.m_vfs_fs_lookup.flags & PATH_RET_SYMLINK))) {
 
                                if (++symloop == _POSIX_SYMLOOP_MAX) {
                                        put_inode(next_ino);
@@ -285,28 +287,28 @@ int fs_lookup(void)
                /* Copy back the path if we resolved at least one symlink. */
                if (symloop > 0 && (r == ELEAVEMOUNT || r == ESYMLINK)) {
                        r2 = sys_safecopyto(fs_m_in.m_source,
-                               fs_m_in.REQ_GRANT, 0, (vir_bytes) path,
-                               strlen(path) + 1);
+                               fs_m_in.m_vfs_fs_lookup.grant_path, 0,
+                               (vir_bytes) path, strlen(path) + 1);
 
                        if (r2 != OK)
                                r = r2;
                }
 
                if (r == ELEAVEMOUNT || r == ESYMLINK) {
-                       fs_m_out.RES_OFFSET = (int) (last - path);
-                       fs_m_out.RES_SYMLOOP = symloop;
+                       fs_m_out.m_fs_vfs_lookup.offset = (int) (last - path);
+                       fs_m_out.m_fs_vfs_lookup.symloop = symloop;
                }
 
                return r;
        }
 
        /* 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_MODE = cur_ino->i_stat.mode;
-       fs_m_out.RES_FILE_SIZE = cur_ino->i_stat.size;
-       fs_m_out.RES_UID = cur_ino->i_stat.uid;
-       fs_m_out.RES_GID = cur_ino->i_stat.gid;
-       fs_m_out.RES_DEV = cur_ino->i_stat.dev;
+       fs_m_out.m_fs_vfs_lookup.inode = get_inode_number(cur_ino);
+       fs_m_out.m_fs_vfs_lookup.mode = cur_ino->i_stat.mode;
+       fs_m_out.m_fs_vfs_lookup.file_size = cur_ino->i_stat.size;
+       fs_m_out.m_fs_vfs_lookup.uid = cur_ino->i_stat.uid;
+       fs_m_out.m_fs_vfs_lookup.gid = cur_ino->i_stat.gid;
+       fs_m_out.m_fs_vfs_lookup.device = cur_ino->i_stat.dev;
 
        return OK;
 }
index 82c467e79108572cf733218915af8984594d0b0b..444094f5f7f78fa7c9bd67139bee533d23c39094 100644 (file)
@@ -44,12 +44,12 @@ int fs_lookup()
   pino_t dir_ino, root_ino;
   struct inode *rip;
 
-  grant                = (cp_grant_id_t) fs_m_in.REQ_GRANT;
-  path_size    = (size_t) fs_m_in.REQ_PATH_SIZE;       /* Size of the buffer */
-  len          = (int) fs_m_in.REQ_PATH_LEN;   /* including terminating nul */
-  dir_ino      = (pino_t) fs_m_in.REQ_DIR_INO;
-  root_ino     = (pino_t) fs_m_in.REQ_ROOT_INO;
-  flags                = (int) fs_m_in.REQ_FLAGS;
+  grant                = fs_m_in.m_vfs_fs_lookup.grant_path;
+  path_size    = fs_m_in.m_vfs_fs_lookup.path_size;    /* Size of the buffer */
+  len          = fs_m_in.m_vfs_fs_lookup.path_len;     /* including terminating nul */
+  dir_ino      = fs_m_in.m_vfs_fs_lookup.dir_ino;
+  root_ino     = fs_m_in.m_vfs_fs_lookup.root_ino;
+  flags                = fs_m_in.m_vfs_fs_lookup.flags;
 
   /* Check length. */
   if(len > sizeof(user_path)) return(E2BIG);   /* too big for buffer */
@@ -65,13 +65,12 @@ int fs_lookup()
 
   memset(&credentials, 0, sizeof(credentials));
   if(!(flags & PATH_GET_UCRED)) { /* Do we have to copy uid/gid credentials? */
-        caller_uid      = (uid_t) fs_m_in.REQ_UID;
-        caller_gid      = (gid_t) fs_m_in.REQ_GID;
+        caller_uid      = fs_m_in.m_vfs_fs_lookup.uid;
+        caller_gid      = fs_m_in.m_vfs_fs_lookup.gid;
    } else {
          if((r=fs_lookup_credentials(&credentials,
-               &caller_uid, &caller_gid,
-               (cp_grant_id_t) fs_m_in.REQ_GRANT2,
-               (size_t) fs_m_in.REQ_UCRED_SIZE)) != OK)
+               &caller_uid, &caller_gid, fs_m_in.m_vfs_fs_lookup.grant_ucred,
+               fs_m_in.m_vfs_fs_lookup.ucred_size)) != OK)
                return r;
   }
 
@@ -90,27 +89,27 @@ int fs_lookup()
 
   if(r == ELEAVEMOUNT || r == ESYMLINK) {
          /* Report offset and the error */
-         fs_m_out.RES_OFFSET = offset;
-         fs_m_out.RES_SYMLOOP = symlinks;
+         fs_m_out.m_fs_vfs_lookup.offset = offset;
+         fs_m_out.m_fs_vfs_lookup.symloop = symlinks;
 
          return(r);
   }
 
   if (r != OK && r != EENTERMOUNT) return(r);
 
-  fs_m_out.RES_INODE_NR                = rip->i_num;
-  fs_m_out.RES_MODE            = rip->i_mode;
-  fs_m_out.RES_FILE_SIZE       = rip->i_size;
-  fs_m_out.RES_SYMLOOP         = symlinks;
-  fs_m_out.RES_UID             = rip->i_uid;
-  fs_m_out.RES_GID             = rip->i_gid;
+  fs_m_out.m_fs_vfs_lookup.inode               = rip->i_num;
+  fs_m_out.m_fs_vfs_lookup.mode                        = rip->i_mode;
+  fs_m_out.m_fs_vfs_lookup.file_size           = rip->i_size;
+  fs_m_out.m_fs_vfs_lookup.symloop             = symlinks;
+  fs_m_out.m_fs_vfs_lookup.uid                 = rip->i_uid;
+  fs_m_out.m_fs_vfs_lookup.gid                 = rip->i_gid;
 
   /* This is only valid for block and character specials. But it doesn't
-   * cause any harm to set RES_DEV always. */
-  fs_m_out.RES_DEV             = (dev_t) rip->i_block[0];
+   * cause any harm to always set the device field. */
+  fs_m_out.m_fs_vfs_lookup.device              = (dev_t) rip->i_block[0];
 
   if(r == EENTERMOUNT) {
-         fs_m_out.RES_OFFSET   = offset;
+         fs_m_out.m_fs_vfs_lookup.offset       = offset;
          put_inode(rip); /* Only return a reference to the final object */
   }
 
index 8ccc78c72d7bede5ccd8129de13d40dc3bde2e6e..fd7a5daf5e461ebab99fa54158e751d180f2d8b0 100644 (file)
@@ -17,16 +17,16 @@ int fs_lookup() {
   cp_grant_id_t grant;
   int r, len, flags;
   size_t offset;
-  pino_t dir_ino, root_ino;
+  ino_t dir_ino, root_ino;
   struct dir_record *dir;
 
-  grant                = fs_m_in.REQ_GRANT;
-  len          = fs_m_in.REQ_PATH_LEN; /* including terminating nul */
-  dir_ino      = (pino_t) fs_m_in.REQ_DIR_INO;
-  root_ino     = (pino_t) fs_m_in.REQ_ROOT_INO;
-  flags                = fs_m_in.REQ_FLAGS;
-  caller_uid   = (uid_t) fs_m_in.REQ_UID;
-  caller_gid   = (gid_t) fs_m_in.REQ_GID;
+  grant                = fs_m_in.m_vfs_fs_lookup.grant_path;
+  len          = fs_m_in.m_vfs_fs_lookup.path_len;     /* including terminating nul */
+  dir_ino      = fs_m_in.m_vfs_fs_lookup.dir_ino;
+  root_ino     = fs_m_in.m_vfs_fs_lookup.root_ino;
+  flags                = fs_m_in.m_vfs_fs_lookup.flags;
+  caller_uid   = fs_m_in.m_vfs_fs_lookup.uid;
+  caller_gid   = fs_m_in.m_vfs_fs_lookup.gid;
 
   /* Check length. */
   if(len > sizeof(user_path)) return(E2BIG);   /* too big for buffer */
@@ -51,23 +51,22 @@ int fs_lookup() {
 
   if (r == ELEAVEMOUNT) {
        /* Report offset and the error */
-       fs_m_out.RES_OFFSET = offset;
-       fs_m_out.RES_SYMLOOP = 0;
+       fs_m_out.m_fs_vfs_lookup.offset = offset;
+       fs_m_out.m_fs_vfs_lookup.symloop = 0;
        return(r);
   }
 
   if (r != OK && r != EENTERMOUNT) return(r);
 
-  fs_m_out.RES_INODE_NR     = ID_DIR_RECORD(dir);
-  fs_m_out.RES_MODE         = dir->d_mode;
-  fs_m_out.RES_FILE_SIZE    = dir->d_file_size; 
-  fs_m_out.RES_SYMLOOP      = 0;
-  fs_m_out.RES_UID          = SYS_UID;         /* root */
-  fs_m_out.RES_GID          = SYS_GID;         /* operator */
-
+  fs_m_out.m_fs_vfs_lookup.inode       = ID_DIR_RECORD(dir);
+  fs_m_out.m_fs_vfs_lookup.mode                = dir->d_mode;
+  fs_m_out.m_fs_vfs_lookup.file_size   = dir->d_file_size;
+  fs_m_out.m_fs_vfs_lookup.symloop     = 0;
+  fs_m_out.m_fs_vfs_lookup.uid         = SYS_UID;      /* root */
+  fs_m_out.m_fs_vfs_lookup.gid         = SYS_GID;      /* operator */
 
   if (r == EENTERMOUNT) { 
-       fs_m_out.RES_OFFSET = offset;
+       fs_m_out.m_fs_vfs_lookup.offset = offset;
        release_dir_record(dir);
   }
 
index 7c69f2a2683c0e1452a04ef4ac86446def0213a1..33e687d29dcd565cd94181a5ecf83bf8e7b3a619 100644 (file)
@@ -40,15 +40,15 @@ int fs_lookup()
   int r, r1, flags, symlinks;
   unsigned int len;
   size_t offset = 0, path_size;
-  pino_t dir_ino, root_ino;
+  ino_t dir_ino, root_ino;
   struct inode *rip;
 
-  grant                = (cp_grant_id_t) fs_m_in.REQ_GRANT;
-  path_size    = (size_t) fs_m_in.REQ_PATH_SIZE; /* Size of the buffer */
-  len          = (int) fs_m_in.REQ_PATH_LEN; /* including terminating nul */
-  dir_ino      = (pino_t) fs_m_in.REQ_DIR_INO;
-  root_ino     = (pino_t) fs_m_in.REQ_ROOT_INO;
-  flags                = (int) fs_m_in.REQ_FLAGS;
+  grant                = fs_m_in.m_vfs_fs_lookup.grant_path;
+  path_size    = fs_m_in.m_vfs_fs_lookup.path_size; /* Size of the buffer */
+  len          = fs_m_in.m_vfs_fs_lookup.path_len; /* including terminating nul */
+  dir_ino      = fs_m_in.m_vfs_fs_lookup.dir_ino;
+  root_ino     = fs_m_in.m_vfs_fs_lookup.root_ino;
+  flags                = fs_m_in.m_vfs_fs_lookup.flags;
 
   /* Check length. */
   if(len > sizeof(user_path)) return(E2BIG);   /* too big for buffer */
@@ -64,13 +64,13 @@ int fs_lookup()
 
   memset(&credentials, 0, sizeof(credentials));
   if(!(flags & PATH_GET_UCRED)) { /* Do we have to copy uid/gid credentials? */
-        caller_uid      = (uid_t) fs_m_in.REQ_UID;
-        caller_gid      = (gid_t) fs_m_in.REQ_GID;
+        caller_uid     = fs_m_in.m_vfs_fs_lookup.uid;
+        caller_gid     = fs_m_in.m_vfs_fs_lookup.gid;
   } else {
          if((r=fs_lookup_credentials(&credentials,
                &caller_uid, &caller_gid,
-               (cp_grant_id_t) fs_m_in.REQ_GRANT2,
-               (size_t) fs_m_in.REQ_UCRED_SIZE)) != OK)
+               fs_m_in.m_vfs_fs_lookup.grant_ucred,
+               fs_m_in.m_vfs_fs_lookup.ucred_size)) != OK)
                return r;
   }
 
@@ -89,27 +89,27 @@ int fs_lookup()
 
   if(r == ELEAVEMOUNT || r == ESYMLINK) {
          /* Report offset and the error */
-         fs_m_out.RES_OFFSET = offset;
-         fs_m_out.RES_SYMLOOP = symlinks;
+         fs_m_out.m_fs_vfs_lookup.offset = offset;
+         fs_m_out.m_fs_vfs_lookup.symloop = symlinks;
 
          return(r);
   }
 
   if (r != OK && r != EENTERMOUNT) return(r);
 
-  fs_m_out.RES_INODE_NR        = rip->i_num;
-  fs_m_out.RES_MODE            = rip->i_mode;
-  fs_m_out.RES_FILE_SIZE       = rip->i_size;
-  fs_m_out.RES_SYMLOOP         = symlinks;
-  fs_m_out.RES_UID             = rip->i_uid;
-  fs_m_out.RES_GID             = rip->i_gid;
+  fs_m_out.m_fs_vfs_lookup.inode               = rip->i_num;
+  fs_m_out.m_fs_vfs_lookup.mode                        = rip->i_mode;
+  fs_m_out.m_fs_vfs_lookup.file_size           = rip->i_size;
+  fs_m_out.m_fs_vfs_lookup.symloop             = symlinks;
+  fs_m_out.m_fs_vfs_lookup.uid                 = rip->i_uid;
+  fs_m_out.m_fs_vfs_lookup.gid                 = rip->i_gid;
   
   /* This is only valid for block and character specials. But it doesn't
-   * cause any harm to set RES_DEV always. */
-  fs_m_out.RES_DEV             = (dev_t) rip->i_zone[0];
+   * cause any harm to always set the device field. */
+  fs_m_out.m_fs_vfs_lookup.device              = (dev_t) rip->i_zone[0];
 
   if(r == EENTERMOUNT) {
-         fs_m_out.RES_OFFSET   = offset;
+         fs_m_out.m_fs_vfs_lookup.offset       = offset;
          put_inode(rip); /* Only return a reference to the final object */
   }
 
index a94f304c634170734df27153c2a8132f4cf2ca16..6cd1d714c406d08bb79e10ff3e1a0eaacec2a84a 100644 (file)
@@ -445,12 +445,12 @@ int req_lookup(
   flags = resolve->l_flags;
   len = strlen(resolve->l_path) + 1;
 
-  m.m_type             = REQ_LOOKUP;
-  m.REQ_GRANT          = grant_id;
-  m.REQ_PATH_LEN       = len;
-  m.REQ_PATH_SIZE      = PATH_MAX + 1;
-  m.REQ_DIR_INO        = (pino_t) dir_ino;
-  m.REQ_ROOT_INO       = (pino_t) root_ino;
+  m.m_type                     = REQ_LOOKUP;
+  m.m_vfs_fs_lookup.grant_path = grant_id;
+  m.m_vfs_fs_lookup.path_len   = len;
+  m.m_vfs_fs_lookup.path_size  = PATH_MAX + 1;
+  m.m_vfs_fs_lookup.dir_ino    = dir_ino;
+  m.m_vfs_fs_lookup.root_ino   = root_ino;
 
   if(rfp->fp_ngroups > 0) { /* Is the process member of multiple groups? */
        /* In that case the FS has to copy the uid/gid credentials */
@@ -468,17 +468,17 @@ int req_lookup(
        if(grant_id2 == -1)
                panic("req_lookup: cpf_grant_direct failed");
 
-       m.REQ_GRANT2    = grant_id2;
-       m.REQ_UCRED_SIZE= sizeof(credentials);
+       m.m_vfs_fs_lookup.grant_ucred   = grant_id2;
+       m.m_vfs_fs_lookup.ucred_size    = sizeof(credentials);
        flags           |= PATH_GET_UCRED;
   } else {
        /* When there's only one gid, we can send it directly */
-       m.REQ_UID       = (pgid_t) uid;
-       m.REQ_GID       = (pgid_t) gid;
+       m.m_vfs_fs_lookup.uid = uid;
+       m.m_vfs_fs_lookup.gid = gid;
        flags           &= ~PATH_GET_UCRED;
   }
 
-  m.REQ_FLAGS          = flags;
+  m.m_vfs_fs_lookup.flags = flags;
 
   /* Send/rec request */
   r = fs_sendrec(fs_e, &m);
@@ -490,25 +490,25 @@ int req_lookup(
 
   switch (r) {
   case OK:
-       res->inode_nr = (ino_t) m.RES_INODE_NR;
-       res->fmode = (mode_t) m.RES_MODE;
-       res->fsize = m.RES_FILE_SIZE;
-       res->dev = m.RES_DEV;
-       res->uid = (uid_t) m.RES_UID;
-       res->gid = (gid_t) m.RES_GID;
+       res->inode_nr = m.m_fs_vfs_lookup.inode;
+       res->fmode = m.m_fs_vfs_lookup.mode;
+       res->fsize = m.m_fs_vfs_lookup.file_size;
+       res->dev = m.m_fs_vfs_lookup.device;
+       res->uid = m.m_fs_vfs_lookup.uid;
+       res->gid = m.m_fs_vfs_lookup.gid;
        break;
   case EENTERMOUNT:
-       res->inode_nr = (ino_t) m.RES_INODE_NR;
-       res->char_processed = m.RES_OFFSET;
-       res->symloop = m.RES_SYMLOOP;
+       res->inode_nr = m.m_fs_vfs_lookup.inode;
+       res->char_processed = m.m_fs_vfs_lookup.offset;
+       res->symloop = m.m_fs_vfs_lookup.symloop;
        break;
   case ELEAVEMOUNT:
-       res->char_processed = m.RES_OFFSET;
-       res->symloop = m.RES_SYMLOOP;
+       res->char_processed = m.m_fs_vfs_lookup.offset;
+       res->symloop = m.m_fs_vfs_lookup.symloop;
        break;
   case ESYMLINK:
-       res->char_processed = m.RES_OFFSET;
-       res->symloop = m.RES_SYMLOOP;
+       res->char_processed = m.m_fs_vfs_lookup.offset;
+       res->symloop = m.m_fs_vfs_lookup.symloop;
        break;
   default:
        break;