patch-2.2.17 linux/fs/smbfs/inode.c

Next file: linux/fs/smbfs/ioctl.c
Previous file: linux/fs/smbfs/file.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.2.16/fs/smbfs/inode.c linux/fs/smbfs/inode.c
@@ -4,6 +4,7 @@
  *  Copyright (C) 1995, 1996 by Paal-Kr. Engstad and Volker Lendecke
  *  Copyright (C) 1997 by Volker Lendecke
  *
+ * Please add a note about your changes to smbfs in the ChangeLog file.
  */
 
 #include <linux/config.h>
@@ -28,8 +29,7 @@
 #include <asm/system.h>
 #include <asm/uaccess.h>
 
-#define SMBFS_PARANOIA 1
-/* #define SMBFS_DEBUG_VERBOSE 1 */
+#include "smb_debug.h"
 
 static void smb_read_inode(struct inode *);
 static void smb_put_inode(struct inode *);
@@ -74,7 +74,7 @@
 {
 	struct inode *result;
 
-	pr_debug("smb_iget: %p\n", fattr);
+	DEBUG1("fattr @ %p\n", fattr);
 
 	result = get_empty_inode();
 	result->i_sb = sb;
@@ -155,7 +155,8 @@
 smb_read_inode(struct inode *inode)
 {
 	/* Now it can be called only by NFS */
-	printk("smb_read_inode called from invalid point\n");
+	/* FIXME! what does that comment mean!? */
+	PARANOIA("smb_read_inode called from invalid point\n");
 	return;
 }
 
@@ -166,9 +167,7 @@
 void
 smb_invalidate_inodes(struct smb_sb_info *server)
 {
-#ifdef SMBFS_DEBUG_VERBOSE
-printk("smb_invalidate_inodes\n");
-#endif
+	VERBOSE("\n");
 	shrink_dcache_sb(SB_of(server));
 	invalidate_inodes(SB_of(server));
 }
@@ -203,11 +202,10 @@
 			 * To limit damage, mark the inode as bad so that
 			 * subsequent lookup validations will fail.
 			 */
-#ifdef SMBFS_PARANOIA
-printk(KERN_DEBUG "smb_refresh_inode: %s/%s changed mode, %07o to %07o\n",
-dentry->d_parent->d_name.name, dentry->d_name.name,
-inode->i_mode, fattr.f_mode);
-#endif
+			PARANOIA("%s/%s changed mode, %07o to %07o\n",
+				 DENTRY_PATH(dentry),
+				 inode->i_mode, fattr.f_mode);
+
 			fattr.f_mode = inode->i_mode; /* save mode */
 			make_bad_inode(inode);
 			inode->i_mode = fattr.f_mode; /* restore mode */
@@ -238,7 +236,8 @@
 	time_t last_time;
 	int error = 0;
 
-	pr_debug("smb_revalidate_inode\n");
+	DEBUG1("\n");
+
 	/*
 	 * If this is a file opened with write permissions,
 	 * the inode will be up-to-date.
@@ -254,10 +253,8 @@
 	 */
 	if (time_before(jiffies, inode->u.smbfs_i.oldmtime + HZ/10))
 	{
-#ifdef SMBFS_DEBUG_VERBOSE
-printk(KERN_DEBUG "smb_revalidate_inode: up-to-date, jiffies=%lu, oldtime=%lu\n",
-jiffies, inode->u.smbfs_i.oldmtime);
-#endif
+		VERBOSE("up-to-date, jiffies=%lu, oldtime=%lu\n",
+			jiffies, inode->u.smbfs_i.oldmtime);
 		goto out;
 	}
 
@@ -269,11 +266,9 @@
 	error = smb_refresh_inode(dentry);
 	if (error || inode->i_mtime != last_time)
 	{
-#ifdef SMBFS_DEBUG_VERBOSE
-printk(KERN_DEBUG "smb_revalidate: %s/%s changed, old=%ld, new=%ld\n",
-dentry->d_parent->d_name.name, dentry->d_name.name,
-(long) last_time, (long) inode->i_mtime);
-#endif
+		VERBOSE("%s/%s changed, old=%ld, new=%ld\n",
+			DENTRY_PATH(dentry),
+			(long) last_time, (long) inode->i_mtime);
 		if (!S_ISDIR(inode->i_mode))
 			invalidate_inode_pages(inode);
 	}
@@ -288,7 +283,7 @@
 static void
 smb_put_inode(struct inode *ino)
 {
-	pr_debug("smb_put_inode: count = %d\n", ino->i_count);
+	DEBUG1("count = %d\n", ino->i_count);
 	if (ino->i_count == 1)
 		ino->i_nlink = 0;
 }
@@ -300,10 +295,9 @@
 static void
 smb_delete_inode(struct inode *ino)
 {
-	pr_debug("smb_delete_inode\n");
+	DEBUG1("\n");
 	if (smb_close(ino))
-		printk(KERN_DEBUG "smb_delete_inode: could not close inode %ld\n",
-			ino->i_ino);
+		PARANOIA("could not close inode %ld\n", ino->i_ino);
 	clear_inode(ino);
 }
 
@@ -319,7 +313,7 @@
 	}
 
 	if (server->conn_pid)
