aboutsummaryrefslogtreecommitdiffstats
path: root/fs/9p/vfs_dir.c
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2011-11-28 13:40:46 -0500
committerEric Van Hensbergen <ericvh@gmail.com>2012-01-05 11:51:44 -0500
commit5d3851530d6d68564e4e0ce04d0547d4d106fc72 (patch)
treed47065fcc1f93f00070afe597a98ab185fd13859 /fs/9p/vfs_dir.c
parenta0ea787b027b79cf2e01c6758e5246db06520158 (diff)
9p: Reduce object size with CONFIG_NET_9P_DEBUG
Reduce object size by deduplicating formats. Use vsprintf extension %pV. Rename P9_DPRINTK uses to p9_debug, align arguments. Add function for _p9_debug and macro to add __func__. Add missing "\n"s to p9_debug uses. Remove embedded function names as p9_debug adds it. Remove P9_EPRINTK macro and convert use to pr_<level>. Add and use pr_fmt and pr_<level>. $ size fs/9p/built-in.o* text data bss dec hex filename 62133 984 16000 79117 1350d fs/9p/built-in.o.new 67342 984 16928 85254 14d06 fs/9p/built-in.o.old $ size net/9p/built-in.o* text data bss dec hex filename 88792 4148 22024 114964 1c114 net/9p/built-in.o.new 94072 4148 23232 121452 1da6c net/9p/built-in.o.old Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'fs/9p/vfs_dir.c')
-rw-r--r--fs/9p/vfs_dir.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/9p/vfs_dir.c b/fs/9p/vfs_dir.c
index 598fff1a54e5..ff911e779651 100644
--- a/fs/9p/vfs_dir.c
+++ b/fs/9p/vfs_dir.c
@@ -140,7 +140,7 @@ static int v9fs_dir_readdir(struct file *filp, void *dirent, filldir_t filldir)
140 int reclen = 0; 140 int reclen = 0;
141 struct p9_rdir *rdir; 141 struct p9_rdir *rdir;
142 142
143 P9_DPRINTK(P9_DEBUG_VFS, "name %s\n", filp->f_path.dentry->d_name.name); 143 p9_debug(P9_DEBUG_VFS, "name %s\n", filp->f_path.dentry->d_name.name);
144 fid = filp->private_data; 144 fid = filp->private_data;
145 145
146 buflen = fid->clnt->msize - P9_IOHDRSZ; 146 buflen = fid->clnt->msize - P9_IOHDRSZ;
@@ -168,7 +168,7 @@ static int v9fs_dir_readdir(struct file *filp, void *dirent, filldir_t filldir)
168 err = p9stat_read(fid->clnt, rdir->buf + rdir->head, 168 err = p9stat_read(fid->clnt, rdir->buf + rdir->head,
169 rdir->tail - rdir->head, &st); 169 rdir->tail - rdir->head, &st);
170 if (err) { 170 if (err) {
171 P9_DPRINTK(P9_DEBUG_VFS, "returned %d\n", err); 171 p9_debug(P9_DEBUG_VFS, "returned %d\n", err);
172 err = -EIO; 172 err = -EIO;
173 p9stat_free(&st); 173 p9stat_free(&st);
174 goto unlock_and_exit; 174 goto unlock_and_exit;
@@ -213,7 +213,7 @@ static int v9fs_dir_readdir_dotl(struct file *filp, void *dirent,
213 struct p9_dirent curdirent; 213 struct p9_dirent curdirent;
214 u64 oldoffset = 0; 214 u64 oldoffset = 0;
215 215
216 P9_DPRINTK(P9_DEBUG_VFS, "name %s\n", filp->f_path.dentry->d_name.name); 216 p9_debug(P9_DEBUG_VFS, "name %s\n", filp->f_path.dentry->d_name.name);
217 fid = filp->private_data; 217 fid = filp->private_data;
218 218
219 buflen = fid->clnt->msize - P9_READDIRHDRSZ; 219 buflen = fid->clnt->msize - P9_READDIRHDRSZ;
@@ -244,7 +244,7 @@ static int v9fs_dir_readdir_dotl(struct file *filp, void *dirent,
244 rdir->tail - rdir->head, 244 rdir->tail - rdir->head,
245 &curdirent); 245 &curdirent);
246 if (err < 0) { 246 if (err < 0) {
247 P9_DPRINTK(P9_DEBUG_VFS, "returned %d\n", err); 247 p9_debug(P9_DEBUG_VFS, "returned %d\n", err);
248 err = -EIO; 248 err = -EIO;
249 goto unlock_and_exit; 249 goto unlock_and_exit;
250 } 250 }
@@ -290,9 +290,8 @@ int v9fs_dir_release(struct inode *inode, struct file *filp)
290 struct p9_fid *fid; 290 struct p9_fid *fid;
291 291
292 fid = filp->private_data; 292 fid = filp->private_data;
293 P9_DPRINTK(P9_DEBUG_VFS, 293 p9_debug(P9_DEBUG_VFS, "inode: %p filp: %p fid: %d\n",
294 "v9fs_dir_release: inode: %p filp: %p fid: %d\n", 294 inode, filp, fid ? fid->fid : -1);
295 inode, filp, fid ? fid->fid : -1);
296 if (fid) 295 if (fid)
297 p9_client_clunk(fid); 296 p9_client_clunk(fid);
298 return 0; 297 return 0;