Commit d3b73ca1 authored by Joe Perches's avatar Joe Perches Committed by Linus Torvalds

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: default avatarJoe Perches <joe@perches.com>
Cc: Petr Vandrovec <petr@vandrovec.name>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent b41f8b84
...@@ -339,7 +339,7 @@ ncp_lookup_validate(struct dentry *dentry, unsigned int flags) ...@@ -339,7 +339,7 @@ ncp_lookup_validate(struct dentry *dentry, unsigned int flags)
if (val) if (val)
goto finished; goto finished;
DDPRINTK("ncp_lookup_validate: %pd2 not valid, age=%ld, server lookup\n", ncp_dbg(2, "%pd2 not valid, age=%ld, server lookup\n",
dentry, NCP_GET_AGE(dentry)); dentry, NCP_GET_AGE(dentry));
len = sizeof(__name); len = sizeof(__name);
...@@ -358,7 +358,7 @@ ncp_lookup_validate(struct dentry *dentry, unsigned int flags) ...@@ -358,7 +358,7 @@ ncp_lookup_validate(struct dentry *dentry, unsigned int flags)
res = ncp_obtain_info(server, dir, __name, &(finfo.i)); res = ncp_obtain_info(server, dir, __name, &(finfo.i));
} }
finfo.volume = finfo.i.volNumber; finfo.volume = finfo.i.volNumber;
DDPRINTK("ncp_lookup_validate: looked for %pd/%s, res=%d\n", ncp_dbg(2, "looked for %pd/%s, res=%d\n",
dentry->d_parent, __name, res); dentry->d_parent, __name, res);
/* /*
* If we didn't find it, or if it has a different dirEntNum to * 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,14 +372,14 @@ ncp_lookup_validate(struct dentry *dentry, unsigned int flags)
ncp_new_dentry(dentry); ncp_new_dentry(dentry);
val=1; val=1;
} else } else
DDPRINTK("ncp_lookup_validate: found, but dirEntNum changed\n"); ncp_dbg(2, "found, but dirEntNum changed\n");
ncp_update_inode2(inode, &finfo); ncp_update_inode2(inode, &finfo);
mutex_unlock(&inode->i_mutex); mutex_unlock(&inode->i_mutex);
} }
finished: finished:
DDPRINTK("ncp_lookup_validate: result=%d\n", val); ncp_dbg(2, "result=%d\n", val);
dput(parent); dput(parent);
return val; return val;
} }
...@@ -453,8 +453,7 @@ static int ncp_readdir(struct file *file, struct dir_context *ctx) ...@@ -453,8 +453,7 @@ static int ncp_readdir(struct file *file, struct dir_context *ctx)
ctl.page = NULL; ctl.page = NULL;
ctl.cache = NULL; ctl.cache = NULL;
DDPRINTK("ncp_readdir: reading %pD2, pos=%d\n", file, ncp_dbg(2, "reading %pD2, pos=%d\n", file, (int)ctx->pos);
(int) ctx->pos);
result = -EIO; result = -EIO;
/* Do not generate '.' and '..' when server is dead. */ /* Do not generate '.' and '..' when server is dead. */
...@@ -697,8 +696,7 @@ ncp_read_volume_list(struct file *file, struct dir_context *ctx, ...@@ -697,8 +696,7 @@ ncp_read_volume_list(struct file *file, struct dir_context *ctx,
struct ncp_entry_info entry; struct ncp_entry_info entry;
int i; int i;
DPRINTK("ncp_read_volume_list: pos=%ld\n", ncp_dbg(1, "pos=%ld\n", (unsigned long)ctx->pos);
(unsigned long) ctx->pos);
for (i = 0; i < NCP_NUMBER_OF_VOLUMES; i++) { for (i = 0; i < NCP_NUMBER_OF_VOLUMES; i++) {
int inval_dentry; int inval_dentry;
...@@ -708,12 +706,11 @@ ncp_read_volume_list(struct file *file, struct dir_context *ctx, ...@@ -708,12 +706,11 @@ ncp_read_volume_list(struct file *file, struct dir_context *ctx,
if (!strlen(info.volume_name)) if (!strlen(info.volume_name))
continue; continue;
DPRINTK("ncp_read_volume_list: found vol: %s\n", ncp_dbg(1, "found vol: %s\n", info.volume_name);
info.volume_name);
if (ncp_lookup_volume(server, info.volume_name, if (ncp_lookup_volume(server, info.volume_name,
&entry.i)) { &entry.i)) {
DPRINTK("ncpfs: could not lookup vol %s\n", ncp_dbg(1, "could not lookup vol %s\n",
info.volume_name); info.volume_name);
continue; continue;
} }
...@@ -738,14 +735,13 @@ ncp_do_readdir(struct file *file, struct dir_context *ctx, ...@@ -738,14 +735,13 @@ ncp_do_readdir(struct file *file, struct dir_context *ctx,
int more; int more;
size_t bufsize; size_t bufsize;
DPRINTK("ncp_do_readdir: %pD2, fpos=%ld\n", file, ncp_dbg(1, "%pD2, fpos=%ld\n", file, (unsigned long)ctx->pos);
(unsigned long) ctx->pos);
PPRINTK("ncp_do_readdir: init %pD, volnum=%d, dirent=%u\n", PPRINTK("ncp_do_readdir: init %pD, volnum=%d, dirent=%u\n",
file, NCP_FINFO(dir)->volNumber, NCP_FINFO(dir)->dirEntNum); file, NCP_FINFO(dir)->volNumber, NCP_FINFO(dir)->dirEntNum);
err = ncp_initialize_search(server, dir, &seq); err = ncp_initialize_search(server, dir, &seq);
if (err) { if (err) {
DPRINTK("ncp_do_readdir: init failed, err=%d\n", err); ncp_dbg(1, "init failed, err=%d\n", err);
return; return;
} }
/* We MUST NOT use server->buffer_size handshaked with server if we are /* 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,10 +818,10 @@ int ncp_conn_logged_in(struct super_block *sb)
NCP_FINFO(ino)->DosDirNum = DosDirNum; NCP_FINFO(ino)->DosDirNum = DosDirNum;
result = 0; result = 0;
} else { } else {
DPRINTK("ncpfs: sb->s_root->d_inode == NULL!\n"); ncp_dbg(1, "sb->s_root->d_inode == NULL!\n");
} }
} else { } else {
DPRINTK("ncpfs: sb->s_root == NULL!\n"); ncp_dbg(1, "sb->s_root == NULL!\n");
} }
} else } else
result = 0; result = 0;
...@@ -952,7 +948,7 @@ int ncp_create_new(struct inode *dir, struct dentry *dentry, umode_t mode, ...@@ -952,7 +948,7 @@ int ncp_create_new(struct inode *dir, struct dentry *dentry, umode_t mode,
error = -ENAMETOOLONG; error = -ENAMETOOLONG;
else if (result < 0) else if (result < 0)
error = result; error = result;
DPRINTK("ncp_create: %pd2 failed\n", dentry); ncp_dbg(1, "%pd2 failed\n", dentry);
goto out; goto out;
} }
opmode = O_WRONLY; opmode = O_WRONLY;
...@@ -985,7 +981,7 @@ static int ncp_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) ...@@ -985,7 +981,7 @@ static int ncp_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
int error, len; int error, len;
__u8 __name[NCP_MAXPATHLEN + 1]; __u8 __name[NCP_MAXPATHLEN + 1];
DPRINTK("ncp_mkdir: making %pd2\n", dentry); ncp_dbg(1, "making %pd2\n", dentry);
ncp_age_dentry(server, dentry); ncp_age_dentry(server, dentry);
len = sizeof(__name); len = sizeof(__name);
...@@ -1022,7 +1018,7 @@ static int ncp_rmdir(struct inode *dir, struct dentry *dentry) ...@@ -1022,7 +1018,7 @@ static int ncp_rmdir(struct inode *dir, struct dentry *dentry)
int error, result, len; int error, result, len;
__u8 __name[NCP_MAXPATHLEN + 1]; __u8 __name[NCP_MAXPATHLEN + 1];
DPRINTK("ncp_rmdir: removing %pd2\n", dentry); ncp_dbg(1, "removing %pd2\n", dentry);
len = sizeof(__name); len = sizeof(__name);
error = ncp_io2vol(server, __name, &len, dentry->d_name.name, 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,7 +1063,7 @@ static int ncp_unlink(struct inode *dir, struct dentry *dentry)
int error; int error;
server = NCP_SERVER(dir); server = NCP_SERVER(dir);
DPRINTK("ncp_unlink: unlinking %pd2\n", dentry); ncp_dbg(1, "unlinking %pd2\n", dentry);
/* /*
* Check whether to close the file ... * Check whether to close the file ...
...@@ -1087,7 +1083,7 @@ static int ncp_unlink(struct inode *dir, struct dentry *dentry) ...@@ -1087,7 +1083,7 @@ static int ncp_unlink(struct inode *dir, struct dentry *dentry)
#endif #endif
switch (error) { switch (error) {
case 0x00: case 0x00:
DPRINTK("ncp: removed %pd2\n", dentry); ncp_dbg(1, "removed %pd2\n", dentry);
break; break;
case 0x85: case 0x85:
case 0x8A: case 0x8A:
...@@ -1120,7 +1116,7 @@ static int ncp_rename(struct inode *old_dir, struct dentry *old_dentry, ...@@ -1120,7 +1116,7 @@ static int ncp_rename(struct inode *old_dir, struct dentry *old_dentry,
int old_len, new_len; int old_len, new_len;
__u8 __old_name[NCP_MAXPATHLEN + 1], __new_name[NCP_MAXPATHLEN + 1]; __u8 __old_name[NCP_MAXPATHLEN + 1], __new_name[NCP_MAXPATHLEN + 1];
DPRINTK("ncp_rename: %pd2 to %pd2\n", old_dentry, new_dentry); ncp_dbg(1, "%pd2 to %pd2\n", old_dentry, new_dentry);
ncp_age_dentry(server, old_dentry); ncp_age_dentry(server, old_dentry);
ncp_age_dentry(server, new_dentry); ncp_age_dentry(server, new_dentry);
...@@ -1150,8 +1146,8 @@ static int ncp_rename(struct inode *old_dir, struct dentry *old_dentry, ...@@ -1150,8 +1146,8 @@ static int ncp_rename(struct inode *old_dir, struct dentry *old_dentry,
#endif #endif
switch (error) { switch (error) {
case 0x00: case 0x00:
DPRINTK("ncp renamed %pd -> %pd.\n", ncp_dbg(1, "renamed %pd -> %pd\n",
old_dentry, new_dentry); old_dentry, new_dentry);
break; break;
case 0x9E: case 0x9E:
error = -ENAMETOOLONG; error = -ENAMETOOLONG;
...@@ -1173,7 +1169,7 @@ static int ncp_mknod(struct inode * dir, struct dentry *dentry, ...@@ -1173,7 +1169,7 @@ static int ncp_mknod(struct inode * dir, struct dentry *dentry,
if (!new_valid_dev(rdev)) if (!new_valid_dev(rdev))
return -EINVAL; return -EINVAL;
if (ncp_is_nfs_extras(NCP_SERVER(dir), NCP_FINFO(dir)->volNumber)) { if (ncp_is_nfs_extras(NCP_SERVER(dir), NCP_FINFO(dir)->volNumber)) {
DPRINTK(KERN_DEBUG "ncp_mknod: mode = 0%ho\n", mode); ncp_dbg(1, "mode = 0%ho\n", mode);
return ncp_create_new(dir, dentry, mode, rdev, 0); return ncp_create_new(dir, dentry, mode, rdev, 0);
} }
return -EPERM; /* Strange, but true */ return -EPERM; /* Strange, but true */
......
...@@ -40,7 +40,7 @@ int ncp_make_open(struct inode *inode, int right) ...@@ -40,7 +40,7 @@ int ncp_make_open(struct inode *inode, int right)
goto out; goto out;
} }
DPRINTK("ncp_make_open: opened=%d, volume # %u, dir entry # %u\n", ncp_dbg(1, "opened=%d, volume # %u, dir entry # %u\n",
atomic_read(&NCP_FINFO(inode)->opened), atomic_read(&NCP_FINFO(inode)->opened),
NCP_FINFO(inode)->volNumber, NCP_FINFO(inode)->volNumber,
NCP_FINFO(inode)->dirEntNum); NCP_FINFO(inode)->dirEntNum);
...@@ -109,7 +109,7 @@ ncp_file_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) ...@@ -109,7 +109,7 @@ ncp_file_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
void* freepage; void* freepage;
size_t freelen; size_t freelen;
DPRINTK("ncp_file_read: enter %pd2\n", dentry); ncp_dbg(1, "enter %pd2\n", dentry);
pos = *ppos; pos = *ppos;
...@@ -126,7 +126,7 @@ ncp_file_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) ...@@ -126,7 +126,7 @@ ncp_file_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
error = ncp_make_open(inode, O_RDONLY); error = ncp_make_open(inode, O_RDONLY);
if (error) { if (error) {
DPRINTK(KERN_ERR "ncp_file_read: open failed, error=%d\n", error); ncp_dbg(1, "open failed, error=%d\n", error);
return error; return error;
} }
...@@ -167,7 +167,7 @@ ncp_file_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) ...@@ -167,7 +167,7 @@ ncp_file_read(struct file *file, char __user *buf, size_t count, loff_t *ppos)
file_accessed(file); file_accessed(file);
DPRINTK("ncp_file_read: exit %pd2\n", dentry); ncp_dbg(1, "exit %pd2\n", dentry);
outrel: outrel:
ncp_inode_close(inode); ncp_inode_close(inode);
return already_read ? already_read : error; 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,7 +184,7 @@ ncp_file_write(struct file *file, const char __user *buf, size_t count, loff_t *
int errno; int errno;
void* bouncebuffer; void* bouncebuffer;
DPRINTK("ncp_file_write: enter %pd2\n", dentry); ncp_dbg(1, "enter %pd2\n", dentry);
if ((ssize_t) count < 0) if ((ssize_t) count < 0)
return -EINVAL; return -EINVAL;
pos = *ppos; pos = *ppos;
...@@ -213,7 +213,7 @@ ncp_file_write(struct file *file, const char __user *buf, size_t count, loff_t * ...@@ -213,7 +213,7 @@ ncp_file_write(struct file *file, const char __user *buf, size_t count, loff_t *
return 0; return 0;
errno = ncp_make_open(inode, O_WRONLY); errno = ncp_make_open(inode, O_WRONLY);
if (errno) { if (errno) {
DPRINTK(KERN_ERR "ncp_file_write: open failed, error=%d\n", errno); ncp_dbg(1, "open failed, error=%d\n", errno);
return errno; return errno;
} }
bufsize = NCP_SERVER(inode)->buffer_size; 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,7 +263,7 @@ ncp_file_write(struct file *file, const char __user *buf, size_t count, loff_t *
i_size_write(inode, pos); i_size_write(inode, pos);
mutex_unlock(&inode->i_mutex); mutex_unlock(&inode->i_mutex);
} }
DPRINTK("ncp_file_write: exit %pd2\n", dentry); ncp_dbg(1, "exit %pd2\n", dentry);
outrel: outrel:
ncp_inode_close(inode); ncp_inode_close(inode);
return already_written ? already_written : errno; return already_written ? already_written : errno;
...@@ -271,7 +271,7 @@ outrel: ...@@ -271,7 +271,7 @@ outrel:
static int ncp_release(struct inode *inode, struct file *file) { static int ncp_release(struct inode *inode, struct file *file) {
if (ncp_make_closed(inode)) { if (ncp_make_closed(inode)) {
DPRINTK("ncp_release: failed to close\n"); ncp_dbg(1, "failed to close\n");
} }
return 0; return 0;
} }
......
...@@ -135,7 +135,7 @@ void ncp_update_inode(struct inode *inode, struct ncp_entry_info *nwinfo) ...@@ -135,7 +135,7 @@ void ncp_update_inode(struct inode *inode, struct ncp_entry_info *nwinfo)
NCP_FINFO(inode)->access = nwinfo->access; NCP_FINFO(inode)->access = nwinfo->access;
memcpy(NCP_FINFO(inode)->file_handle, nwinfo->file_handle, memcpy(NCP_FINFO(inode)->file_handle, nwinfo->file_handle,
sizeof(nwinfo->file_handle)); sizeof(nwinfo->file_handle));
DPRINTK("ncp_update_inode: updated %s, volnum=%d, dirent=%u\n", ncp_dbg(1, "updated %s, volnum=%d, dirent=%u\n",
nwinfo->i.entryName, NCP_FINFO(inode)->volNumber, nwinfo->i.entryName, NCP_FINFO(inode)->volNumber,
NCP_FINFO(inode)->dirEntNum); NCP_FINFO(inode)->dirEntNum);
} }
...@@ -143,8 +143,7 @@ void ncp_update_inode(struct inode *inode, struct ncp_entry_info *nwinfo) ...@@ -143,8 +143,7 @@ void ncp_update_inode(struct inode *inode, struct ncp_entry_info *nwinfo)
static void ncp_update_dates(struct inode *inode, struct nw_info_struct *nwi) static void ncp_update_dates(struct inode *inode, struct nw_info_struct *nwi)
{ {
/* NFS namespace mode overrides others if it's set. */ /* NFS namespace mode overrides others if it's set. */
DPRINTK(KERN_DEBUG "ncp_update_dates_and_mode: (%s) nfs.mode=0%o\n", ncp_dbg(1, "(%s) nfs.mode=0%o\n", nwi->entryName, nwi->nfs.mode);
nwi->entryName, nwi->nfs.mode);
if (nwi->nfs.mode) { if (nwi->nfs.mode) {
/* XXX Security? */ /* XXX Security? */
inode->i_mode = nwi->nfs.mode; inode->i_mode = nwi->nfs.mode;
...@@ -232,7 +231,7 @@ static void ncp_set_attr(struct inode *inode, struct ncp_entry_info *nwinfo) ...@@ -232,7 +231,7 @@ static void ncp_set_attr(struct inode *inode, struct ncp_entry_info *nwinfo)
ncp_update_attrs(inode, nwinfo); ncp_update_attrs(inode, nwinfo);
DDPRINTK("ncp_read_inode: inode->i_mode = %u\n", inode->i_mode); ncp_dbg(2, "inode->i_mode = %u\n", inode->i_mode);
set_nlink(inode, 1); set_nlink(inode, 1);
inode->i_uid = server->m.uid; inode->i_uid = server->m.uid;
...@@ -303,7 +302,7 @@ ncp_evict_inode(struct inode *inode) ...@@ -303,7 +302,7 @@ ncp_evict_inode(struct inode *inode)
clear_inode(inode); clear_inode(inode);
if (S_ISDIR(inode->i_mode)) { if (S_ISDIR(inode->i_mode)) {
DDPRINTK("ncp_evict_inode: put directory %ld\n", inode->i_ino); ncp_dbg(2, "put directory %ld\n", inode->i_ino);
} }
if (ncp_make_closed(inode) != 0) { 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,7 +683,7 @@ static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent)
ncp_unlock_server(server); ncp_unlock_server(server);
if (error < 0) if (error < 0)
goto out_rxbuf; goto out_rxbuf;
DPRINTK("ncp_fill_super: NCP_SBP(sb) = %x\n", (int) NCP_SBP(sb)); ncp_dbg(1, "NCP_SBP(sb) = %x\n", (int) NCP_SBP(sb));
error = -EMSGSIZE; /* -EREMOTESIDEINCOMPATIBLE */ error = -EMSGSIZE; /* -EREMOTESIDEINCOMPATIBLE */
#ifdef CONFIG_NCPFS_PACKET_SIGNING #ifdef CONFIG_NCPFS_PACKET_SIGNING
...@@ -712,7 +711,7 @@ static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent) ...@@ -712,7 +711,7 @@ static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent)
if (ncp_negotiate_buffersize(server, default_bufsize, if (ncp_negotiate_buffersize(server, default_bufsize,
&(server->buffer_size)) != 0) &(server->buffer_size)) != 0)
goto out_disconnect; goto out_disconnect;
DPRINTK("ncpfs: bufsize = %d\n", server->buffer_size); ncp_dbg(1, "bufsize = %d\n", server->buffer_size);
memset(&finfo, 0, sizeof(finfo)); memset(&finfo, 0, sizeof(finfo));
finfo.i.attributes = aDIR; finfo.i.attributes = aDIR;
...@@ -741,7 +740,7 @@ static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent) ...@@ -741,7 +740,7 @@ static int ncp_fill_super(struct super_block *sb, void *raw_data, int silent)
root_inode = ncp_iget(sb, &finfo); root_inode = ncp_iget(sb, &finfo);
if (!root_inode) if (!root_inode)
goto out_disconnect; goto out_disconnect;
DPRINTK("ncp_fill_super: root vol=%d\n", NCP_FINFO(root_inode)->volNumber); ncp_dbg(1, "root vol=%d\n", NCP_FINFO(root_inode)->volNumber);
sb->s_root = d_make_root(root_inode); sb->s_root = d_make_root(root_inode);
if (!sb->s_root) if (!sb->s_root)
goto out_disconnect; goto out_disconnect;
...@@ -987,8 +986,7 @@ int ncp_notify_change(struct dentry *dentry, struct iattr *attr) ...@@ -987,8 +986,7 @@ int ncp_notify_change(struct dentry *dentry, struct iattr *attr)
if ((attr->ia_valid & ATTR_SIZE) != 0) { if ((attr->ia_valid & ATTR_SIZE) != 0) {
int written; int written;
DPRINTK("ncpfs: trying to change size to %ld\n", ncp_dbg(1, "trying to change size to %ld\n", attr->ia_size);
attr->ia_size);
if ((result = ncp_make_open(inode, O_WRONLY)) < 0) { if ((result = ncp_make_open(inode, O_WRONLY)) < 0) {
result = -EACCES; result = -EACCES;
...@@ -1074,7 +1072,7 @@ MODULE_ALIAS_FS("ncpfs"); ...@@ -1074,7 +1072,7 @@ MODULE_ALIAS_FS("ncpfs");
static int __init init_ncp_fs(void) static int __init init_ncp_fs(void)
{ {
int err; int err;
DPRINTK("ncpfs: init_ncp_fs called\n"); ncp_dbg(1, "called\n");
err = init_inodecache(); err = init_inodecache();
if (err) if (err)
...@@ -1091,7 +1089,7 @@ out1: ...@@ -1091,7 +1089,7 @@ out1:
static void __exit exit_ncp_fs(void) static void __exit exit_ncp_fs(void)
{ {
DPRINTK("ncpfs: exit_ncp_fs called\n"); ncp_dbg(1, "called\n");
unregister_filesystem(&ncp_fs_type); unregister_filesystem(&ncp_fs_type);
destroy_inodecache(); destroy_inodecache();
} }
......
...@@ -41,7 +41,7 @@ ncp_get_fs_info(struct ncp_server * server, struct inode *inode, ...@@ -41,7 +41,7 @@ ncp_get_fs_info(struct ncp_server * server, struct inode *inode,
return -EFAULT; return -EFAULT;
if (info.version != NCP_GET_FS_INFO_VERSION) { if (info.version != NCP_GET_FS_INFO_VERSION) {
DPRINTK("info.version invalid: %d\n", info.version); ncp_dbg(1, "info.version invalid: %d\n", info.version);
return -EINVAL; return -EINVAL;
} }
/* TODO: info.addr = server->m.serv_addr; */ /* TODO: info.addr = server->m.serv_addr; */
...@@ -66,7 +66,7 @@ ncp_get_fs_info_v2(struct ncp_server * server, struct inode *inode, ...@@ -66,7 +66,7 @@ ncp_get_fs_info_v2(struct ncp_server * server, struct inode *inode,
return -EFAULT; return -EFAULT;
if (info2.version != NCP_GET_FS_INFO_VERSION_V2) { if (info2.version != NCP_GET_FS_INFO_VERSION_V2) {
DPRINTK("info.version invalid: %d\n", info2.version); ncp_dbg(1, "info.version invalid: %d\n", info2.version);
return -EINVAL; return -EINVAL;
} }
info2.mounted_uid = from_kuid_munged(current_user_ns(), server->m.mounted_uid); 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,7 +132,7 @@ ncp_get_compat_fs_info_v2(struct ncp_server * server, struct inode *inode,
return -EFAULT; return -EFAULT;
if (info2.version != NCP_GET_FS_INFO_VERSION_V2) { if (info2.version != NCP_GET_FS_INFO_VERSION_V2) {
DPRINTK("info.version invalid: %d\n", info2.version); ncp_dbg(1, "info.version invalid: %d\n", info2.version);
return -EINVAL; return -EINVAL;
} }
info2.mounted_uid = from_kuid_munged(current_user_ns(), server->m.mounted_uid); 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,8 +308,7 @@ static long __ncp_ioctl(struct inode *inode, unsigned int cmd, unsigned long arg
else else
result = server->reply_size; result = server->reply_size;
ncp_unlock_server(server); ncp_unlock_server(server);
DPRINTK("ncp_ioctl: copy %d bytes\n", ncp_dbg(1, "copy %d bytes\n", result);
result);
if (result >= 0) if (result >= 0)
if (copy_to_user(request.data, bouncebuffer, result)) if (copy_to_user(request.data, bouncebuffer, result))
result = -EFAULT; result = -EFAULT;
...@@ -385,9 +384,9 @@ static long __ncp_ioctl(struct inode *inode, unsigned int cmd, unsigned long arg ...@@ -385,9 +384,9 @@ static long __ncp_ioctl(struct inode *inode, unsigned int cmd, unsigned long arg
sr.namespace = server->name_space[sr.volNumber]; sr.namespace = server->name_space[sr.volNumber];
result = 0; result = 0;
} else } else
DPRINTK("ncpfs: s_root->d_inode==NULL\n"); ncp_dbg(1, "s_root->d_inode==NULL\n");
} else } else
DPRINTK("ncpfs: s_root==NULL\n"); ncp_dbg(1, "s_root==NULL\n");
} else { } else {
sr.volNumber = -1; sr.volNumber = -1;
sr.namespace = 0; sr.namespace = 0;
...@@ -440,11 +439,11 @@ static long __ncp_ioctl(struct inode *inode, unsigned int cmd, unsigned long arg ...@@ -440,11 +439,11 @@ static long __ncp_ioctl(struct inode *inode, unsigned int cmd, unsigned long arg
NCP_FINFO(s_inode)->DosDirNum = dosde; NCP_FINFO(s_inode)->DosDirNum = dosde;
server->root_setuped = 1; server->root_setuped = 1;
} else { } else {
DPRINTK("ncpfs: s_root->d_inode==NULL\n"); ncp_dbg(1, "s_root->d_inode==NULL\n");
result = -EIO; result = -EIO;
} }
} else { } else {
DPRINTK("ncpfs: s_root==NULL\n"); ncp_dbg(1, "s_root==NULL\n");
result = -EIO; result = -EIO;
} }
} }
......
...@@ -107,7 +107,7 @@ int ncp_mmap(struct file *file, struct vm_area_struct *vma) ...@@ -107,7 +107,7 @@ int ncp_mmap(struct file *file, struct vm_area_struct *vma)
{ {
struct inode *inode = file_inode(file); struct inode *inode = file_inode(file);
DPRINTK("ncp_mmap: called\n"); ncp_dbg(1, "called\n");
if (!ncp_conn_valid(NCP_SERVER(inode))) if (!ncp_conn_valid(NCP_SERVER(inode)))
return -EIO; return -EIO;
......
...@@ -15,17 +15,17 @@ ...@@ -15,17 +15,17 @@
#ifndef DEBUG_NCP #ifndef DEBUG_NCP
#define DEBUG_NCP 0 #define DEBUG_NCP 0
#endif #endif
#if DEBUG_NCP > 0
#define DPRINTK(format, args...) PRINTK(format , ## args) #if DEBUG_NCP > 0 && !defined(DEBUG)
#else #define DEBUG
#define DPRINTK(format, args...)
#endif
#if DEBUG_NCP > 1
#define DDPRINTK(format, args...) PRINTK(format , ## args)
#else
#define DDPRINTK(format, args...)
#endif #endif
#define ncp_dbg(level, fmt, ...) \
do { \
if (level <= DEBUG_NCP) \
pr_debug(fmt, ##__VA_ARGS__); \
} while (0)
#define NCP_MAX_RPC_TIMEOUT (6*HZ) #define NCP_MAX_RPC_TIMEOUT (6*HZ)
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
static inline void assert_server_locked(struct ncp_server *server) static inline void assert_server_locked(struct ncp_server *server)
{ {
if (server->lock == 0) { if (server->lock == 0) {
DPRINTK("ncpfs: server not locked!\n"); ncp_dbg(1, "server not locked!\n");
} }
} }
...@@ -75,7 +75,7 @@ static void ncp_add_pstring(struct ncp_server *server, const char *s) ...@@ -75,7 +75,7 @@ static void ncp_add_pstring(struct ncp_server *server, const char *s)
int len = strlen(s); int len = strlen(s);
assert_server_locked(server); assert_server_locked(server);
if (len > 255) { if (len > 255) {
DPRINTK("ncpfs: string too long: %s\n", s); ncp_dbg(1, "string too long: %s\n", s);
len = 255; len = 255;
} }
ncp_add_byte(server, len); ncp_add_byte(server, len);
...@@ -225,7 +225,7 @@ int ncp_get_volume_info_with_number(struct ncp_server* server, ...@@ -225,7 +225,7 @@ int ncp_get_volume_info_with_number(struct ncp_server* server,
result = -EIO; result = -EIO;
len = ncp_reply_byte(server, 29); len = ncp_reply_byte(server, 29);
if (len > NCP_VOLNAME_LEN) { if (len > NCP_VOLNAME_LEN) {
DPRINTK("ncpfs: volume name too long: %d\n", len); ncp_dbg(1, "volume name too long: %d\n", len);
goto out; goto out;
} }
memcpy(&(target->volume_name), ncp_reply_data(server, 30), len); 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,7 +259,7 @@ int ncp_get_directory_info(struct ncp_server* server, __u8 n,
result = -EIO; result = -EIO;
len = ncp_reply_byte(server, 21); len = ncp_reply_byte(server, 21);
if (len > NCP_VOLNAME_LEN) { if (len > NCP_VOLNAME_LEN) {
DPRINTK("ncpfs: volume name too long: %d\n", len); ncp_dbg(1, "volume name too long: %d\n", len);
goto out; goto out;
} }
memcpy(&(target->volume_name), ncp_reply_data(server, 22), len); memcpy(&(target->volume_name), ncp_reply_data(server, 22), len);
...@@ -394,8 +394,7 @@ int ncp_obtain_nfs_info(struct ncp_server *server, ...@@ -394,8 +394,7 @@ int ncp_obtain_nfs_info(struct ncp_server *server,