-	       kill_proc(server->conn_pid, SIGTERM, 1);
+		kill_proc(server->conn_pid, SIGTERM, 1);
 
 	kfree(server->mnt);
 	kfree(sb->u.smbfs_sb.temp_buf);
@@ -372,7 +366,7 @@
 	if (!mnt)
 		goto out_no_mount;
 	*mnt = *((struct smb_mount_data *) raw_data);
-	/* ** temp ** pass config flags in file mode */
+	/* FIXME: ** temp ** pass config flags in file mode */
 	mnt->version = (mnt->file_mode >> 9);
 	mnt->file_mode &= (S_IRWXU | S_IRWXG | S_IRWXO);
 	mnt->file_mode |= S_IFREG;
@@ -410,7 +404,7 @@
 	printk(KERN_ERR "SMBFS: need mount version %d\n", SMB_MOUNT_VERSION);
 	goto out_fail;
 out_no_data:
-	printk(KERN_DEBUG "smb_read_super: missing data argument\n");
+	printk(KERN_ERR "smb_read_super: missing data argument\n");
 out_fail:
 	sb->s_dev = 0;
 	MOD_DEC_USE_COUNT;
@@ -461,11 +455,9 @@
 
 	if ((attr->ia_valid & ATTR_SIZE) != 0)
 	{
-#ifdef SMBFS_DEBUG_VERBOSE
-printk(KERN_DEBUG "smb_notify_change: changing %s/%s, old size=%ld, new size=%ld\n",
-dentry->d_parent->d_name.name, dentry->d_name.name,
-(long) inode->i_size, (long) attr->ia_size);
-#endif
+		VERBOSE("changing %s/%s, old size=%ld, new size=%ld\n",
+			DENTRY_PATH(dentry),
+			(long) inode->i_size, (long) attr->ia_size);
 		error = smb_open(dentry, O_WRONLY);
 		if (error)
 			goto out;
@@ -517,10 +509,8 @@
 	 */
 	if ((attr->ia_valid & ATTR_MODE) != 0)
 	{
-#ifdef SMBFS_DEBUG_VERBOSE
-		printk(KERN_DEBUG "smb_notify_change: %s/%s mode change, old=%x, new=%lx\n",
-		       dentry->d_parent->d_name.name, dentry->d_name.name, fattr.f_mode,attr->ia_mode);
-#endif
+		VERBOSE("%s/%s mode change, old=%x, new=%lx\n",
+			DENTRY_PATH(dentry), fattr.f_mode,attr->ia_mode);
 		changed = 0;
 		if (attr->ia_mode & S_IWUSR)
 		{
@@ -577,7 +567,7 @@
 int
 init_module(void)
 {
-	pr_debug("smbfs: init_module called\n");
+	DEBUG1("registering ...\n");
 
 #ifdef DEBUG_SMB_MALLOC
 	smb_malloced = 0;
@@ -591,7 +581,7 @@
 void
 cleanup_module(void)
 {
-	pr_debug("smbfs: cleanup_module called\n");
+	DEBUG1("unregistering ...\n");
 	unregister_filesystem(&smb_fs_type);
 #ifdef DEBUG_SMB_MALLOC
 	printk(KERN_DEBUG "smb_malloced: %d\n", smb_malloced);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)