diff options
author | Joe Perches <joe@perches.com> | 2014-04-08 19:04:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-08 19:48:52 -0400 |
commit | e45ca8baa33e0c0228e84126c3a20df3abfd1771 (patch) | |
tree | 857a421ea03f957b144281af36291fbe3e88a0df | |
parent | d3b73ca1be3236fc33f896af7e2ba637a677d5c9 (diff) |
ncpfs: convert PPRINTK to ncp_vdbg
Use a more current logging style.
Convert the paranoia debug statement to vdbg.
Remove the embedded function names as dynamic_debug can do that.
Signed-off-by: Joe Perches <joe@perches.com>
Cc: Petr Vandrovec <petr@vandrovec.name>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r-- | fs/ncpfs/dir.c | 19 | ||||
-rw-r--r-- | fs/ncpfs/file.c | 4 | ||||
-rw-r--r-- | fs/ncpfs/ncp_fs.h | 9 | ||||
-rw-r--r-- | fs/ncpfs/ncplib_kernel.c | 6 | ||||
-rw-r--r-- | fs/ncpfs/sock.c | 2 |
5 files changed, 22 insertions, 18 deletions
diff --git a/fs/ncpfs/dir.c b/fs/ncpfs/dir.c index 8bfd2c44c2d2..91441de2529c 100644 --- a/fs/ncpfs/dir.c +++ b/fs/ncpfs/dir.c | |||
@@ -736,8 +736,8 @@ ncp_do_readdir(struct file *file, struct dir_context *ctx, | |||
736 | size_t bufsize; | 736 | size_t bufsize; |
737 | 737 | ||
738 | ncp_dbg(1, "%pD2, fpos=%ld\n", file, (unsigned long)ctx->pos); | 738 | ncp_dbg(1, "%pD2, fpos=%ld\n", file, (unsigned long)ctx->pos); |
739 | PPRINTK("ncp_do_readdir: init %pD, volnum=%d, dirent=%u\n", | 739 | ncp_vdbg("init %pD, volnum=%d, dirent=%u\n", |
740 | file, NCP_FINFO(dir)->volNumber, NCP_FINFO(dir)->dirEntNum); | 740 | file, NCP_FINFO(dir)->volNumber, NCP_FINFO(dir)->dirEntNum); |
741 | 741 | ||
742 | err = ncp_initialize_search(server, dir, &seq); | 742 | err = ncp_initialize_search(server, dir, &seq); |
743 | if (err) { | 743 | if (err) { |
@@ -804,8 +804,7 @@ int ncp_conn_logged_in(struct super_block *sb) | |||
804 | goto out; | 804 | goto out; |
805 | result = -ENOENT; | 805 | result = -ENOENT; |
806 | if (ncp_get_volume_root(server, __name, &volNumber, &dirEntNum, &DosDirNum)) { | 806 | if (ncp_get_volume_root(server, __name, &volNumber, &dirEntNum, &DosDirNum)) { |
807 | PPRINTK("ncp_conn_logged_in: %s not found\n", | 807 | ncp_vdbg("%s not found\n", server->m.mounted_vol); |
808 | server->m.mounted_vol); | ||
809 | goto out; | 808 | goto out; |
810 | } | 809 | } |
811 | dent = sb->s_root; | 810 | dent = sb->s_root; |
@@ -842,7 +841,7 @@ static struct dentry *ncp_lookup(struct inode *dir, struct dentry *dentry, unsig | |||
842 | if (!ncp_conn_valid(server)) | 841 | if (!ncp_conn_valid(server)) |
843 | goto finished; | 842 | goto finished; |
844 | 843 | ||
845 | PPRINTK("ncp_lookup: server lookup for %pd2\n", dentry); | 844 | ncp_vdbg("server lookup for %pd2\n", dentry); |
846 | 845 | ||
847 | len = sizeof(__name); | 846 | len = sizeof(__name); |
848 | if (ncp_is_server_root(dir)) { | 847 | if (ncp_is_server_root(dir)) { |
@@ -858,7 +857,7 @@ static struct dentry *ncp_lookup(struct inode *dir, struct dentry *dentry, unsig | |||
858 | if (!res) | 857 | if (!res) |
859 | res = ncp_obtain_info(server, dir, __name, &(finfo.i)); | 858 | res = ncp_obtain_info(server, dir, __name, &(finfo.i)); |
860 | } | 859 | } |
861 | PPRINTK("ncp_lookup: looked for %pd2, res=%d\n", dentry, res); | 860 | ncp_vdbg("looked for %pd2, res=%d\n", dentry, res); |
862 | /* | 861 | /* |
863 | * If we didn't find an entry, make a negative dentry. | 862 | * If we didn't find an entry, make a negative dentry. |
864 | */ | 863 | */ |
@@ -882,7 +881,7 @@ add_entry: | |||
882 | } | 881 | } |
883 | 882 | ||
884 | finished: | 883 | finished: |
885 | PPRINTK("ncp_lookup: result=%d\n", error); | 884 | ncp_vdbg("result=%d\n", error); |
886 | return ERR_PTR(error); | 885 | return ERR_PTR(error); |
887 | } | 886 | } |
888 | 887 | ||
@@ -905,7 +904,7 @@ out: | |||
905 | return error; | 904 | return error; |
906 | 905 | ||
907 | out_close: | 906 | out_close: |
908 | PPRINTK("ncp_instantiate: %pd2 failed, closing file\n", dentry); | 907 | ncp_vdbg("%pd2 failed, closing file\n", dentry); |
909 | ncp_close_file(NCP_SERVER(dir), finfo->file_handle); | 908 | ncp_close_file(NCP_SERVER(dir), finfo->file_handle); |
910 | goto out; | 909 | goto out; |
911 | } | 910 | } |
@@ -919,7 +918,7 @@ int ncp_create_new(struct inode *dir, struct dentry *dentry, umode_t mode, | |||
919 | int opmode; | 918 | int opmode; |
920 | __u8 __name[NCP_MAXPATHLEN + 1]; | 919 | __u8 __name[NCP_MAXPATHLEN + 1]; |
921 | 920 | ||
922 | PPRINTK("ncp_create_new: creating %pd2, mode=%hx\n", dentry, mode); | 921 | ncp_vdbg("creating %pd2, mode=%hx\n", dentry, mode); |
923 | 922 | ||
924 | ncp_age_dentry(server, dentry); | 923 | ncp_age_dentry(server, dentry); |
925 | len = sizeof(__name); | 924 | len = sizeof(__name); |
@@ -1069,7 +1068,7 @@ static int ncp_unlink(struct inode *dir, struct dentry *dentry) | |||
1069 | * Check whether to close the file ... | 1068 | * Check whether to close the file ... |
1070 | */ | 1069 | */ |
1071 | if (inode) { | 1070 | if (inode) { |
1072 | PPRINTK("ncp_unlink: closing file\n"); | 1071 | ncp_vdbg("closing file\n"); |
1073 | ncp_make_closed(inode); | 1072 | ncp_make_closed(inode); |
1074 | } | 1073 | } |
1075 | 1074 | ||
diff --git a/fs/ncpfs/file.c b/fs/ncpfs/file.c index 4cb02fdc2684..77640a8bfb87 100644 --- a/fs/ncpfs/file.c +++ b/fs/ncpfs/file.c | |||
@@ -73,7 +73,7 @@ int ncp_make_open(struct inode *inode, int right) | |||
73 | break; | 73 | break; |
74 | } | 74 | } |
75 | if (result) { | 75 | if (result) { |
76 | PPRINTK("ncp_make_open: failed, result=%d\n", result); | 76 | ncp_vdbg("failed, result=%d\n", result); |
77 | goto out_unlock; | 77 | goto out_unlock; |
78 | } | 78 | } |
79 | /* | 79 | /* |
@@ -85,7 +85,7 @@ int ncp_make_open(struct inode *inode, int right) | |||
85 | } | 85 | } |
86 | 86 | ||
87 | access = NCP_FINFO(inode)->access; | 87 | access = NCP_FINFO(inode)->access; |
88 | PPRINTK("ncp_make_open: file open, access=%x\n", access); | 88 | ncp_vdbg("file open, access=%x\n", access); |
89 | if (access == right || access == O_RDWR) { | 89 | if (access == right || access == O_RDWR) { |
90 | atomic_inc(&NCP_FINFO(inode)->opened); | 90 | atomic_inc(&NCP_FINFO(inode)->opened); |
91 | error = 0; | 91 | error = 0; |
diff --git a/fs/ncpfs/ncp_fs.h b/fs/ncpfs/ncp_fs.h index b54ad123b9d4..d52e7e6b5eed 100644 --- a/fs/ncpfs/ncp_fs.h +++ b/fs/ncpfs/ncp_fs.h | |||
@@ -7,9 +7,14 @@ | |||
7 | 7 | ||
8 | #undef NCPFS_PARANOIA | 8 | #undef NCPFS_PARANOIA |
9 | #ifdef NCPFS_PARANOIA | 9 | #ifdef NCPFS_PARANOIA |
10 | #define PPRINTK(format, args...) PRINTK(format , ## args) | 10 | #define ncp_vdbg(fmt, ...) \ |
11 | pr_debug(fmt, ##__VA_ARGS__) | ||
11 | #else | 12 | #else |
12 | #define PPRINTK(format, args...) | 13 | #define ncp_vdbg(fmt, ...) \ |
14 | do { \ | ||
15 | if (0) \ | ||
16 | pr_debug(fmt, ##__VA_ARGS__); \ | ||
17 | } while (0) | ||
13 | #endif | 18 | #endif |
14 | 19 | ||
15 | #ifndef DEBUG_NCP | 20 | #ifndef DEBUG_NCP |
diff --git a/fs/ncpfs/ncplib_kernel.c b/fs/ncpfs/ncplib_kernel.c index 29388550a2d8..482387532f54 100644 --- a/fs/ncpfs/ncplib_kernel.c +++ b/fs/ncpfs/ncplib_kernel.c | |||
@@ -295,9 +295,9 @@ ncp_make_closed(struct inode *inode) | |||
295 | err = ncp_close_file(NCP_SERVER(inode), NCP_FINFO(inode)->file_handle); | 295 | err = ncp_close_file(NCP_SERVER(inode), NCP_FINFO(inode)->file_handle); |
296 | 296 | ||
297 | if (!err) | 297 | if (!err) |
298 | PPRINTK("ncp_make_closed: volnum=%d, dirent=%u, error=%d\n", | 298 | ncp_vdbg("volnum=%d, dirent=%u, error=%d\n", |
299 | NCP_FINFO(inode)->volNumber, | 299 | NCP_FINFO(inode)->volNumber, |
300 | NCP_FINFO(inode)->dirEntNum, err); | 300 | NCP_FINFO(inode)->dirEntNum, err); |
301 | } | 301 | } |
302 | mutex_unlock(&NCP_FINFO(inode)->open_mutex); | 302 | mutex_unlock(&NCP_FINFO(inode)->open_mutex); |
303 | return err; | 303 | return err; |
diff --git a/fs/ncpfs/sock.c b/fs/ncpfs/sock.c index 3dd731bfd340..04a69a4d8e96 100644 --- a/fs/ncpfs/sock.c +++ b/fs/ncpfs/sock.c | |||
@@ -823,7 +823,7 @@ int ncp_request2(struct ncp_server *server, int function, | |||
823 | result = reply->completion_code; | 823 | result = reply->completion_code; |
824 | 824 | ||
825 | if (result != 0) | 825 | if (result != 0) |
826 | PPRINTK("ncp_request: completion code=%x\n", result); | 826 | ncp_vdbg("completion code=%x\n", result); |
827 | out: | 827 | out: |
828 | return result; | 828 | return result; |
829 | } | 829 | } |