Opened 8 years ago
Last modified 8 years ago
#274 new enhancem.
Improve caching code
Reported by: | Yuri Dario | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | |
Component: | Samba Client | Version: | Client 2.3.x |
Keywords: | Cc: |
Description
The current caching code is written for samba specific data structures, but it can be easily modified to allow generic netdrive plugin caching.
While removing filelist_state is trivial, smbwrp_fileinfo requires more work. The plan is to allow cache to store a pointer to a structure, making it independent from plugin code.
Change History (12)
comment:1 by , 8 years ago
comment:2 by , 8 years ago
comment:3 by , 8 years ago
Inital code changes to remove samba structures; now filestate structure is no longer needed. Added also separate headers for dircache functions. The new dircache does not need to know Resource fields, it expects a DirectoryCache pointer to be allocated somewhere in the plugin (Resource data structure in samba case). In dircache_create, the resource field is passed only to allow per-resource logging.
Updates to dircache code to be more independent from samba. ticket#274. Committed revision r965.
comment:4 by , 8 years ago
comment:5 by , 8 years ago
comment:6 by , 8 years ago
Use a forward reference to smbwrp_fileinfo instead of including the header. ticket#274.
Committed revision r968.
comment:7 by , 8 years ago
comment:8 by , 8 years ago
In r975 the cache code has been improved: instead of storing samba data structures, it only stores a pointer to custom data. This data is sent back to callbacks for adding to netdrive connection list. Since custom data fields are not stored, the memory must be allocated in the plugin. A callback has been added to free entries on cache destruction.
Made code completely independent from samba data structures. ticket#274. Committed revision r975.
In current code, smbwrp_fileinfo is used only to retrieve full path in NdpEA* API and EASize in NdpEASize().
The full path can be stored as resource data in the plist.
The EAsize field will require caching the ability to store a pointer to external data (now it stores a full copy of smbwrp_fileinfo, so it needs to know structure size at compile time).