diff options
Diffstat (limited to 'fs/ncpfs/file.c')
-rw-r--r-- | fs/ncpfs/file.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/fs/ncpfs/file.c b/fs/ncpfs/file.c index 8f5074e1ecb9..77640a8bfb87 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,11 +36,11 @@ 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 | ||
41 | DPRINTK("ncp_make_open: opened=%d, volume # %u, dir entry # %u\n", | 43 | ncp_dbg(1, "opened=%d, volume # %u, dir entry # %u\n", |
42 | atomic_read(&NCP_FINFO(inode)->opened), | 44 | atomic_read(&NCP_FINFO(inode)->opened), |
43 | NCP_FINFO(inode)->volNumber, | 45 | NCP_FINFO(inode)->volNumber, |
44 | NCP_FINFO(inode)->dirEntNum); | 46 | NCP_FINFO(inode)->dirEntNum); |
@@ -71,7 +73,7 @@ int ncp_make_open(struct inode *inode, int right) | |||
71 | break; | 73 | break; |
72 | } | 74 | } |
73 | if (result) { | 75 | if (result) { |
74 | PPRINTK("ncp_make_open: failed, result=%d\n", result); | 76 | ncp_vdbg("failed, result=%d\n", result); |
75 | goto out_unlock; | 77 | goto out_unlock; |
76 | } | 78 | } |
77 | /* | 79 | /* |
@@ -83,7 +85,7 @@ int ncp_make_open(struct inode *inode, int right) | |||
83 | } | 85 | } |
84 | 86 | ||
85 | access = NCP_FINFO(inode)->access; | 87 | access = NCP_FINFO(inode)->access; |
86 | PPRINTK("ncp_make_open: file open, access=%x\n", access); | 88 | ncp_vdbg("file open, access=%x\n", access); |
87 | if (access == right || access == O_RDWR) { | 89 | if (access == right || access == O_RDWR) { |
88 | atomic_inc(&NCP_FINFO(inode)->opened); | 90 | atomic_inc(&NCP_FINFO(inode)->opened); |
89 | error = 0; | 91 | error = 0; |
@@ -107,7 +109,7 @@ ncp_file_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) | |||
107 | void* freepage; | 109 | void* freepage; |
108 | size_t freelen; | 110 | size_t freelen; |
109 | 111 | ||
110 | DPRINTK("ncp_file_read: enter %pd2\n", dentry); | 112 | ncp_dbg(1, "enter %pd2\n", dentry); |
111 | 113 | ||
112 | pos = *ppos; | 114 | pos = *ppos; |
113 | 115 | ||
@@ -124,7 +126,7 @@ ncp_file_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) | |||
124 | 126 | ||
125 | error = ncp_make_open(inode, O_RDONLY); | 127 | error = ncp_make_open(inode, O_RDONLY); |
126 | if (error) { | 128 | if (error) { |
127 | DPRINTK(KERN_ERR "ncp_file_read: open failed, error=%d\n", error); | 129 | ncp_dbg(1, "open failed, error=%d\n", error); |
128 | return error; | 130 | return error; |
129 | } | 131 | } |
130 | 132 | ||
@@ -165,7 +167,7 @@ ncp_file_read(struct file *file, char __user *buf, size_t count, loff_t *ppos) | |||
165 | 167 | ||
166 | file_accessed(file); | 168 | file_accessed(file); |
167 | 169 | ||
168 | DPRINTK("ncp_file_read: exit %pd2\n", dentry); | 170 | ncp_dbg(1, "exit %pd2\n", dentry); |
169 | outrel: | 171 | outrel: |
170 | ncp_inode_close(inode); | 172 | ncp_inode_close(inode); |
171 | return already_read ? already_read : error; | 173 | return already_read ? already_read : error; |
@@ -182,7 +184,7 @@ ncp_file_write(struct file *file, const char __user *buf, size_t count, loff_t * | |||
182 | int errno; | 184 | int errno; |
183 | void* bouncebuffer; | 185 | void* bouncebuffer; |
184 | 186 | ||
185 | DPRINTK("ncp_file_write: enter %pd2\n", dentry); | 187 | ncp_dbg(1, "enter %pd2\n", dentry); |
186 | if ((ssize_t) count < 0) | 188 | if ((ssize_t) count < 0) |
187 | return -EINVAL; | 189 | return -EINVAL; |
188 | pos = *ppos; | 190 | pos = *ppos; |
@@ -211,7 +213,7 @@ ncp_file_write(struct file *file, const char __user *buf, size_t count, loff_t * | |||
211 | return 0; | 213 | return 0; |
212 | errno = ncp_make_open(inode, O_WRONLY); | 214 | errno = ncp_make_open(inode, O_WRONLY); |
213 | if (errno) { | 215 | if (errno) { |
214 | DPRINTK(KERN_ERR "ncp_file_write: open failed, error=%d\n", errno); | 216 | ncp_dbg(1, "open failed, error=%d\n", errno); |
215 | return errno; | 217 | return errno; |
216 | } | 218 | } |
217 | bufsize = NCP_SERVER(inode)->buffer_size; | 219 | bufsize = NCP_SERVER(inode)->buffer_size; |
@@ -261,7 +263,7 @@ ncp_file_write(struct file *file, const char __user *buf, size_t count, loff_t * | |||
261 | i_size_write(inode, pos); | 263 | i_size_write(inode, pos); |
262 | mutex_unlock(&inode->i_mutex); | 264 | mutex_unlock(&inode->i_mutex); |
263 | } | 265 | } |
264 | DPRINTK("ncp_file_write: exit %pd2\n", dentry); | 266 | ncp_dbg(1, "exit %pd2\n", dentry); |
265 | outrel: | 267 | outrel: |
266 | ncp_inode_close(inode); | 268 | ncp_inode_close(inode); |
267 | return already_written ? already_written : errno; | 269 | return already_written ? already_written : errno; |
@@ -269,7 +271,7 @@ outrel: | |||
269 | 271 | ||
270 | static int ncp_release(struct inode *inode, struct file *file) { | 272 | static int ncp_release(struct inode *inode, struct file *file) { |
271 | if (ncp_make_closed(inode)) { | 273 | if (ncp_make_closed(inode)) { |
272 | DPRINTK("ncp_release: failed to close\n"); | 274 | ncp_dbg(1, "failed to close\n"); |
273 | } | 275 | } |
274 | return 0; | 276 | return 0; |
275 | } | 277 | } |