Selaa lähdekoodia

Kernel+LibC: Pack SC_mount_params struct tighter

Flagged by pvs-studio, ordering the members from largest to smallest
allows us to save a few bytes in the size of the struct.
Brian Gianforcaro 3 vuotta sitten
vanhempi
commit
be15bd3c86
2 muutettua tiedostoa jossa 2 lisäystä ja 2 poistoa
  1. 1 1
      Kernel/API/Syscall.h
  2. 1 1
      Userland/Libraries/LibC/unistd.cpp

+ 1 - 1
Kernel/API/Syscall.h

@@ -426,9 +426,9 @@ struct SC_rename_params {
 };
 };
 
 
 struct SC_mount_params {
 struct SC_mount_params {
-    int source_fd;
     StringArgument target;
     StringArgument target;
     StringArgument fs_type;
     StringArgument fs_type;
+    int source_fd;
     int flags;
     int flags;
 };
 };
 
 

+ 1 - 1
Userland/Libraries/LibC/unistd.cpp

@@ -723,9 +723,9 @@ int mount(int source_fd, const char* target, const char* fs_type, int flags)
     }
     }
 
 
     Syscall::SC_mount_params params {
     Syscall::SC_mount_params params {
-        source_fd,
         { target, strlen(target) },
         { target, strlen(target) },
         { fs_type, strlen(fs_type) },
         { fs_type, strlen(fs_type) },
+        source_fd,
         flags
         flags
     };
     };
     int rc = syscall(SC_mount, &params);
     int rc = syscall(SC_mount, &params);