Skip to content

Commit d2783f4

Browse files
committed
common: tools: enhance fs platform interface with set user quota
This patch enhances the platform filesystem interface by adding a method to set user quota. Signed-off-by: Mykhailo Lohvynenko <[email protected]> Reviewed-by: Mykola Kobets <[email protected]> Reviewed-by: Mykola Solianko <[email protected]> Reviewed-by: Oleksandr Grytsov <[email protected]>
1 parent 32f035d commit d2783f4

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

include/aos/common/tools/fs.hpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,16 @@ class FSPlatformItf {
6868
* @return RetWithError<size_t>.
6969
*/
7070
virtual RetWithError<size_t> GetAvailableSize(const String& dir) const = 0;
71+
72+
/**
73+
* Sets user quota for the given path.
74+
*
75+
* @param path path to set quota for.
76+
* @param quota quota size in bytes.
77+
* @param uid user ID.
78+
* @return Error.
79+
*/
80+
virtual Error SetUserQuota(const String& path, size_t quota, size_t uid) const = 0;
7181
};
7282

7383
/**

tests/include/mocks/filesystemmock.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ class FSPlatformMock : public fs::FSPlatformItf {
1818
MOCK_METHOD(RetWithError<size_t>, GetTotalSize, (const String& dir), (const, override));
1919
MOCK_METHOD(RetWithError<size_t>, GetDirSize, (const String& dir), (const, override));
2020
MOCK_METHOD(RetWithError<size_t>, GetAvailableSize, (const String& dir), (const, override));
21+
MOCK_METHOD(Error, SetUserQuota, (const String& path, size_t quota, size_t uid), (const, override));
2122
};
2223
} // namespace aos
2324

0 commit comments

Comments
 (0)