Check a file plugin id before manipulating with plugin-specific counter. Signed-off-by: Edward Shishkin <edward@xxxxxxxxxxx> --- linux-2.6.23-rc1-mm1/fs/reiser4/plugin/file/cryptcompress.h | 18 ++++++++++-- 1 files changed, 15 insertions(+), 3 deletions(-) --- linux-2.6.23-rc1-mm1/fs/reiser4/plugin/file/cryptcompress.h.orig +++ linux-2.6.23-rc1-mm1/fs/reiser4/plugin/file/cryptcompress.h @@ -38,11 +38,23 @@ #if REISER4_DEBUG #define INODE_PGCOUNT(inode) \ - (atomic_read(&cryptcompress_inode_data(inode)->pgcount)) +({ \ + assert("edward-1530", inode_file_plugin(inode) == \ + file_plugin_by_id(CRYPTCOMPRESS_FILE_PLUGIN_ID)); \ + atomic_read(&cryptcompress_inode_data(inode)->pgcount); \ + }) #define INODE_PGCOUNT_INC(inode) \ - (atomic_inc(&cryptcompress_inode_data(inode)->pgcount)) +do { \ + assert("edward-1531", inode_file_plugin(inode) == \ + file_plugin_by_id(CRYPTCOMPRESS_FILE_PLUGIN_ID)); \ + atomic_inc(&cryptcompress_inode_data(inode)->pgcount); \ +} while (0) #define INODE_PGCOUNT_DEC(inode) \ - (atomic_dec(&cryptcompress_inode_data(inode)->pgcount)) +do { \ + if (inode_file_plugin(inode) == \ + file_plugin_by_id(CRYPTCOMPRESS_FILE_PLUGIN_ID)) \ + atomic_dec(&cryptcompress_inode_data(inode)->pgcount); \ +} while (0) #else #define INODE_PGCOUNT(inode) (0) #define INODE_PGCOUNT_INC(inode)