[PATCH] kNFSd: Allow sunrpc/svc cache init function to modify the "key"
From: NeilBrown <neilb@cse.unsw.edu.au> When adding a item to a sunrpc/svc cache that contains kmalloced data it is usefully to move the malloced data out of the key object into the new cache object rather than copying (as then we would need to cope with kmalloc failure and such). This means modifying the original. If the kmalloced data forms part of the key, then we must not move the data out until after the key isn't needed any more. So this patch moves the call to "INIT" on a new item (which fills in the key) to *after* the item has been found (or not), and also makes sure we only call the HASH function once. Thanks to "J. Bruce Fields" <bfields@fieldses.org> also 1/ remove unnecessary assignment 2/ fix comments that lag behind implementation.
Showing
Please register or sign in to comment