* [PATCH] reiser4: cryptcompress misc fixups-2
@ 2007-08-11 20:02 Edward Shishkin
0 siblings, 0 replies; only message in thread
From: Edward Shishkin @ 2007-08-11 20:02 UTC (permalink / raw)
To: Andrew Morton; +Cc: Vladimir V. Saveliev, ReiserFS Mailing List
[-- Attachment #1: Type: text/plain, Size: 2 bytes --]
[-- Attachment #2: reiser4-cryptcompress-misc-fixups-2.patch --]
[-- Type: text/x-patch, Size: 1414 bytes --]
Check a file plugin id before manipulating
with plugin-specific counter.
Signed-off-by: Edward Shishkin <edward@namesys.com>
---
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)
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-08-11 20:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-11 20:02 [PATCH] reiser4: cryptcompress misc fixups-2 Edward Shishkin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.