tmpfs maximum file size limit

Jaakko Heinonen jh at FreeBSD.org
Fri Jan 22 07:20:42 UTC 2010


Unless I am missing something tmpfs maximum file size limit useless
because it is set to the total amount of memory in the system including
swap ((cnt.v_page_count + get_swpgtotal()) * PAGE_SIZE). In addition,
it's wrong because it's set at mount time and swap space may be added or
removed after the mount.

So I propose adding a new mount mount option to make the limit
configurable at mount time and by default setting it to UINT64_MAX ("no
limit").

---

Add "maxfilesize" mount option for tmpfs to allow specifying the
maximum file size limit. Default is UINT64_MAX when the option is
not specified.

Use tmpfs_mem_info() rather than get_swpgtotal() in tmpfs_mount() to
check if there is enough memory available.

Remove now unused get_swpgtotal().

The patch:

http://people.freebsd.org/~jh/patches/tmpfs-maxfilesize.diff

-- 
Jaakko


More information about the freebsd-fs mailing list