diff options
| author | Jerry Jelinek <jerry.jelinek@joyent.com> | 2011-12-02 16:25:07 +0000 |
|---|---|---|
| committer | Jerry Jelinek <jerry.jelinek@joyent.com> | 2011-12-02 16:25:07 +0000 |
| commit | 6409d4aea3c383b13570a1e59e141a64e4ead49c (patch) | |
| tree | 213a0bdf0b192aee43600091fcd890f483893912 /usr/src/uts/common/fs/tmpfs | |
| parent | 51d8dc95670c34b4f5973af294c5b8b1108e5178 (diff) | |
| download | illumos-joyent-6409d4aea3c383b13570a1e59e141a64e4ead49c.tar.gz | |
OS-781 need a way to change the tmpfs size on a mounted fs
Diffstat (limited to 'usr/src/uts/common/fs/tmpfs')
| -rw-r--r-- | usr/src/uts/common/fs/tmpfs/tmp_vfsops.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/usr/src/uts/common/fs/tmpfs/tmp_vfsops.c b/usr/src/uts/common/fs/tmpfs/tmp_vfsops.c index f8a36a528f..f22cc3ecf0 100644 --- a/usr/src/uts/common/fs/tmpfs/tmp_vfsops.c +++ b/usr/src/uts/common/fs/tmpfs/tmp_vfsops.c @@ -20,6 +20,7 @@ */ /* * Copyright (c) 1990, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2011, Joyent, Inc. All rights reserved. */ #include <sys/types.h> @@ -76,7 +77,7 @@ static vfsdef_t vfw = { VFSDEF_VERSION, "tmpfs", tmpfsinit, - VSW_HASPROTO|VSW_STATS|VSW_ZMOUNT, + VSW_HASPROTO|VSW_CANREMOUNT|VSW_STATS|VSW_ZMOUNT, &tmpfs_proto_opttbl }; @@ -249,7 +250,7 @@ tmp_mount( return (ENOTDIR); mutex_enter(&mvp->v_lock); - if ((uap->flags & MS_OVERLAY) == 0 && + if ((uap->flags & MS_REMOUNT) == 0 && (uap->flags & MS_OVERLAY) == 0 && (mvp->v_count != 1 || (mvp->v_flag & VROOT))) { mutex_exit(&mvp->v_lock); return (EBUSY); @@ -286,6 +287,21 @@ tmp_mount( (uap->flags & MS_SYSSPACE) ? UIO_SYSSPACE : UIO_USERSPACE, &dpn)) goto out; + if (uap->flags & MS_REMOUNT) { + tm = (struct tmount *)VFSTOTM(vfsp); + + /* + * If we change the size so its less than what is currently + * being used, we allow that. The file system will simply be + * full until enough files have been removed to get below the + * new max. + */ + mutex_enter(&tm->tm_contents); + tm->tm_anonmax = anonmax; + mutex_exit(&tm->tm_contents); + goto out; + } + if ((tm = tmp_memalloc(sizeof (struct tmount), 0)) == NULL) { pn_free(&dpn); error = ENOMEM; |
