Opened 3 years ago

Last modified 3 years ago

#274 new enhancem.

Improve caching code

Reported by: ydario Owned by:
Priority: minor Milestone:
Component: Samba Client Version: Client 2.3.x
Keywords: Cc:


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 Changed 3 years ago by ydario

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).

comment:2 Changed 3 years ago by ydario

Store full path of connection in the resource data structure. ticket#274. Committed revision r963.

Fix typo. ticket#274. Committed revision r964.

Last edited 3 years ago by ydario (previous) (diff)

comment:3 Changed 3 years ago by ydario

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 Changed 3 years ago by ydario

Samba code changes for using new dircache API. ticket#274. Committed revision r966.

comment:5 Changed 3 years ago by ydario

Since pdc field is already known to upper layer, avoid storing it in each cache entry. ticket#274. Committed revision r967.

comment:6 Changed 3 years ago by ydario

Use a forward reference to smbwrp_fileinfo instead of including the header. ticket#274.

Committed revision r969.

Last edited 3 years ago by ydario (previous) (diff)

comment:7 Changed 3 years ago by ydario

partially revert changeset r968, fix wrong parameter pointer. ticket#274. Committed revision 970.

comment:8 Changed 3 years ago by ydario

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.

comment:9 Changed 3 years ago by ydario

Store samba data in dynamic allocated memory for new caching code. Added deallocator code. ticket#274. Committed revision r976.

comment:10 Changed 3 years ago by ydario

Hide private data structures in cache code header. ticket#274. Committed revision r977.

comment:11 Changed 3 years ago by ydario

To allow building the cache code as separate dll, the plugin helper table must be passed as pointer at init time.

Get plugin helper table pointer at init time. ticket#274. Committed revision r983.

comment:12 Changed 3 years ago by ydario

Store plugin helper table before calling functions... ticket#274. Committed revision r985.

Note: See TracTickets for help on using tickets.