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 Yuri Dario, 8 years ago

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 by Yuri Dario, 8 years ago

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

Fix typo. ticket#274. Committed revision r964.

Last edited 8 years ago by Yuri Dario (previous) (diff)

comment:3 by Yuri Dario, 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 Yuri Dario, 8 years ago

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

comment:5 by Yuri Dario, 8 years ago

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

comment:6 by Yuri Dario, 8 years ago

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

Committed revision r969.

Last edited 8 years ago by Yuri Dario (previous) (diff)

comment:7 by Yuri Dario, 8 years ago

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

comment:8 by Yuri Dario, 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.

comment:9 by Yuri Dario, 8 years ago

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

comment:10 by Yuri Dario, 8 years ago

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

comment:11 by Yuri Dario, 8 years ago

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 by Yuri Dario, 8 years ago

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

Note: See TracTickets for help on using tickets.