提交 e48485f5 编写于 作者: T Tien Fong Chee 提交者: Tom Rini

fs: fat: Reduce default max clustersize 64KiB from malloc pool

Release cluster block immediately when no longer use would help to reduce
64KiB memory allocated to the memory pool.
Signed-off-by: NTien Fong Chee <tien.fong.chee@intel.com>
上级 8537874a
......@@ -1148,7 +1148,15 @@ int file_fat_read_at(const char *filename, loff_t pos, void *buffer,
goto out_free_both;
debug("reading %s at pos %llu\n", filename, pos);
ret = get_contents(&fsdata, itr->dent, pos, buffer, maxsize, actread);
/* For saving default max clustersize memory allocated to malloc pool */
dir_entry *dentptr = itr->dent;
free(itr);
itr = NULL;
ret = get_contents(&fsdata, dentptr, pos, buffer, maxsize, actread);
out_free_both:
free(fsdata.fatbuf);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册