diff options
author | Joe Perches <joe@perches.com> | 2014-04-08 19:04:15 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-08 19:48:52 -0400 |
commit | d3b73ca1be3236fc33f896af7e2ba637a677d5c9 (patch) | |
tree | 40cb8fd92cf4c76867a2d01477bd5c2f2e7f42ba /fs/ncpfs | |
parent | b41f8b84d01d32ea618dbbe5679bd07ce3444b88 (diff) |
ncpfs: convert DPRINTK/DDPRINTK to ncp_dbg
Use a more current logging style and enable use of dynamic debugging.
Remove embedded function names, dynamic debug can add this instead.
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/dir.c | 46 | ||||
-rw-r--r-- | fs/ncpfs/file.c | 16 | ||||
-rw-r--r-- | fs/ncpfs/inode.c | 22 | ||||
-rw-r--r-- | fs/ncpfs/ioctl.c | 17 | ||||
-rw-r--r-- | fs/ncpfs/mmap.c | 2 | ||||
-rw-r--r-- | fs/ncpfs/ncp_fs.h | 18 | ||||
-rw-r--r-- | fs/ncpfs/ncplib_kernel.c | 18 | ||||
-rw-r--r-- | fs/ncpfs/sock.c | 16 | ||||
-rw-r--r-- | fs/ncpfs/symlink.c | 2 |
9 files changed, 74 insertions, 83 deletions
diff --git a/fs/ncpfs/dir.c b/fs/ncpfs/dir.c index c320ac52353e..8bfd2c44c2d2 100644 --- a/fs/ncpfs/dir.c +++ b/fs/ncpfs/dir.c | |||
@@ -339,7 +339,7 @@ ncp_lookup_validate(struct dentry *dentry, unsigned int flags) | |||
339 | if (val) | 339 | if (val) |
340 | goto finished; | 340 | goto finished; |
341 | 341 | ||
342 | DDPRINTK("ncp_lookup_validate: %pd2 not valid, age=%ld, server lookup\n", | 342 | ncp_dbg(2, "%pd2 not valid, age=%ld, server lookup\n", |
343 | dentry, NCP_GET_AGE(dentry)); | 343 | dentry, NCP_GET_AGE(dentry)); |
344 | 344 | ||
345 | len = sizeof(__name); | 345 | len = sizeof(__name); |
@@ -358,7 +358,7 @@ ncp_lookup_validate(struct dentry *dentry, unsigned int flags) | |||
358 | res = ncp_obtain_info(server, dir, __name, &(finfo.i)); | 358 | res = ncp_obtain_info(server, dir, __name, &(finfo.i)); |
359 | } | 359 | } |
360 | finfo.volume = finfo.i.volNumber; | 360 | finfo.volume = finfo.i.volNumber; |
361 | DDPRINTK("ncp_lookup_validate: looked for %pd/%s, res=%d\n", | 361 | ncp_dbg(2, "looked for %pd/%s, res=%d\n", |
362 | dentry->d_parent, __name, res); | 362 | dentry->d_parent, __name, res); |
363 | /* | 363 | /* |
364 | * If we didn't find it, or if it has a different dirEntNum to | 364 | * If we didn't find it, or if it has a different dirEntNum to |
@@ -372,14 +372,14 @@ ncp_lookup_validate(struct dentry *dentry, unsigned int flags) | |||
372 | ncp_new_dentry(dentry); | 372 | ncp_new_dentry(dentry); |
373 | val=1; | 373 | val=1; |
374 | } else | 374 | } else |
375 | DDPRINTK("ncp_lookup_validate: found, but dirEntNum changed\n"); | 375 | ncp_dbg(2, "found, but dirEntNum changed\n"); |
376 | 376 | ||
377 | ncp_update_inode2(inode, &finfo); | 377 | ncp_update_inode2(inode, &finfo); |
378 | mutex_unlock(&inode->i_mutex); | 378 | mutex_unlock(&inode->i_mutex); |
379 | } | 379 | } |
380 | 380 | ||
381 | finished: | 381 | finished: |
382 | DDPRINTK("ncp_lookup_validate: result=%d\n", val); | 382 | ncp_dbg(2, "result=%d\n", val); |
383 | dput(parent); | 383 | dput(parent); |
384 | return val; | 384 | return val; |
385 | } | 385 | } |
@@ -453,8 +453,7 @@ static int ncp_readdir(struct file *file, struct dir_context *ctx) | |||
453 | ctl.page = NULL; | 453 | ctl.page = NULL; |
454 | ctl.cache = NULL; | 454 | ctl.cache = NULL; |
455 | 455 | ||
456 | DDPRINTK("ncp_readdir: reading %pD2, pos=%d\n", file, | 456 | ncp_dbg(2, "reading %pD2, pos=%d\n", file, (int)ctx->pos); |
457 | (int) ctx->pos); | ||
458 | 457 | ||
459 | result = -EIO; | 458 | result = -EIO; |
460 | /* Do not generate '.' and '..' when server is dead. */ | 459 | /* Do not generate '.' and '..' when server is dead. */ |
@@ -697,8 +696,7 @@ ncp_read_volume_list(struct file *file, struct dir_context *ctx, | |||
697 | struct ncp_entry_info entry; | 696 | struct ncp_entry_info entry; |
698 | int i; | 697 | int i; |
699 | 698 | ||
700 | DPRINTK("ncp_read_volume_list: pos=%ld\n", | 699 | ncp_dbg(1, "pos=%ld\n", (unsigned long)ctx->pos); |
701 | (unsigned long) ctx->pos); | ||
702 | 700 | ||
703 | for (i = 0; i < NCP_NUMBER_OF_VOLUMES; i++) { | 701 | for (i = 0; i < NCP_NUMBER_OF_VOLUMES; i++) { |
704 | int inval_dentry; | 702 | int inval_dentry; |
@@ -708,12 +706,11 @@ ncp_read_volume_list(struct file *file, struct dir_context *ctx, | |||
708 | if (!strlen(info.volume_name)) | 706 | if (!strlen(info.volume_name)) |
709 | continue; | 707 | continue; |
710 | 708 | ||
711 | DPRINTK("ncp_read_volume_list: found vol: %s\n", | 709 | ncp_dbg(1, "found vol: %s\n", info.volume_name); |
712 | info.volume_name); | ||
713 | 710 | ||
714 | if (ncp_lookup_volume(server, info.volume_name, | 711 | if (ncp_lookup_volume(server, info.volume_name, |
715 | &entry.i)) { | 712 | &entry.i)) { |
716 | DPRINTK("ncpfs: could not lookup vol %s\n", | 713 | ncp_dbg(1, "could not lookup vol %s\n", |
717 | info.volume_name); | 714 | info.volume_name); |
718 | continue; | 715 | continue; |
719 | } | 716 | } |
@@ -738,14 +735,13 @@ ncp_do_readdir(struct file *file, struct dir_context *ctx, | |||
738 | int more; | 735 | int more; |
739 | size_t bufsize; | 736 | size_t bufsize; |
740 | 737 | ||
741 | DPRINTK("ncp_do_readdir: %pD2, fpos=%ld\n", file, | 738 | ncp_dbg(1, "%pD2, fpos=%ld\n", file, (unsigned long)ctx->pos); |
742 | (unsigned long) ctx->pos); | ||
743 | PPRINTK("ncp_do_readdir: init %pD, volnum=%d, dirent=%u\n", | 739 | PPRINTK("ncp_do_readdir: init %pD, volnum=%d, dirent=%u\n", |
744 | file, NCP_FINFO(dir)->volNumber, NCP_FINFO(dir)->dirEntNum); | 740 | file, NCP_FINFO(dir)->volNumber, NCP_FINFO(dir)->dirEntNum); |
745 | 741 | ||
746 | err = ncp_initialize_search(server, dir, &seq); | 742 | err = ncp_initialize_search(server, dir, &seq); |
747 | if (err) { | 743 | if (err) { |
748 | DPRINTK("ncp_do_readdir: init failed, err=%d\n", err); | 744 | ncp_dbg(1, "init failed, err=%d\n", err); |
749 | return; | 745 | return; |
750 | } | 746 | } |
751 | /* We MUST NOT use server->buffer_size handshaked with server if we are | 747 | /* We MUST NOT use server->buffer_size handshaked with server if we are |
@@ -822,10 +818,10 @@ int ncp_conn_logged_in(struct super_block *sb) | |||
822 | NCP_FINFO(ino)->DosDirNum = DosDirNum; | 818 | NCP_FINFO(ino)->DosDirNum = DosDirNum; |
823 | result = 0; | 819 | result = 0; |
824 | } else { | 820 | } else { |
825 | DPRINTK("ncpfs: sb->s_root->d_inode == NULL!\n"); | 821 | ncp_dbg(1, "sb->s_root->d_inode == NULL!\n"); |
826 | } | 822 | } |
827 | } else { | 823 | } else { |
828 | DPRINTK("ncpfs: sb->s_root == NULL!\n"); | 824 | ncp_dbg(1, "sb->s_root == NULL!\n"); |
829 | } | 825 | } |
830 | } else | 826 | } else |
831 | result = 0; | 827 | result = 0; |
@@ -952,7 +948,7 @@ int ncp_create_new(struct inode *dir, struct dentry *dentry, umode_t mode, | |||
952 | error = -ENAMETOOLONG; | 948 | error = -ENAMETOOLONG; |
953 | else if (result < 0) | 949 | else if (result < 0) |
954 | error = result; | 950 | error = result; |
955 | DPRINTK("ncp_create: %pd2 failed\n", dentry); | 951 | ncp_dbg(1, "%pd2 failed\n", dentry); |
956 | goto out; | 952 | goto out; |
957 | } | 953 | } |
958 | opmode = O_WRONLY; | 954 | opmode = O_WRONLY; |
@@ -985,7 +981,7 @@ static int ncp_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) | |||
985 | int error, len; | 981 | int error, len; |
986 | __u8 __name[NCP_MAXPATHLEN + 1]; | 982 | __u8 __name[NCP_MAXPATHLEN + 1]; |
987 | 983 | ||
988 | DPRINTK("ncp_mkdir: making %pd2\n", dentry); | 984 | ncp_dbg(1, "making %pd2\n", dentry); |
989 | 985 | ||
990 | ncp_age_dentry(server, dentry); | 986 | ncp_age_dentry(server, dentry); |
991 | len = sizeof(__name); | 987 | len = sizeof(__name); |
@@ -1022,7 +1018,7 @@ static int ncp_rmdir(struct inode *dir, struct dentry *dentry) | |||
1022 | int error, result, len; | 1018 | int error, result, len; |
1023 | __u8 __name[NCP_MAXPATHLEN + 1]; | 1019 | __u8 __name[NCP_MAXPATHLEN + 1]; |
1024 | 1020 | ||
1025 | DPRINTK("ncp_rmdir: removing %pd2\n", dentry); | 1021 | ncp_dbg(1, "removing %pd2\n", dentry); |
1026 | 1022 | ||
1027 | len = sizeof(__name); | 1023 | len = sizeof(__name); |
1028 | error = ncp_io2vol(server, __name, &len, dentry->d_name.name, | 1024 | error = ncp_io2vol(server, __name, &len, dentry->d_name.name, |
@@ -1067,7 +1063,7 @@ static int ncp_unlink(struct inode *dir, struct dentry *dentry) | |||
1067 | int error; | 1063 | int error; |
1068 | 1064 | ||
1069 | server = NCP_SERVER(dir); | 1065 | server = NCP_SERVER(dir); |
1070 | DPRINTK("ncp_unlink: unlinking %pd2\n", dentry); | 1066 | ncp_dbg(1, "unlinking %pd2\n", dentry); |
1071 | 1067 | ||
1072 | /* | 1068 | /* |
1073 | * Check whether to close the file ... | 1069 | * Check whether to close the file ... |
@@ -1087,7 +1083,7 @@ static int ncp_unlink(struct inode *dir, struct dentry *dentry) | |||
1087 | #endif | 1083 | #endif |
1088 | switch (error) { | 1084 | switch (error) { |
1089 | case 0x00: | 1085 | case 0x00: |
1090 | DPRINTK("ncp: removed %pd2\n", dentry); | 1086 | ncp_dbg(1, "removed %pd2\n", dentry); |
1091 | break; | 1087 | break; |
1092 | case 0x85: | 1088 | case 0x85: |
1093 | case 0x8A: | 1089 | case 0x8A: |
@@ -1120,7 +1116,7 @@ static int ncp_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
1120 | int old_len, new_len; | 1116 | int old_len, new_len; |
1121 | __u8 __old_name[NCP_MAXPATHLEN + 1], __new_name[NCP_MAXPATHLEN + 1]; | 1117 | __u8 __old_name[NCP_MAXPATHLEN + 1], __new_name[NCP_MAXPATHLEN + 1]; |
1122 | 1118 | ||
1123 | DPRINTK("ncp_rename: %pd2 to %pd2\n", old_dentry, new_dentry); | 1119 | ncp_dbg(1, "%pd2 to %pd2\n", old_dentry, new_dentry); |
1124 | 1120 | ||
1125 | ncp_age_dentry(server, old_dentry); | 1121 | ncp_age_dentry(server, old_dentry); |
1126 | ncp_age_dentry(server, new_dentry); | 1122 | ncp_age_dentry(server, new_dentry); |
@@ -1150,8 +1146,8 @@ static int ncp_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
1150 | #endif | 1146 | #endif |
1151 | switch (error) { | 1147 | switch (error) { |
1152 | case 0x00: | 1148 | case 0x00: |
1153 | DPRINTK("ncp renamed %pd -> %pd.\n", | 1149 | ncp_dbg(1, "renamed %pd -> %pd\n", |
1154 | old_dentry, new_dentry); | 1150 | old_dentry, new_dentry); |
1155 | break; | 1151 | break; |
1156 | case 0x9E: | 1152 | case 0x9E: |
1157 | error = -ENAMETOOLONG; | 1153 | error = -ENAMETOOLONG; |
@@ -1173,7 +1169,7 @@ static int ncp_mknod(struct inode * dir, struct dentry *dentry, | |||
1173 | if (!new_valid_dev(rdev)) | 1169 | if (!new_valid_dev(rdev)) |
1174 | return -EINVAL; | 1170 | return -EINVAL; |
1175 | if (ncp_is_nfs_extras(NCP_SERVER(dir), NCP_FINFO(dir)->volNumber)) { | 1171 | if (ncp_is_nfs_extras(NCP_SERVER(dir), NCP_FINFO(dir)->volNumber)) { |
1176 | DPRINTK(KERN_DEBUG "ncp_mknod: mode = 0%ho\n", mode); | 1172 | ncp_dbg(1, "mode = 0%ho\n", mode); |
1177 | return ncp_create_new(dir, dentry, mode, rdev, 0); | 1173 | return ncp_create_new(dir, dentry, mode, rdev, 0); |
1178 | } | 1174 | } |
1179 | return -EPERM; /* Strange, but true */ | 1175 | return -EPERM; /* Strange, but true */ |
diff --git a/fs/ncpfs/file.c b/fs/ncpfs/file.c index 93f319101fde..4cb02fdc2684 100644 --- a/fs/ncpfs/file.c +++ b/fs/ncpfs/file.c | |||
@@ -40,7 +40,7 @@ int ncp_make_open(struct inode *inode, int right) | |||
40 | goto out; | 40 | goto out; |
41 | } | 41 | } |
42 | 42 | ||
43 | DPRINTK("ncp_make_open: opened=%d, volume # %u, dir entry # %u\n", | 43 | ncp_dbg(1, "opened=%d, volume # %u, dir entry # %u\n", |
44 | atomic_read(&NCP_FINFO(inode)->opened), | 44 | atomic_read(&NCP_FINFO(inode)->opened), |
45 | NCP_FINFO(inode)->volNumber, | 45 | NCP_FINFO(inode)->volNumber, |
46 | NCP_FINFO(inode)->dirEntNum); | 46 | NCP_FINFO(inode)->dirEntNum); |
@@ -109,7 +109,7 @@ ncp_file_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) | |||
109 | void* freepage; | 109 | void* freepage; |
110 | size_t freelen; | 110 | size_t freelen; |
111 | 111 | ||
112 | DPRINTK("ncp_file_read: enter %pd2\n", dentry); | 112 | ncp_dbg(1, "enter %pd2\n", dentry); |
113 | 113 | ||
114 | pos = *ppos; | 114 | pos = *ppos; |
115 | 115 | ||
@@ -126,7 +126,7 @@ ncp_file_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) | |||
126 | 126 | ||
127 | error = ncp_make_open(inode, O_RDONLY); | 127 | error = ncp_make_open(inode, O_RDONLY); |
128 | if (error) { | 128 | if (error) { |
129 | DPRINTK(KERN_ERR "ncp_file_read: open failed, error=%d\n", error); | 129 | ncp_dbg(1, "open failed, error=%d\n", error); |
130 | return error; | 130 | return error; |
131 | } | 131 | } |
132 | 132 | ||
@@ -167,7 +167,7 @@ ncp_file_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) | |||
167 | 167 | ||
168 | file_accessed(file); | 168 | file_accessed(file); |
169 | 169 | ||
170 | DPRINTK("ncp_file_read: exit %pd2\n", dentry); | 170 | ncp_dbg(1, "exit %pd2\n", dentry); |
171 | outrel: | 171 | outrel: |
172 | ncp_inode_close(inode); | 172 | ncp_inode_close(inode); |
173 | return already_read ? already_read : error; | 173 | return already_read ? already_read : error; |
@@ -184,7 +184,7 @@ ncp_file_write(struct file *file, const char __user *buf, size_t count, loff_t * | |||
184 | int errno; | 184 | int errno; |
185 | void* bouncebuffer; | 185 | void* bouncebuffer; |
186 | 186 | ||
187 | DPRINTK("ncp_file_write: enter %pd2\n", dentry); | 187 | ncp_dbg(1, "enter %pd2\n", dentry); |
188 | if ((ssize_t) count < 0) | 188 | if ((ssize_t) count < 0) |
189 | return -EINVAL; | 189 | return -EINVAL; |
190 | pos = *ppos; | 190 | pos = *ppos; |
@@ -213,7 +213,7 @@ ncp_file_write(struct file *file, const char __user *buf, size_t count, loff_t * | |||
213 | return 0; | 213 | return 0; |
214 | errno = ncp_make_open(inode, O_WRONLY); | 214 | errno = ncp_make_open(inode, O_WRONLY); |
215 | if (errno) { | 215 | if (errno) { |
216 | DPRINTK(KERN_ERR "ncp_file_write: open failed, error=%d\n", errno); | 216 | ncp_dbg(1, "open failed, error=%d\n", errno); |
217 | return errno; | 217 | return errno; |
218 | } | 218 | } |
219 | bufsize = NCP_SERVER(inode)->buffer_size; | 219 | bufsize = NCP_SERVER(inode)->buffer_size; |
@@ -263,7 +263,7 @@ ncp_file_write(struct file *file, const char __user *buf, size_t count, loff_t * | |||
263 | i_size_write(inode, pos); | 263 | i_size_write(inode, pos); |
264 | mutex_unlock(&inode->i_mutex); | 264 | mutex_unlock(&inode->i_mutex); |
265 | } | 265 | } |
266 | DPRINTK("ncp_file_write: exit %pd2\n", dentry); | 266 | ncp_dbg(1, "exit %pd2\n", dentry); |
267 | outrel: | 267 | outrel: |
268 | ncp_inode_close(inode); | 268 | ncp_inode_close(inode); |
269 | return already_written ? already_written : errno; | 269 | return already_written ? already_written : errno; |
@@ -271,7 +271,7 @@ outrel: | |||
271 | 271 | ||
272 | static int ncp_release(struct inode *inode, struct file *file) { | 272 | static int ncp_release(struct inode *inode, struct file *file) { |
273 | if (ncp_make_closed(inode)) { | 273 | if (ncp_make_closed(inode)) { |
274 | DPRINTK("ncp_release: failed to close\n"); | 274 | ncp_dbg(1, "failed to close\n"); |
275 | } | 275 | } |
276 | return 0; | 276 | return 0; |
277 | } | 277 | } |
diff --git a/fs/ncpfs/inode.c b/fs/ncpfs/inode.c index 3277fc132959..f4c5bbafd73f 100644 --- a/fs/ncpfs/inode.c +++ b/fs/ncpfs/inode.c | |||
@@ -135,7 +135,7 @@ void ncp_update_inode(struct inode *inode, struct ncp_entry_info *nwinfo) | |||
135 | NCP_FINFO(inode)->access = nwinfo->access; | 135 | NCP_FINFO(inode)->access = nwinfo->access; |
136 | memcpy(NCP_FINFO(inode)->file_handle, nwinfo->file_handle, | 136 | memcpy(NCP_FINFO(inode)->file_handle, nwinfo->file_handle, |
137 | sizeof(nwinfo->file_handle)); | 137 | sizeof(nwinfo->file_handle)); |
138 | DPRINTK("ncp_update_inode: updated %s, volnum=%d, dirent=%u\n", | 138 | ncp_dbg(1, "updated %s, volnum=%d, dirent=%u\n", |
139 | nwinfo->i.entryName, NCP_FINFO(inode)->volNumber, | 139 | nwinfo->i.entryName, NCP_FINFO(inode)->volNumber, |
140 | NCP_FINFO(inode)->dirEntNum); | 140 | NCP_FINFO(inode)->dirEntNum); |
141 | } | 141 | } |
@@ -143,8 +143,7 @@ void ncp_update_inode(struct inode *inode, struct ncp_entry_info *nwinfo) | |||
143 | static void ncp_update_dates(struct inode *inode, struct nw_info_struct *nwi) | 143 | static void ncp_update_dates(struct inode *inode, struct nw_info_struct *nwi) |
144 | { | 144 | { |
145 | /* NFS namespace mode overrides others if it's set. */ | 145 | /* NFS namespace mode overrides others if it's set. */ |
146 | DPRINTK(KERN_DEBUG "ncp_update_dates_and_mode: (%s) nfs.mode=0%o\n", | 146 | ncp_dbg(1, "(%s) nfs.mode=0%o\n", nwi->entryName, nwi->nfs.mode); |
147 | nwi->entryName, nwi->nfs.mode); | ||
148 | if (nwi->nfs.mode) { | 147 | if (nwi->nfs.mode) { |
149 | /* XXX Security? */ | 148 | /* XXX Security? */ |
150 | inode->i_mode = nwi->nfs.mode; | 149 | inode->i_mode = nwi->nfs.mode; |
@@ -232,7 +231,7 @@ static void ncp_set_attr(struct inode *inode, struct ncp_entry_info *nwinfo) | |||
232 | 231 | ||
233 | ncp_update_attrs(inode, nwinfo); | 232 | ncp_update_attrs(inode, nwinfo); |
234 | 233 | ||
235 | DDPRINTK("ncp_read_inode: inode->i_mode = %u\n", inode->i_mode); | 234 | ncp_dbg(2, "inode->i_mode = %u\n", inode->i_mode); |
236 | 235 | ||
237 | set_nlink(inode, 1); | 236 | set_nlink(inode, 1); |
238 | inode->i_uid = server->m.uid; | 237 | inode->i_uid = server->m.uid; |
@@ -303,7 +302,7 @@ ncp_evict_inode(struct inode *inode) | |||
303 | clear_inode(inode); | 302 | clear_inode(inode); |
304 | 303 | ||
305 | if (S_ISDIR(inode->i_mode)) { | 304 | if (S_ISDIR(inode->i_mode)) { |
306 | DDPRINTK("ncp_evict_inode: put directory %ld\n", inode->i_ino); | 305 | ncp_dbg(2, "put directory %ld\n", inode->i_ino); |
307 | } | 306 | } |
308 | 307 | ||
309 | if (ncp_make_closed(inode) != 0) { | 308 | if (ncp_make_closed(inode) != 0) { |
@@ -684,7 +683,7 @@ static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent) | |||
684 | ncp_unlock_server(server); | 683 | ncp_unlock_server(server); |
685 | if (error < 0) | 684 | if (error < 0) |
686 | goto out_rxbuf; | 685 | goto out_rxbuf; |
687 | DPRINTK("ncp_fill_super: NCP_SBP(sb) = %x\n", (int) NCP_SBP(sb)); | 686 | ncp_dbg(1, "NCP_SBP(sb) = %x\n", (int) NCP_SBP(sb)); |
688 | 687 | ||
689 | error = -EMSGSIZE; /* -EREMOTESIDEINCOMPATIBLE */ | 688 | error = -EMSGSIZE; /* -EREMOTESIDEINCOMPATIBLE */ |
690 | #ifdef CONFIG_NCPFS_PACKET_SIGNING | 689 | #ifdef CONFIG_NCPFS_PACKET_SIGNING |
@@ -712,7 +711,7 @@ static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent) | |||
712 | if (ncp_negotiate_buffersize(server, default_bufsize, | 711 | if (ncp_negotiate_buffersize(server, default_bufsize, |
713 | &(server->buffer_size)) != 0) | 712 | &(server->buffer_size)) != 0) |
714 | goto out_disconnect; | 713 | goto out_disconnect; |
715 | DPRINTK("ncpfs: bufsize = %d\n", server->buffer_size); | 714 | ncp_dbg(1, "bufsize = %d\n", server->buffer_size); |
716 | 715 | ||
717 | memset(&finfo, 0, sizeof(finfo)); | 716 | memset(&finfo, 0, sizeof(finfo)); |
718 | finfo.i.attributes = aDIR; | 717 | finfo.i.attributes = aDIR; |
@@ -741,7 +740,7 @@ static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent) | |||
741 | root_inode = ncp_iget(sb, &finfo); | 740 | root_inode = ncp_iget(sb, &finfo); |
742 | if (!root_inode) | 741 | if (!root_inode) |
743 | goto out_disconnect; | 742 | goto out_disconnect; |
744 | DPRINTK("ncp_fill_super: root vol=%d\n", NCP_FINFO(root_inode)->volNumber); | 743 | ncp_dbg(1, "root vol=%d\n", NCP_FINFO(root_inode)->volNumber); |
745 | sb->s_root = d_make_root(root_inode); | 744 | sb->s_root = d_make_root(root_inode); |
746 | if (!sb->s_root) | 745 | if (!sb->s_root) |
747 | goto out_disconnect; | 746 | goto out_disconnect; |
@@ -987,8 +986,7 @@ int ncp_notify_change(struct dentry *dentry, struct iattr *attr) | |||
987 | if ((attr->ia_valid & ATTR_SIZE) != 0) { | 986 | if ((attr->ia_valid & ATTR_SIZE) != 0) { |
988 | int written; | 987 | int written; |
989 | 988 | ||
990 | DPRINTK("ncpfs: trying to change size to %ld\n", | 989 | ncp_dbg(1, "trying to change size to %ld\n", attr->ia_size); |
991 | attr->ia_size); | ||
992 | 990 | ||
993 | if ((result = ncp_make_open(inode, O_WRONLY)) < 0) { | 991 | if ((result = ncp_make_open(inode, O_WRONLY)) < 0) { |
994 | result = -EACCES; | 992 | result = -EACCES; |
@@ -1074,7 +1072,7 @@ MODULE_ALIAS_FS("ncpfs"); | |||
1074 | static int __init init_ncp_fs(void) | 1072 | static int __init init_ncp_fs(void) |
1075 | { | 1073 | { |
1076 | int err; | 1074 | int err; |
1077 | DPRINTK("ncpfs: init_ncp_fs called\n"); | 1075 | ncp_dbg(1, "called\n"); |
1078 | 1076 | ||
1079 | err = init_inodecache(); | 1077 | err = init_inodecache(); |
1080 | if (err) | 1078 | if (err) |
@@ -1091,7 +1089,7 @@ out1: | |||
1091 | 1089 | ||
1092 | static void __exit exit_ncp_fs(void) | 1090 | static void __exit exit_ncp_fs(void) |
1093 | { | 1091 | { |
1094 | DPRINTK("ncpfs: exit_ncp_fs called\n"); | 1092 | ncp_dbg(1, "called\n"); |
1095 | unregister_filesystem(&ncp_fs_type); | 1093 | unregister_filesystem(&ncp_fs_type); |
1096 | destroy_inodecache(); | 1094 | destroy_inodecache(); |
1097 | } | 1095 | } |
diff --git a/fs/ncpfs/ioctl.c b/fs/ncpfs/ioctl.c index 60426ccb3b65..d5659d96ee7f 100644 --- a/fs/ncpfs/ioctl.c +++ b/fs/ncpfs/ioctl.c | |||
@@ -41,7 +41,7 @@ ncp_get_fs_info(struct ncp_server * server, struct inode *inode, | |||
41 | return -EFAULT; | 41 | return -EFAULT; |
42 | 42 | ||
43 | if (info.version != NCP_GET_FS_INFO_VERSION) { | 43 | if (info.version != NCP_GET_FS_INFO_VERSION) { |
44 | DPRINTK("info.version invalid: %d\n", info.version); | 44 | ncp_dbg(1, "info.version invalid: %d\n", info.version); |
45 | return -EINVAL; | 45 | return -EINVAL; |
46 | } | 46 | } |
47 | /* TODO: info.addr = server->m.serv_addr; */ | 47 | /* TODO: info.addr = server->m.serv_addr; */ |
@@ -66,7 +66,7 @@ ncp_get_fs_info_v2(struct ncp_server * server, struct inode *inode, | |||
66 | return -EFAULT; | 66 | return -EFAULT; |
67 | 67 | ||
68 | if (info2.version != NCP_GET_FS_INFO_VERSION_V2) { | 68 | if (info2.version != NCP_GET_FS_INFO_VERSION_V2) { |
69 | DPRINTK("info.version invalid: %d\n", info2.version); | 69 | ncp_dbg(1, "info.version invalid: %d\n", info2.version); |
70 | return -EINVAL; | 70 | return -EINVAL; |
71 | } | 71 | } |
72 | info2.mounted_uid = from_kuid_munged(current_user_ns(), server->m.mounted_uid); | 72 | info2.mounted_uid = from_kuid_munged(current_user_ns(), server->m.mounted_uid); |
@@ -132,7 +132,7 @@ ncp_get_compat_fs_info_v2(struct ncp_server * server, struct inode *inode, | |||
132 | return -EFAULT; | 132 | return -EFAULT; |
133 | 133 | ||
134 | if (info2.version != NCP_GET_FS_INFO_VERSION_V2) { | 134 | if (info2.version != NCP_GET_FS_INFO_VERSION_V2) { |
135 | DPRINTK("info.version invalid: %d\n", info2.version); | 135 | ncp_dbg(1, "info.version invalid: %d\n", info2.version); |
136 | return -EINVAL; | 136 | return -EINVAL; |
137 | } | 137 | } |
138 | info2.mounted_uid = from_kuid_munged(current_user_ns(), server->m.mounted_uid); | 138 | info2.mounted_uid = from_kuid_munged(current_user_ns(), server->m.mounted_uid); |
@@ -308,8 +308,7 @@ static long __ncp_ioctl(struct inode *inode, unsigned int cmd, unsigned long arg | |||
308 | else | 308 | else |
309 | result = server->reply_size; | 309 | result = server->reply_size; |
310 | ncp_unlock_server(server); | 310 | ncp_unlock_server(server); |
311 | DPRINTK("ncp_ioctl: copy %d bytes\n", | 311 | ncp_dbg(1, "copy %d bytes\n", result); |
312 | result); | ||
313 | if (result >= 0) | 312 | if (result >= 0) |
314 | if (copy_to_user(request.data, bouncebuffer, result)) | 313 | if (copy_to_user(request.data, bouncebuffer, result)) |
315 | result = -EFAULT; | 314 | result = -EFAULT; |
@@ -385,9 +384,9 @@ static long __ncp_ioctl(struct inode *inode, unsigned int cmd, unsigned long arg | |||
385 | sr.namespace = server->name_space[sr.volNumber]; | 384 | sr.namespace = server->name_space[sr.volNumber]; |
386 | result = 0; | 385 | result = 0; |
387 | } else | 386 | } else |
388 | DPRINTK("ncpfs: s_root->d_inode==NULL\n"); | 387 | ncp_dbg(1, "s_root->d_inode==NULL\n"); |
389 | } else | 388 | } else |
390 | DPRINTK("ncpfs: s_root==NULL\n"); | 389 | ncp_dbg(1, "s_root==NULL\n"); |
391 | } else { | 390 | } else { |
392 | sr.volNumber = -1; | 391 | sr.volNumber = -1; |
393 | sr.namespace = 0; | 392 | sr.namespace = 0; |
@@ -440,11 +439,11 @@ static long __ncp_ioctl(struct inode *inode, unsigned int cmd, unsigned long arg | |||
440 | NCP_FINFO(s_inode)->DosDirNum = dosde; | 439 | NCP_FINFO(s_inode)->DosDirNum = dosde; |
441 | server->root_setuped = 1; | 440 | server->root_setuped = 1; |
442 | } else { | 441 | } else { |
443 | DPRINTK("ncpfs: s_root->d_inode==NULL\n"); | 442 | ncp_dbg(1, "s_root->d_inode==NULL\n"); |
444 | result = -EIO; | 443 | result = -EIO; |
445 | } | 444 | } |
446 | } else { | 445 | } else { |
447 | DPRINTK("ncpfs: s_root==NULL\n"); | 446 | ncp_dbg(1, "s_root==NULL\n"); |
448 | result = -EIO; | 447 | result = -EIO; |
449 | } | 448 | } |
450 | } | 449 | } |
diff --git a/fs/ncpfs/mmap.c b/fs/ncpfs/mmap.c index 3c5dd55d284c..b359d12eb359 100644 --- a/fs/ncpfs/mmap.c +++ b/fs/ncpfs/mmap.c | |||
@@ -107,7 +107,7 @@ int ncp_mmap(struct file *file, struct vm_area_struct *vma) | |||
107 | { | 107 | { |
108 | struct inode *inode = file_inode(file); | 108 | struct inode *inode = file_inode(file); |
109 | 109 | ||
110 | DPRINTK("ncp_mmap: called\n"); | 110 | ncp_dbg(1, "called\n"); |
111 | 111 | ||
112 | if (!ncp_conn_valid(NCP_SERVER(inode))) | 112 | if (!ncp_conn_valid(NCP_SERVER(inode))) |
113 | return -EIO; | 113 | return -EIO; |
diff --git a/fs/ncpfs/ncp_fs.h b/fs/ncpfs/ncp_fs.h index 31831afe1c3b..b54ad123b9d4 100644 --- a/fs/ncpfs/ncp_fs.h +++ b/fs/ncpfs/ncp_fs.h | |||
@@ -15,17 +15,17 @@ | |||
15 | #ifndef DEBUG_NCP | 15 | #ifndef DEBUG_NCP |
16 | #define DEBUG_NCP 0 | 16 | #define DEBUG_NCP 0 |
17 | #endif | 17 | #endif |
18 | #if DEBUG_NCP > 0 | 18 | |
19 | #define DPRINTK(format, args...) PRINTK(format , ## args) | 19 | #if DEBUG_NCP > 0 && !defined(DEBUG) |
20 | #else | 20 | #define DEBUG |
21 | #define DPRINTK(format, args...) | ||
22 | #endif | ||
23 | #if DEBUG_NCP > 1 | ||
24 | #define DDPRINTK(format, args...) PRINTK(format , ## args) | ||
25 | #else | ||
26 | #define DDPRINTK(format, args...) | ||
27 | #endif | 21 | #endif |
28 | 22 | ||
23 | #define ncp_dbg(level, fmt, ...) \ | ||
24 | do { \ | ||
25 | if (level <= DEBUG_NCP) \ | ||
26 | pr_debug(fmt, ##__VA_ARGS__); \ | ||
27 | } while (0) | ||
28 | |||
29 | #define NCP_MAX_RPC_TIMEOUT (6*HZ) | 29 | #define NCP_MAX_RPC_TIMEOUT (6*HZ) |
30 | 30 | ||
31 | 31 | ||
diff --git a/fs/ncpfs/ncplib_kernel.c b/fs/ncpfs/ncplib_kernel.c index 827c1180cba6..29388550a2d8 100644 --- a/fs/ncpfs/ncplib_kernel.c +++ b/fs/ncpfs/ncplib_kernel.c | |||
@@ -16,7 +16,7 @@ | |||
16 | static inline void assert_server_locked(struct ncp_server *server) | 16 | static inline void assert_server_locked(struct ncp_server *server) |
17 | { | 17 | { |
18 | if (server->lock == 0) { | 18 | if (server->lock == 0) { |
19 | DPRINTK("ncpfs: server not locked!\n"); | 19 | ncp_dbg(1, "server not locked!\n"); |
20 | } | 20 | } |
21 | } | 21 | } |
22 | 22 | ||
@@ -75,7 +75,7 @@ static void ncp_add_pstring(struct ncp_server *server, const char *s) | |||
75 | int len = strlen(s); | 75 | int len = strlen(s); |
76 | assert_server_locked(server); | 76 | assert_server_locked(server); |
77 | if (len > 255) { | 77 | if (len > 255) { |
78 | DPRINTK("ncpfs: string too long: %s\n", s); | 78 | ncp_dbg(1, "string too long: %s\n", s); |
79 | len = 255; | 79 | len = 255; |
80 | } | 80 | } |
81 | ncp_add_byte(server, len); | 81 | ncp_add_byte(server, len); |
@@ -225,7 +225,7 @@ int ncp_get_volume_info_with_number(struct ncp_server* server, | |||
225 | result = -EIO; | 225 | result = -EIO; |
226 | len = ncp_reply_byte(server, 29); | 226 | len = ncp_reply_byte(server, 29); |
227 | if (len > NCP_VOLNAME_LEN) { | 227 | if (len > NCP_VOLNAME_LEN) { |
228 | DPRINTK("ncpfs: volume name too long: %d\n", len); | 228 | ncp_dbg(1, "volume name too long: %d\n", len); |
229 | goto out; | 229 | goto out; |
230 | } | 230 | } |
231 | memcpy(&(target->volume_name), ncp_reply_data(server, 30), len); | 231 | memcpy(&(target->volume_name), ncp_reply_data(server, 30), len); |
@@ -259,7 +259,7 @@ int ncp_get_directory_info(struct ncp_server* server, __u8 n, | |||
259 | result = -EIO; | 259 | result = -EIO; |
260 | len = ncp_reply_byte(server, 21); | 260 | len = ncp_reply_byte(server, 21); |
261 | if (len > NCP_VOLNAME_LEN) { | 261 | if (len > NCP_VOLNAME_LEN) { |
262 | DPRINTK("ncpfs: volume name too long: %d\n", len); | 262 | ncp_dbg(1, "volume name too long: %d\n", len); |
263 | goto out; | 263 | goto out; |
264 | } | 264 | } |
265 | memcpy(&(target->volume_name), ncp_reply_data(server, 22), len); | 265 | memcpy(&(target->volume_name), ncp_reply_data(server, 22), len); |
@@ -394,8 +394,7 @@ int ncp_obtain_nfs_info(struct ncp_server *server, | |||
394 | 394 | ||
395 | if ((result = ncp_request(server, 87)) == 0) { | 395 | if ((result = ncp_request(server, 87)) == 0) { |
396 | ncp_extract_nfs_info(ncp_reply_data(server, 0), &target->nfs); | 396 | ncp_extract_nfs_info(ncp_reply_data(server, 0), &target->nfs); |
397 | DPRINTK(KERN_DEBUG | 397 | ncp_dbg(1, "(%s) mode=0%o, rdev=0x%x\n", |
398 | "ncp_obtain_nfs_info: (%s) mode=0%o, rdev=0x%x\n", | ||
399 | target->entryName, target->nfs.mode, | 398 | target->entryName, target->nfs.mode, |
400 | target->nfs.rdev); | 399 | target->nfs.rdev); |
401 | } else { | 400 | } else { |
@@ -498,7 +497,7 @@ ncp_get_known_namespace(struct ncp_server *server, __u8 volume) | |||
498 | namespace = ncp_reply_data(server, 2); | 497 | namespace = ncp_reply_data(server, 2); |
499 | 498 | ||
500 | while (no_namespaces > 0) { | 499 | while (no_namespaces > 0) { |
501 | DPRINTK("get_namespaces: found %d on %d\n", *namespace, volume); | 500 | ncp_dbg(1, "found %d on %d\n", *namespace, volume); |
502 | 501 | ||
503 | #ifdef CONFIG_NCPFS_NFS_NS | 502 | #ifdef CONFIG_NCPFS_NFS_NS |
504 | if ((*namespace == NW_NS_NFS) && !(server->m.flags&NCP_MOUNT_NO_NFS)) | 503 | if ((*namespace == NW_NS_NFS) && !(server->m.flags&NCP_MOUNT_NO_NFS)) |
@@ -531,8 +530,7 @@ ncp_update_known_namespace(struct ncp_server *server, __u8 volume, int *ret_ns) | |||
531 | if (ret_ns) | 530 | if (ret_ns) |
532 | *ret_ns = ns; | 531 | *ret_ns = ns; |
533 | 532 | ||
534 | DPRINTK("lookup_vol: namespace[%d] = %d\n", | 533 | ncp_dbg(1, "namespace[%d] = %d\n", volume, server->name_space[volume]); |
535 | volume, server->name_space[volume]); | ||
536 | 534 | ||
537 | if (server->name_space[volume] == ns) | 535 | if (server->name_space[volume] == ns) |
538 | return 0; | 536 | return 0; |
@@ -596,7 +594,7 @@ ncp_get_volume_root(struct ncp_server *server, | |||
596 | { | 594 | { |
597 | int result; | 595 | int result; |
598 | 596 | ||
599 | DPRINTK("ncp_get_volume_root: looking up vol %s\n", volname); | 597 | ncp_dbg(1, "looking up vol %s\n", volname); |
600 | 598 | ||
601 | ncp_init_request(server); | 599 | ncp_init_request(server); |
602 | ncp_add_byte(server, 22); /* Subfunction: Generate dir handle */ | 600 | ncp_add_byte(server, 22); /* Subfunction: Generate dir handle */ |
diff --git a/fs/ncpfs/sock.c b/fs/ncpfs/sock.c index 6390d7b91b7f..3dd731bfd340 100644 --- a/fs/ncpfs/sock.c +++ b/fs/ncpfs/sock.c | |||
@@ -406,15 +406,15 @@ void ncpdgram_rcv_proc(struct work_struct *work) | |||
406 | } | 406 | } |
407 | result = _recv(sock, buf, sizeof(buf), MSG_DONTWAIT); | 407 | result = _recv(sock, buf, sizeof(buf), MSG_DONTWAIT); |
408 | if (result < 0) { | 408 | if (result < 0) { |
409 | DPRINTK("recv failed with %d\n", result); | 409 | ncp_dbg(1, "recv failed with %d\n", result); |
410 | continue; | 410 | continue; |
411 | } | 411 | } |
412 | if (result < 10) { | 412 | if (result < 10) { |
413 | DPRINTK("too short (%u) watchdog packet\n", result); | 413 | ncp_dbg(1, "too short (%u) watchdog packet\n", result); |
414 | continue; | 414 | continue; |
415 | } | 415 | } |
416 | if (buf[9] != '?') { | 416 | if (buf[9] != '?') { |
417 | DPRINTK("bad signature (%02X) in watchdog packet\n", buf[9]); | 417 | ncp_dbg(1, "bad signature (%02X) in watchdog packet\n", buf[9]); |
418 | continue; | 418 | continue; |
419 | } | 419 | } |
420 | buf[9] = 'Y'; | 420 | buf[9] = 'Y'; |
@@ -555,7 +555,7 @@ static int __ncptcp_rcv_proc(struct ncp_server *server) | |||
555 | if (result < 0) { | 555 | if (result < 0) { |
556 | pr_err("tcp: error in recvmsg: %d\n", result); | 556 | pr_err("tcp: error in recvmsg: %d\n", result); |
557 | } else { | 557 | } else { |
558 | DPRINTK(KERN_ERR "ncpfs: tcp: EOF\n"); | 558 | ncp_dbg(1, "tcp: EOF\n"); |
559 | } | 559 | } |
560 | return -EIO; | 560 | return -EIO; |
561 | } | 561 | } |
@@ -605,7 +605,7 @@ cont:; | |||
605 | server->rcv.len = datalen - 10; | 605 | server->rcv.len = datalen - 10; |
606 | break; | 606 | break; |
607 | } | 607 | } |
608 | DPRINTK("ncpfs: tcp: Unexpected NCP type %02X\n", type); | 608 | ncp_dbg(1, "tcp: Unexpected NCP type %02X\n", type); |
609 | skipdata2:; | 609 | skipdata2:; |
610 | server->rcv.state = 2; | 610 | server->rcv.state = 2; |
611 | skipdata:; | 611 | skipdata:; |
@@ -615,7 +615,7 @@ skipdata:; | |||
615 | } | 615 | } |
616 | req = server->rcv.creq; | 616 | req = server->rcv.creq; |
617 | if (!req) { | 617 | if (!req) { |
618 | DPRINTK(KERN_ERR "ncpfs: Reply without appropriate request\n"); | 618 | ncp_dbg(1, "Reply without appropriate request\n"); |
619 | goto skipdata2; | 619 | goto skipdata2; |
620 | } | 620 | } |
621 | if (datalen > req->datalen + 8) { | 621 | if (datalen > req->datalen + 8) { |
@@ -782,7 +782,7 @@ static int ncp_do_request(struct ncp_server *server, int size, | |||
782 | spin_unlock_irqrestore(¤t->sighand->siglock, flags); | 782 | spin_unlock_irqrestore(¤t->sighand->siglock, flags); |
783 | } | 783 | } |
784 | 784 | ||
785 | DDPRINTK("do_ncp_rpc_call returned %d\n", result); | 785 | ncp_dbg(2, "do_ncp_rpc_call returned %d\n", result); |
786 | 786 | ||
787 | return result; | 787 | return result; |
788 | } | 788 | } |
@@ -812,7 +812,7 @@ int ncp_request2(struct ncp_server *server, int function, | |||
812 | 812 | ||
813 | result = ncp_do_request(server, server->current_size, reply, size); | 813 | result = ncp_do_request(server, server->current_size, reply, size); |
814 | if (result < 0) { | 814 | if (result < 0) { |
815 | DPRINTK("ncp_request_error: %d\n", result); | 815 | ncp_dbg(1, "ncp_request_error: %d\n", result); |
816 | goto out; | 816 | goto out; |
817 | } | 817 | } |
818 | server->completion = reply->completion_code; | 818 | server->completion = reply->completion_code; |
diff --git a/fs/ncpfs/symlink.c b/fs/ncpfs/symlink.c index 52439ddc8de0..1a63bfdb4a65 100644 --- a/fs/ncpfs/symlink.c +++ b/fs/ncpfs/symlink.c | |||
@@ -112,7 +112,7 @@ int ncp_symlink(struct inode *dir, struct dentry *dentry, const char *symname) { | |||
112 | __le32 attr; | 112 | __le32 attr; |
113 | unsigned int hdr; | 113 | unsigned int hdr; |
114 | 114 | ||
115 | DPRINTK("ncp_symlink(dir=%p,dentry=%p,symname=%s)\n",dir,dentry,symname); | 115 | ncp_dbg(1, "dir=%p, dentry=%p, symname=%s\n", dir, dentry, symname); |
116 | 116 | ||
117 | if (ncp_is_nfs_extras(NCP_SERVER(dir), NCP_FINFO(dir)->volNumber)) | 117 | if (ncp_is_nfs_extras(NCP_SERVER(dir), NCP_FINFO(dir)->volNumber)) |
118 | kludge = 0; | 118 | kludge = 0; |