aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ncpfs
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2014-04-08 19:04:14 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-04-08 19:48:52 -0400
commitb41f8b84d01d32ea618dbbe5679bd07ce3444b88 (patch)
treecbede13191e15a0554b8d12ae6ef098a8ce4048b /fs/ncpfs
parentd0057ca4c1fe73c05a9e077cc7691217370b3283 (diff)
ncpfs: Add pr_fmt and convert printks to pr_<level>
Convert to a more current logging style. Add pr_fmt to prefix with "ncpfs: ". Remove the embedded function names and use "%s: ", __func__ Some previously unprefixed messages now have "ncpfs: " 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>
Diffstat (limited to 'fs/ncpfs')
-rw-r--r--fs/ncpfs/file.c4
-rw-r--r--fs/ncpfs/getopt.c12
-rw-r--r--fs/ncpfs/inode.c10
-rw-r--r--fs/ncpfs/ncplib_kernel.c4
-rw-r--r--fs/ncpfs/sock.c31
5 files changed, 34 insertions, 27 deletions
diff --git a/fs/ncpfs/file.c b/fs/ncpfs/file.c
index 8f5074e1ecb9..93f319101fde 100644
--- a/fs/ncpfs/file.c
+++ b/fs/ncpfs/file.c
@@ -6,6 +6,8 @@
6 * 6 *
7 */ 7 */
8 8
9#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
10
9#include <asm/uaccess.h> 11#include <asm/uaccess.h>
10 12
11#include <linux/time.h> 13#include <linux/time.h>
@@ -34,7 +36,7 @@ int ncp_make_open(struct inode *inode, int right)
34 36
35 error = -EINVAL; 37 error = -EINVAL;
36 if (!inode) { 38 if (!inode) {
37 printk(KERN_ERR "ncp_make_open: got NULL inode\n"); 39 pr_err("%s: got NULL inode\n", __func__);
38 goto out; 40 goto out;
39 } 41 }
40 42
diff --git a/fs/ncpfs/getopt.c b/fs/ncpfs/getopt.c
index 0af3349de851..03ffde1f44d6 100644
--- a/fs/ncpfs/getopt.c
+++ b/fs/ncpfs/getopt.c
@@ -2,6 +2,8 @@
2 * getopt.c 2 * getopt.c
3 */ 3 */
4 4
5#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
6
5#include <linux/kernel.h> 7#include <linux/kernel.h>
6#include <linux/string.h> 8#include <linux/string.h>
7 9
@@ -46,8 +48,8 @@ int ncp_getopt(const char *caller, char **options, const struct ncp_option *opts
46 if (opts->has_arg & OPT_NOPARAM) { 48 if (opts->has_arg & OPT_NOPARAM) {
47 return opts->val; 49 return opts->val;
48 } 50 }
49 printk(KERN_INFO "%s: the %s option requires an argument\n", 51 pr_info("%s: the %s option requires an argument\n",
50 caller, token); 52 caller, token);
51 return -EINVAL; 53 return -EINVAL;
52 } 54 }
53 if (opts->has_arg & OPT_INT) { 55 if (opts->has_arg & OPT_INT) {
@@ -57,18 +59,18 @@ int ncp_getopt(const char *caller, char **options, const struct ncp_option *opts
57 if (!*v) { 59 if (!*v) {
58 return opts->val; 60 return opts->val;
59 } 61 }
60 printk(KERN_INFO "%s: invalid numeric value in %s=%s\n", 62 pr_info("%s: invalid numeric value in %s=%s\n",
61 caller, token, val); 63 caller, token, val);
62 return -EDOM; 64 return -EDOM;
63 } 65 }
64 if (opts->has_arg & OPT_STRING) { 66 if (opts->has_arg & OPT_STRING) {
65 return opts->val; 67 return opts->val;
66 } 68 }
67 printk(KERN_INFO "%s: unexpected argument %s to the %s option\n", 69 pr_info("%s: unexpected argument %s to the %s option\n",
68 caller, val, token); 70 caller, val, token);
69 return -EINVAL; 71 return -EINVAL;
70 } 72 }
71 } 73 }
72 printk(KERN_INFO "%s: Unrecognized mount option %s\n", caller, token); 74 pr_info("%s: Unrecognized mount option %s\n", caller, token);
73 return -EOPNOTSUPP; 75 return -EOPNOTSUPP;
74} 76}
diff --git a/fs/ncpfs/inode.c b/fs/ncpfs/inode.c
index 647d86d2db39..3277fc132959 100644
--- a/fs/ncpfs/inode.c
+++ b/fs/ncpfs/inode.c
@@ -9,6 +9,8 @@
9 * 9 *
10 */ 10 */
11 11
12#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
13
12#include <linux/module.h> 14#include <linux/module.h>
13 15
14#include <asm/uaccess.h> 16#include <asm/uaccess.h>
@@ -258,7 +260,7 @@ ncp_iget(struct super_block *sb, struct ncp_entry_info *info)
258 struct inode *inode; 260 struct inode *inode;
259 261
260 if (info == NULL) { 262 if (info == NULL) {
261 printk(KERN_ERR "ncp_iget: info is NULL\n"); 263 pr_err("%s: info is NULL\n", __func__);
262 return NULL; 264 return NULL;
263 } 265 }
264 266
@@ -290,7 +292,7 @@ ncp_iget(struct super_block *sb, struct ncp_entry_info *info)
290 } 292 }
291 insert_inode_hash(inode); 293 insert_inode_hash(inode);
292 } else 294 } else
293 printk(KERN_ERR "ncp_iget: iget failed!\n"); 295 pr_err("%s: iget failed!\n", __func__);
294 return inode; 296 return inode;
295} 297}
296 298
@@ -306,7 +308,7 @@ ncp_evict_inode(struct inode *inode)
306 308
307 if (ncp_make_closed(inode) != 0) { 309 if (ncp_make_closed(inode) != 0) {
308 /* We can't do anything but complain. */ 310 /* We can't do anything but complain. */
309 printk(KERN_ERR "ncp_evict_inode: could not close\n"); 311 pr_err("%s: could not close\n", __func__);
310 } 312 }
311} 313}
312 314
@@ -621,7 +623,7 @@ static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent)
621 now because of PATH_MAX changes.. */ 623 now because of PATH_MAX changes.. */
622 if (server->m.time_out < 1) { 624 if (server->m.time_out < 1) {
623 server->m.time_out = 10; 625 server->m.time_out = 10;
624 printk(KERN_INFO "You need to recompile your ncpfs utils..\n"); 626 pr_info("You need to recompile your ncpfs utils..\n");
625 } 627 }
626 server->m.time_out = server->m.time_out * HZ / 100; 628 server->m.time_out = server->m.time_out * HZ / 100;
627 server->m.file_mode = (server->m.file_mode & S_IRWXUGO) | S_IFREG; 629 server->m.file_mode = (server->m.file_mode & S_IRWXUGO) | S_IFREG;
diff --git a/fs/ncpfs/ncplib_kernel.c b/fs/ncpfs/ncplib_kernel.c
index 981a95617fc9..827c1180cba6 100644
--- a/fs/ncpfs/ncplib_kernel.c
+++ b/fs/ncpfs/ncplib_kernel.c
@@ -9,7 +9,7 @@
9 * 9 *
10 */ 10 */
11 11
12 12#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
13 13
14#include "ncp_fs.h" 14#include "ncp_fs.h"
15 15
@@ -425,7 +425,7 @@ int ncp_obtain_info(struct ncp_server *server, struct inode *dir, const char *pa
425 int result; 425 int result;
426 426
427 if (target == NULL) { 427 if (target == NULL) {
428 printk(KERN_ERR "ncp_obtain_info: invalid call\n"); 428 pr_err("%s: invalid call\n", __func__);
429 return -EINVAL; 429 return -EINVAL;
430 } 430 }
431 ncp_init_request(server); 431 ncp_init_request(server);
diff --git a/fs/ncpfs/sock.c b/fs/ncpfs/sock.c
index 3a1587222c8a..6390d7b91b7f 100644
--- a/fs/ncpfs/sock.c
+++ b/fs/ncpfs/sock.c
@@ -8,6 +8,7 @@
8 * 8 *
9 */ 9 */
10 10
11#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
11 12
12#include <linux/time.h> 13#include <linux/time.h>
13#include <linux/errno.h> 14#include <linux/errno.h>
@@ -231,7 +232,7 @@ static void __ncptcp_try_send(struct ncp_server *server)
231 return; 232 return;
232 233
233 if (result < 0) { 234 if (result < 0) {
234 printk(KERN_ERR "ncpfs: tcp: Send failed: %d\n", result); 235 pr_err("tcp: Send failed: %d\n", result);
235 __ncp_abort_request(server, rq, result); 236 __ncp_abort_request(server, rq, result);
236 return; 237 return;
237 } 238 }
@@ -332,7 +333,7 @@ static int ncp_add_request(struct ncp_server *server, struct ncp_request_reply *
332 mutex_lock(&server->rcv.creq_mutex); 333 mutex_lock(&server->rcv.creq_mutex);
333 if (!ncp_conn_valid(server)) { 334 if (!ncp_conn_valid(server)) {
334 mutex_unlock(&server->rcv.creq_mutex); 335 mutex_unlock(&server->rcv.creq_mutex);
335 printk(KERN_ERR "ncpfs: tcp: Server died\n"); 336 pr_err("tcp: Server died\n");
336 return -EIO; 337 return -EIO;
337 } 338 }
338 ncp_req_get(req); 339 ncp_req_get(req);
@@ -448,7 +449,7 @@ void ncpdgram_rcv_proc(struct work_struct *work)
448 result -= 8; 449 result -= 8;
449 hdrl = sock->sk->sk_family == AF_INET ? 8 : 6; 450 hdrl = sock->sk->sk_family == AF_INET ? 8 : 6;
450 if (sign_verify_reply(server, server->rxbuf + hdrl, result - hdrl, cpu_to_le32(result), server->rxbuf + result)) { 451 if (sign_verify_reply(server, server->rxbuf + hdrl, result - hdrl, cpu_to_le32(result), server->rxbuf + result)) {
451 printk(KERN_INFO "ncpfs: Signature violation\n"); 452 pr_info("Signature violation\n");
452 result = -EIO; 453 result = -EIO;
453 } 454 }
454 } 455 }
@@ -524,7 +525,7 @@ static int do_tcp_rcv(struct ncp_server *server, void *buffer, size_t len)
524 return result; 525 return result;
525 } 526 }
526 if (result > len) { 527 if (result > len) {
527 printk(KERN_ERR "ncpfs: tcp: bug in recvmsg (%u > %Zu)\n", result, len); 528 pr_err("tcp: bug in recvmsg (%u > %Zu)\n", result, len);
528 return -EIO; 529 return -EIO;
529 } 530 }
530 return result; 531 return result;
@@ -552,7 +553,7 @@ static int __ncptcp_rcv_proc(struct ncp_server *server)
552 __ncptcp_abort(server); 553 __ncptcp_abort(server);
553 } 554 }
554 if (result < 0) { 555 if (result < 0) {
555 printk(KERN_ERR "ncpfs: tcp: error in recvmsg: %d\n", result); 556 pr_err("tcp: error in recvmsg: %d\n", result);
556 } else { 557 } else {
557 DPRINTK(KERN_ERR "ncpfs: tcp: EOF\n"); 558 DPRINTK(KERN_ERR "ncpfs: tcp: EOF\n");
558 } 559 }
@@ -566,20 +567,20 @@ static int __ncptcp_rcv_proc(struct ncp_server *server)
566 switch (server->rcv.state) { 567 switch (server->rcv.state) {
567 case 0: 568 case 0:
568 if (server->rcv.buf.magic != htonl(NCP_TCP_RCVD_MAGIC)) { 569 if (server->rcv.buf.magic != htonl(NCP_TCP_RCVD_MAGIC)) {
569 printk(KERN_ERR "ncpfs: tcp: Unexpected reply type %08X\n", ntohl(server->rcv.buf.magic)); 570 pr_err("tcp: Unexpected reply type %08X\n", ntohl(server->rcv.buf.magic));
570 __ncptcp_abort(server); 571 __ncptcp_abort(server);
571 return -EIO; 572 return -EIO;
572 } 573 }
573 datalen = ntohl(server->rcv.buf.len) & 0x0FFFFFFF; 574 datalen = ntohl(server->rcv.buf.len) & 0x0FFFFFFF;
574 if (datalen < 10) { 575 if (datalen < 10) {
575 printk(KERN_ERR "ncpfs: tcp: Unexpected reply len %d\n", datalen); 576 pr_err("tcp: Unexpected reply len %d\n", datalen);
576 __ncptcp_abort(server); 577 __ncptcp_abort(server);
577 return -EIO; 578 return -EIO;
578 } 579 }
579#ifdef CONFIG_NCPFS_PACKET_SIGNING 580#ifdef CONFIG_NCPFS_PACKET_SIGNING
580 if (server->sign_active) { 581 if (server->sign_active) {
581 if (datalen < 18) { 582 if (datalen < 18) {
582 printk(KERN_ERR "ncpfs: tcp: Unexpected reply len %d\n", datalen); 583 pr_err("tcp: Unexpected reply len %d\n", datalen);
583 __ncptcp_abort(server); 584 __ncptcp_abort(server);
584 return -EIO; 585 return -EIO;
585 } 586 }
@@ -618,7 +619,7 @@ skipdata:;
618 goto skipdata2; 619 goto skipdata2;
619 } 620 }
620 if (datalen > req->datalen + 8) { 621 if (datalen > req->datalen + 8) {
621 printk(KERN_ERR "ncpfs: tcp: Unexpected reply len %d (expected at most %Zd)\n", datalen, req->datalen + 8); 622 pr_err("tcp: Unexpected reply len %d (expected at most %Zd)\n", datalen, req->datalen + 8);
622 server->rcv.state = 3; 623 server->rcv.state = 3;
623 goto skipdata; 624 goto skipdata;
624 } 625 }
@@ -638,12 +639,12 @@ skipdata:;
638 req = server->rcv.creq; 639 req = server->rcv.creq;
639 if (req->tx_type != NCP_ALLOC_SLOT_REQUEST) { 640 if (req->tx_type != NCP_ALLOC_SLOT_REQUEST) {
640 if (((struct ncp_reply_header*)server->rxbuf)->sequence != server->sequence) { 641 if (((struct ncp_reply_header*)server->rxbuf)->sequence != server->sequence) {
641 printk(KERN_ERR "ncpfs: tcp: Bad sequence number\n"); 642 pr_err("tcp: Bad sequence number\n");
642 __ncp_abort_request(server, req, -EIO); 643 __ncp_abort_request(server, req, -EIO);
643 return -EIO; 644 return -EIO;
644 } 645 }
645 if ((((struct ncp_reply_header*)server->rxbuf)->conn_low | (((struct ncp_reply_header*)server->rxbuf)->conn_high << 8)) != server->connection) { 646 if ((((struct ncp_reply_header*)server->rxbuf)->conn_low | (((struct ncp_reply_header*)server->rxbuf)->conn_high << 8)) != server->connection) {
646 printk(KERN_ERR "ncpfs: tcp: Connection number mismatch\n"); 647 pr_err("tcp: Connection number mismatch\n");
647 __ncp_abort_request(server, req, -EIO); 648 __ncp_abort_request(server, req, -EIO);
648 return -EIO; 649 return -EIO;
649 } 650 }
@@ -651,7 +652,7 @@ skipdata:;
651#ifdef CONFIG_NCPFS_PACKET_SIGNING 652#ifdef CONFIG_NCPFS_PACKET_SIGNING
652 if (server->sign_active && req->tx_type != NCP_DEALLOC_SLOT_REQUEST) { 653 if (server->sign_active && req->tx_type != NCP_DEALLOC_SLOT_REQUEST) {
653 if (sign_verify_reply(server, server->rxbuf + 6, req->datalen - 6, cpu_to_be32(req->datalen + 16), &server->rcv.buf.type)) { 654 if (sign_verify_reply(server, server->rxbuf + 6, req->datalen - 6, cpu_to_be32(req->datalen + 16), &server->rcv.buf.type)) {
654 printk(KERN_ERR "ncpfs: tcp: Signature violation\n"); 655 pr_err("tcp: Signature violation\n");
655 __ncp_abort_request(server, req, -EIO); 656 __ncp_abort_request(server, req, -EIO);
656 return -EIO; 657 return -EIO;
657 } 658 }
@@ -742,7 +743,7 @@ static int ncp_do_request(struct ncp_server *server, int size,
742 int result; 743 int result;
743 744
744 if (server->lock == 0) { 745 if (server->lock == 0) {
745 printk(KERN_ERR "ncpfs: Server not locked!\n"); 746 pr_err("Server not locked!\n");
746 return -EIO; 747 return -EIO;
747 } 748 }
748 if (!ncp_conn_valid(server)) { 749 if (!ncp_conn_valid(server)) {
@@ -865,14 +866,14 @@ void ncp_lock_server(struct ncp_server *server)
865{ 866{
866 mutex_lock(&server->mutex); 867 mutex_lock(&server->mutex);
867 if (server->lock) 868 if (server->lock)
868 printk(KERN_WARNING "ncp_lock_server: was locked!\n"); 869 pr_warn("%s: was locked!\n", __func__);
869 server->lock = 1; 870 server->lock = 1;
870} 871}
871 872
872void ncp_unlock_server(struct ncp_server *server) 873void ncp_unlock_server(struct ncp_server *server)
873{ 874{
874 if (!server->lock) { 875 if (!server->lock) {
875 printk(KERN_WARNING "ncp_unlock_server: was not locked!\n"); 876 pr_warn("%s: was not locked!\n", __func__);
876 return; 877 return;
877 } 878 }
878 server->lock = 0; 879 server->lock = 0;