Matthew Helsley wrote:
On Tue, 2005-08-09 at 18:31 -0400, Shailabh Nagar wrote:

Move initialization (CKRM RCFS rewrite)

Move filesystem initialization code to inode.c and add some printk
macros

Signed-off-by: Shailabh Nagar <[EMAIL PROTECTED]>

fs/rcfs/inode.c      |   80
++++++++++++++++++++++++++++++++++++++++++++++++
fs/rcfs/super.c      |   84
---------------------------------------------------
include/linux/rcfs.h |   25 +++++++++------
3 files changed, 95 insertions(+), 94 deletions(-)

<snip>

Index: linux-2.6.12/include/linux/rcfs.h
===================================================================
--- linux-2.6.12.orig/include/linux/rcfs.h      2005-08-09
15:30:16.391408848 -0400
+++ linux-2.6.12/include/linux/rcfs.h   2005-08-09 15:30:16.465397600
-0400
@@ -57,7 +57,6 @@ struct rcfs_mfdesc {

extern struct rcfs_mfdesc *genmfdesc[];

-struct rcfs_inode_info *rcfs_get_inode_info(struct inode *inode);
struct inode *rcfs_get_inode(struct super_block *, int, dev_t);
int rcfs_mknod(struct inode *, struct dentry *, int, dev_t);
struct dentry *rcfs_set_magf_byname(char *, void *);
@@ -80,15 +79,6 @@ extern struct file_operations members_fi
extern struct file_operations reclassify_fileops;
extern struct file_operations rcfs_file_operations;

-/* Callbacks into rcfs from ckrm */
-
-struct rcfs_functions {
-       int (*mkroot) (struct rcfs_magf *, int, struct dentry **);
-       int (*rmroot) (struct dentry *);
-       int (*register_classtype) (struct ckrm_classtype *);
-       int (*deregister_classtype) (struct ckrm_classtype *);
-};
-
int rcfs_register_classtype(struct ckrm_classtype *);
int rcfs_deregister_classtype(struct ckrm_classtype *);
int rcfs_mkroot(struct rcfs_magf *, int, struct dentry **);
@@ -98,4 +88,19 @@ int rcfs_rmroot(struct dentry *);
extern struct dentry *rcfs_rootde;
extern struct rbce_eng_callback rcfs_eng_callbacks;

+static inline struct rcfs_inode_info *rcfs_get_inode_info(struct
inode *inode)
+{
+       return container_of(inode, struct rcfs_inode_info, vfs_inode);
+}
+
+#ifdef RCFS_DEBUG
+#define dbg(format, arg...) printk(KERN_DEBUG "%s: " format "\n" ,
__FUNCTION__ , ## arg)
+#else
+#define dbg(format, arg...) do {} while (0)
+#endif
+
+#define err(format, arg...) printk(KERN_ERR "%s: " format "\n" ,
__FUNCTION__ , ## arg)
+#define info(format, arg...) printk(KERN_INFO "%s: " format "\n" ,
__FUNCTION__ , ## arg)
+#define warn(format, arg...) printk(KERN_WARNING "%s: " format "\n" ,
__FUNCTION__ , ## arg)
+
#endif /* _LINUX_RCFS_H */


        These macros belong outside of CKRM. Furthermore, the names are so
generic that I suspect the C Preprocessor will use these macros in
inappropriate places. Hence, for errors, info, and warnings I think the
best solution is to just use printk directly.

Yes. The motivation was to avoid the visual clutter of __FUNCTION__ and KERN_* each time but the former is more of a debug type information than something a user would need to see.

        For debugging printks I think a better name for the macro is required.
Perhaps rcfs_debug.

agree. Greg K-H had suggested we stick only to pr_debug but since that one can only be turned on/off for the system as a whole (and doesn't print the function name), I'm still inclined towards a custom debug macro.


-- Shailabh



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
ckrm-tech mailing list
https://lists.sourceforge.net/lists/listinfo/ckrm-tech

Reply via email to