msdosfs: use same max filesize #define as NetBSD and move to header
For use by makefs msdosfs support. Obtained from: NetBSD denode.h 1.6 Sponsored by: The FreeBSD Foundation
This commit is contained in:
parent
8db239dc6b
commit
22e56aea3f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=336935
@ -174,6 +174,8 @@ struct denode {
|
|||||||
#define DE_MODIFIED 0x0020 /* Denode has been modified */
|
#define DE_MODIFIED 0x0020 /* Denode has been modified */
|
||||||
#define DE_RENAME 0x0040 /* Denode is in the process of being renamed */
|
#define DE_RENAME 0x0040 /* Denode is in the process of being renamed */
|
||||||
|
|
||||||
|
/* Maximum size of a file on a FAT filesystem */
|
||||||
|
#define MSDOSFS_FILESIZE_MAX 0xFFFFFFFFLL
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Transfer directory entries between internal and external form.
|
* Transfer directory entries between internal and external form.
|
||||||
|
@ -79,8 +79,6 @@
|
|||||||
#include <fs/msdosfs/fat.h>
|
#include <fs/msdosfs/fat.h>
|
||||||
#include <fs/msdosfs/msdosfsmount.h>
|
#include <fs/msdosfs/msdosfsmount.h>
|
||||||
|
|
||||||
#define DOS_FILESIZE_MAX 0xffffffff
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Prototypes for MSDOSFS vnode operations
|
* Prototypes for MSDOSFS vnode operations
|
||||||
*/
|
*/
|
||||||
@ -548,7 +546,7 @@ msdosfs_read(struct vop_read_args *ap)
|
|||||||
* The caller is supposed to ensure that
|
* The caller is supposed to ensure that
|
||||||
* uio->uio_offset >= 0 and uio->uio_resid >= 0.
|
* uio->uio_offset >= 0 and uio->uio_resid >= 0.
|
||||||
* We don't need to check for large offsets as in ffs because
|
* We don't need to check for large offsets as in ffs because
|
||||||
* dep->de_FileSize <= DOS_FILESIZE_MAX < OFF_MAX, so large
|
* dep->de_FileSize <= MSDOSFS_FILESIZE_MAX < OFF_MAX, so large
|
||||||
* offsets cannot cause overflow even in theory.
|
* offsets cannot cause overflow even in theory.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -663,7 +661,7 @@ msdosfs_write(struct vop_write_args *ap)
|
|||||||
* The caller is supposed to ensure that
|
* The caller is supposed to ensure that
|
||||||
* uio->uio_offset >= 0 and uio->uio_resid >= 0.
|
* uio->uio_offset >= 0 and uio->uio_resid >= 0.
|
||||||
*/
|
*/
|
||||||
if ((uoff_t)uio->uio_offset + uio->uio_resid > DOS_FILESIZE_MAX)
|
if ((uoff_t)uio->uio_offset + uio->uio_resid > MSDOSFS_FILESIZE_MAX)
|
||||||
return (EFBIG);
|
return (EFBIG);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user