[linux-cifs-client] Re: projected date for mount.cifs to support DFS junction points

Steve French smfrench at gmail.com
Fri Feb 8 05:27:42 GMT 2008


On Feb 7, 2008 12:25 PM, Christoph Hellwig <hch at infradead.org> wrote:
> and while I'm at it a lot of the non-DFS additions to cifs aren't quite
> up to standards for kernel code either, lots of useless braces, wierd
> coding style and ifdef mania.
Reducing "ifdef mania" would help (there are about 120 "#ifdef
CONFIG_CIFS_somethings" in CIFS), I discussed getting rid of most
references to CONFIG_CIFS_DEBUG2 with Shaggy today.  One approach
would be to do something like the following (there are about 25 other
places that would be changed in the same way  but this gives the
idea).  Is this an acceptable approach (seems like the compiler should
optimize it out properly even with this change)

diff --git a/fs/cifs/cifs_debug.h b/fs/cifs/cifs_debug.h
index 90e7624..722b722 100644
--- a/fs/cifs/cifs_debug.h
+++ b/fs/cifs/cifs_debug.h
@@ -25,8 +25,11 @@

 void cifs_dump_mem(char *label, void *data, int length);
 #ifdef CONFIG_CIFS_DEBUG2
+#define DEBUG2 2
 void cifs_dump_detail(struct smb_hdr *);
 void cifs_dump_mids(struct TCP_Server_Info *);
+#else
+#define DEBUG2 0
 #endif
 extern int traceSMB;		/* flag which enables the function below */
 void dump_smb(struct smb_hdr *, int);
diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c
index 842aaa9..381ddca 100644
--- a/fs/cifs/cifsacl.c
+++ b/fs/cifs/cifsacl.c
@@ -215,9 +215,7 @@ static void access_flags_to_mode(__le32 ace_flags,
int type, umode_t *pmode,

 	if (flags & GENERIC_ALL) {
 		*pmode |= (S_IRWXUGO & (*pbits_to_set));
-#ifdef CONFIG_CIFS_DEBUG2
-		cFYI(1, ("all perms"));
-#endif
+		cFYI(DEBUG2, ("all perms"));
 		return;
 	}
 	if ((flags & GENERIC_WRITE) ||
@@ -230,9 +228,7 @@ static void access_flags_to_mode(__le32 ace_flags,
int type, umode_t *pmode,
 			((flags & FILE_EXEC_RIGHTS) == FILE_EXEC_RIGHTS))
 		*pmode |= (S_IXUGO & (*pbits_to_set));

-#ifdef CONFIG_CIFS_DEBUG2
-	cFYI(1, ("access flags 0x%x mode now 0x%x", flags, *pmode));
-#endif
+	cFYI(DEBUG2, ("access flags 0x%x mode now 0x%x", flags, *pmode));
 	return;
 }

@@ -261,9 +257,7 @@ static void mode_to_access_flags(umode_t mode,
umode_t bits_to_use,
 	if (mode & S_IXUGO)
 		*pace_flags |= SET_FILE_EXEC_RIGHTS;

-#ifdef CONFIG_CIFS_DEBUG2
-	cFYI(1, ("mode: 0x%x, access flags now 0x%x", mode, *pace_flags));
-#endif
+	cFYI(DEBUG2, ("mode: 0x%x, access flags now 0x%x", mode, *pace_flags));
 	return;
 }




-- 
Thanks,

Steve


More information about the linux-cifs-client mailing list