X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;ds=sidebyside;f=lustre%2Fsmfs%2Fsmfs_internal.h;h=53ae60510a55ae0e52087a49206a667a26b3e7bd;hb=1bb10d0c175fc03b3f871e5f50a3fa10be20194c;hp=46a750fabf849ae193931b9e7fee64efb4a99161;hpb=447e1c7095561f4ea59526d7704593db1953c339;p=fs%2Flustre-release.git diff --git a/lustre/smfs/smfs_internal.h b/lustre/smfs/smfs_internal.h index 46a750f..53ae605 100644 --- a/lustre/smfs/smfs_internal.h +++ b/lustre/smfs/smfs_internal.h @@ -284,14 +284,21 @@ static inline int get_active_entry(struct inode *dir, __u64 *active_entry) #define CACHE_HOOK_MAX 9 -#define SMFS_CACHE_HOOK_PRE(op, handle, dir) \ -{ \ - if (smfs_cache_hook(dir)) { \ - LASSERT(handle != NULL); \ - CDEBUG(D_INODE, "cache hook pre: op %d, dir %lu\n", \ - op, dir->i_ino); \ - cache_space_pre(dir, op); \ - } \ +#define SMFS_CACHE_HOOK_PRE(op, handle, dir, rc) \ +{ \ + while (smfs_cache_hook(dir)) { \ + if (!handle) { \ + handle = smfs_trans_start(dir, KML_CACHE_NOOP, NULL); \ + if (IS_ERR(handle)) { \ + rc = -ENOSPC; \ + break; \ + } \ + } \ + CDEBUG(D_INODE, "cache hook pre: op %d, dir %lu\n", \ + op, dir->i_ino); \ + cache_space_pre(dir, op); \ + break; \ + } \ } #define SMFS_CACHE_HOOK_POST(op, handle, old_dir, old_dentry, \