summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Hows <howsdav@gmail.com>2016-06-08 17:16:35 +1000
committerAlex Gorrod <alexander.gorrod@mongodb.com>2016-06-08 17:16:35 +1000
commitc2db6bad7ad373e7445a9f0498074c6ec6bde443 (patch)
tree0b4cd8423b08bfcf44e447194ec402b9ab6749bf
parent36229a2693aa6e7bcb8fa471edf1ab05ee79869a (diff)
downloadmongo-c2db6bad7ad373e7445a9f0498074c6ec6bde443.tar.gz
WT-2683 Allow in memory storage engine to report zero disk usage (#2788)
MongoDB used to require a non-zero disk size for any non-empty collection.
-rw-r--r--src/os_common/os_fs_inmemory.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/src/os_common/os_fs_inmemory.c b/src/os_common/os_fs_inmemory.c
index 3e4fe628892..84752fe65fe 100644
--- a/src/os_common/os_fs_inmemory.c
+++ b/src/os_common/os_fs_inmemory.c
@@ -80,22 +80,6 @@ __im_handle_remove(WT_SESSION_IMPL *session,
}
/*
- * __im_handle_size --
- * Return the handle's data size.
- */
-static void
-__im_handle_size(WT_FILE_HANDLE_INMEM *im_fh, wt_off_t *sizep)
-{
- /*
- * XXX
- * This function exists as a place for this comment. MongoDB assumes
- * any file with content will have a non-zero size. In memory tables
- * generally are zero-sized, make MongoDB happy.
- */
- *sizep = im_fh->buf.size == 0 ? 1024 : (wt_off_t)im_fh->buf.size;
-}
-
-/*
* __im_fs_directory_list --
* Return the directory contents.
*/
@@ -284,7 +268,7 @@ __im_fs_size(WT_FILE_SYSTEM *file_system,
if ((im_fh = __im_handle_search(file_system, name)) == NULL)
ret = ENOENT;
else
- __im_handle_size(im_fh, sizep);
+ *sizep = (wt_off_t)im_fh->buf.size;
__wt_spin_unlock(session, &im_fs->lock);
@@ -370,7 +354,7 @@ __im_file_size(
__wt_spin_lock(session, &im_fs->lock);
- __im_handle_size(im_fh, sizep);
+ *sizep = (wt_off_t)im_fh->buf.size;
__wt_spin_unlock(session, &im_fs->lock);