[PR #350] [MERGED] Changed cache out logic for stat - #340 #1472

Closed
opened 2026-03-04 01:54:08 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/s3fs-fuse/s3fs-fuse/pull/350
Author: @ggtakec
Created: 2/6/2016
Status: Merged
Merged: 2/6/2016
Merged by: @ggtakec

Base: masterHead: master


📝 Commits (1)

📊 Changes

2 files changed (+113 additions, -34 deletions)

View changed files

📝 src/cache.cpp (+102 -26)
📝 src/cache.h (+11 -8)

📄 Description

Chaned the cache out logic for stat information for #340.

The logic before the change cached out the stat information which had passed expire time + 1 second.
And s3fs removed only one entry at each cache-out.
s3fs update the time for cache-in when the cache is hit every time.
So if cache datas are continuous access, s3fs did not discard the cache.
This logic was very bad for a case of listing many object at one time.

Thus I changed this logic about that s3fs uses unixtime to struct timespec for cache-in time and removes caches if the cache count is over limit.

As a result of this change, it was able to reduce the amount of memory s3fs to use.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/s3fs-fuse/s3fs-fuse/pull/350 **Author:** [@ggtakec](https://github.com/ggtakec) **Created:** 2/6/2016 **Status:** ✅ Merged **Merged:** 2/6/2016 **Merged by:** [@ggtakec](https://github.com/ggtakec) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`b90b51f`](https://github.com/s3fs-fuse/s3fs-fuse/commit/b90b51f2c5af8e03190e9d8e601adb02e1c773d7) Changed cache out logic for stat - #340 ### 📊 Changes **2 files changed** (+113 additions, -34 deletions) <details> <summary>View changed files</summary> 📝 `src/cache.cpp` (+102 -26) 📝 `src/cache.h` (+11 -8) </details> ### 📄 Description Chaned the cache out logic for stat information for #340. The logic before the change cached out the stat information which had passed expire time + 1 second. And s3fs removed only one entry at each cache-out. s3fs update the time for cache-in when the cache is hit every time. So if cache datas are continuous access, s3fs did not discard the cache. This logic was very bad for a case of listing many object at one time. Thus I changed this logic about that s3fs uses unixtime to struct timespec for cache-in time and removes caches if the cache count is over limit. As a result of this change, it was able to reduce the amount of memory s3fs to use. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-04 01:54:08 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/s3fs-fuse#1472
No description provided.