Author: kevans
Date: Fri Jul 17 14:17:13 2020
New Revision: 363271
URL: https://svnweb.freebsd.org/changeset/base/363271

Log:
  MFC r363062: shmfd: make shm_size a vm_ooffset_t
  
  On 32-bit platforms, this expands the shm_size to a 64-bit quantity and
  resolves a mismatch between the shmfd size and underlying vm_object size.
  The implementation did not account for this kind of mismatch.
  
  For compatibility's sake, the old shm_size has been replaced with
  shm_oldsize (still popualted) and the new member appended to the end.

Modified:
  stable/12/sys/kern/uipc_shm.c
  stable/12/sys/sys/mman.h
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sys/kern/uipc_shm.c
==============================================================================
--- stable/12/sys/kern/uipc_shm.c       Fri Jul 17 06:53:03 2020        
(r363270)
+++ stable/12/sys/kern/uipc_shm.c       Fri Jul 17 14:17:13 2020        
(r363271)
@@ -531,6 +531,7 @@ retry:
                object->charge += delta;
        }
        shmfd->shm_size = length;
+       shmfd->shm_oldsize = (size_t)length;
        mtx_lock(&shm_timestamp_lock);
        vfs_timestamp(&shmfd->shm_ctime);
        shmfd->shm_mtime = shmfd->shm_ctime;

Modified: stable/12/sys/sys/mman.h
==============================================================================
--- stable/12/sys/sys/mman.h    Fri Jul 17 06:53:03 2020        (r363270)
+++ stable/12/sys/sys/mman.h    Fri Jul 17 14:17:13 2020        (r363271)
@@ -207,7 +207,7 @@ typedef     __size_t        size_t;
 struct file;
 
 struct shmfd {
-       size_t          shm_size;
+       size_t          shm_oldsize;
        vm_object_t     shm_object;
        int             shm_refs;
        uid_t           shm_uid;
@@ -230,6 +230,7 @@ struct shmfd {
 
        struct rangelock shm_rl;
        struct mtx      shm_mtx;
+       vm_ooffset_t    shm_size;
 };
 #endif
 
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to