superblock: get the kernel inoptr out of the superblock
authorAlan Cox <alan@linux.intel.com>
Tue, 10 Apr 2018 22:16:42 +0000 (23:16 +0100)
committerAlan Cox <alan@linux.intel.com>
Tue, 10 Apr 2018 22:16:42 +0000 (23:16 +0100)
Put it in the memory only area where it belongs

Kernel/filesys.c
Kernel/include/kernel.h
Kernel/syscall_other.c

index 675995d..247f614 100644 (file)
@@ -112,7 +112,7 @@ inoptr n_open(char *namep, inoptr *parent)
                 name += 2;
                 continue;
             }
-            temp = fs_tab[wd->c_super].m_fs.s_mntpt;
+            temp = fs_tab[wd->c_super].m_mntpt;
             ++temp->c_refs;
             i_deref(wd);
             wd = temp;
@@ -193,7 +193,7 @@ inoptr srch_mt(inoptr ino)
     struct mount *m = &fs_tab[0];
 
     for(j=0; j < NMOUNTS; ++j){
-        if(m->m_dev != NO_DEVICE &&  m->m_fs.s_mntpt == ino) {
+        if(m->m_dev != NO_DEVICE &&  m->m_mntpt == ino) {
             i_deref(ino);
             return i_open(m->m_dev, ROOTINODE);
         }
@@ -1282,7 +1282,7 @@ bool fmount(uint16_t dev, inoptr ino, uint16_t flags)
         fp->s_fmod = FMOD_DIRTY;
     else       /* Clean in memory, don't write it back to media */
         fp->s_fmod = FMOD_CLEAN;
-    fp->s_mntpt = ino;
+    m->m_mntpt = ino;
     if(ino)
         ++ino->c_refs;
     m->m_flags = flags;
index a736262..9fa75e8 100644 (file)
@@ -338,7 +338,6 @@ typedef struct filesys { // note: exists in mem and on disk
     uint8_t      s_shift;      /* Extent size */
     uint8_t      s_reserved;
     /* Below this is only used in memory so alignments don't matter */
-    inoptr        s_mntpt;     /* Mount point */
     /* TODO: Add geometry hints and support > 512 byte blocks */
 } filesys, *fsptr;
 
@@ -353,6 +352,7 @@ typedef struct oft {
 struct mount {
     uint16_t m_dev;
     uint16_t m_flags;
+    inoptr   m_mntpt;     /* Mount point */
     struct filesys m_fs;
 };
 #define MS_RDONLY      1
index 3e9efbc..69fab02 100644 (file)
@@ -435,7 +435,7 @@ static int do_umount(uint16_t dev)
                return 0;
        }
 
-       i_deref(mnt->m_fs.s_mntpt);
+       i_deref(mnt->m_mntpt);
        /* Vanish the entry */
        mnt->m_dev = NO_DEVICE;
        return 0;