diff options
author | Joe Perches <joe@perches.com> | 2011-11-28 13:40:46 -0500 |
---|---|---|
committer | Eric Van Hensbergen <ericvh@gmail.com> | 2012-01-05 11:51:44 -0500 |
commit | 5d3851530d6d68564e4e0ce04d0547d4d106fc72 (patch) | |
tree | d47065fcc1f93f00070afe597a98ab185fd13859 /fs/9p/vfs_file.c | |
parent | a0ea787b027b79cf2e01c6758e5246db06520158 (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_file.c')
-rw-r--r-- | fs/9p/vfs_file.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c index a7ac45d5bd2c..fc06fd27065e 100644 --- a/fs/9p/vfs_file.c +++ b/fs/9p/vfs_file.c | |||
@@ -61,7 +61,7 @@ int v9fs_file_open(struct inode *inode, struct file *file) | |||
61 | struct p9_fid *fid; | 61 | struct p9_fid *fid; |
62 | int omode; | 62 | int omode; |
63 | 63 | ||
64 | P9_DPRINTK(P9_DEBUG_VFS, "inode: %p file: %p\n", inode, file); | 64 | p9_debug(P9_DEBUG_VFS, "inode: %p file: %p\n", inode, file); |
65 | v9inode = V9FS_I(inode); | 65 | v9inode = V9FS_I(inode); |
66 | v9ses = v9fs_inode2v9ses(inode); | 66 | v9ses = v9fs_inode2v9ses(inode); |
67 | if (v9fs_proto_dotl(v9ses)) | 67 | if (v9fs_proto_dotl(v9ses)) |
@@ -135,7 +135,7 @@ static int v9fs_file_lock(struct file *filp, int cmd, struct file_lock *fl) | |||
135 | int res = 0; | 135 | int res = 0; |
136 | struct inode *inode = filp->f_path.dentry->d_inode; | 136 | struct inode *inode = filp->f_path.dentry->d_inode; |
137 | 137 | ||
138 | P9_DPRINTK(P9_DEBUG_VFS, "filp: %p lock: %p\n", filp, fl); | 138 | p9_debug(P9_DEBUG_VFS, "filp: %p lock: %p\n", filp, fl); |
139 | 139 | ||
140 | /* No mandatory locks */ | 140 | /* No mandatory locks */ |
141 | if (__mandatory_lock(inode) && fl->fl_type != F_UNLCK) | 141 | if (__mandatory_lock(inode) && fl->fl_type != F_UNLCK) |
@@ -305,8 +305,8 @@ static int v9fs_file_lock_dotl(struct file *filp, int cmd, struct file_lock *fl) | |||
305 | struct inode *inode = filp->f_path.dentry->d_inode; | 305 | struct inode *inode = filp->f_path.dentry->d_inode; |
306 | int ret = -ENOLCK; | 306 | int ret = -ENOLCK; |
307 | 307 | ||
308 | P9_DPRINTK(P9_DEBUG_VFS, "filp: %p cmd:%d lock: %p name: %s\n", filp, | 308 | p9_debug(P9_DEBUG_VFS, "filp: %p cmd:%d lock: %p name: %s\n", |
309 | cmd, fl, filp->f_path.dentry->d_name.name); | 309 | filp, cmd, fl, filp->f_path.dentry->d_name.name); |
310 | 310 | ||
311 | /* No mandatory locks */ | 311 | /* No mandatory locks */ |
312 | if (__mandatory_lock(inode) && fl->fl_type != F_UNLCK) | 312 | if (__mandatory_lock(inode) && fl->fl_type != F_UNLCK) |
@@ -341,8 +341,8 @@ static int v9fs_file_flock_dotl(struct file *filp, int cmd, | |||
341 | struct inode *inode = filp->f_path.dentry->d_inode; | 341 | struct inode *inode = filp->f_path.dentry->d_inode; |
342 | int ret = -ENOLCK; | 342 | int ret = -ENOLCK; |
343 | 343 | ||
344 | P9_DPRINTK(P9_DEBUG_VFS, "filp: %p cmd:%d lock: %p name: %s\n", filp, | 344 | p9_debug(P9_DEBUG_VFS, "filp: %p cmd:%d lock: %p name: %s\n", |
345 | cmd, fl, filp->f_path.dentry->d_name.name); | 345 | filp, cmd, fl, filp->f_path.dentry->d_name.name); |
346 | 346 | ||
347 | /* No mandatory locks */ | 347 | /* No mandatory locks */ |
348 | if (__mandatory_lock(inode) && fl->fl_type != F_UNLCK) | 348 | if (__mandatory_lock(inode) && fl->fl_type != F_UNLCK) |
@@ -385,8 +385,8 @@ v9fs_fid_readn(struct p9_fid *fid, char *data, char __user *udata, u32 count, | |||
385 | { | 385 | { |
386 | int n, total, size; | 386 | int n, total, size; |
387 | 387 | ||
388 | P9_DPRINTK(P9_DEBUG_VFS, "fid %d offset %llu count %d\n", fid->fid, | 388 | p9_debug(P9_DEBUG_VFS, "fid %d offset %llu count %d\n", |
389 | (long long unsigned) offset, count); | 389 | fid->fid, (long long unsigned)offset, count); |
390 | n = 0; | 390 | n = 0; |
391 | total = 0; | 391 | total = 0; |
392 | size = fid->iounit ? fid->iounit : fid->clnt->msize - P9_IOHDRSZ; | 392 | size = fid->iounit ? fid->iounit : fid->clnt->msize - P9_IOHDRSZ; |
@@ -444,7 +444,7 @@ v9fs_file_read(struct file *filp, char __user *udata, size_t count, | |||
444 | struct p9_fid *fid; | 444 | struct p9_fid *fid; |
445 | size_t size; | 445 | size_t size; |
446 | 446 | ||
447 | P9_DPRINTK(P9_DEBUG_VFS, "count %zu offset %lld\n", count, *offset); | 447 | p9_debug(P9_DEBUG_VFS, "count %zu offset %lld\n", count, *offset); |
448 | fid = filp->private_data; | 448 | fid = filp->private_data; |
449 | 449 | ||
450 | size = fid->iounit ? fid->iounit : fid->clnt->msize - P9_IOHDRSZ; | 450 | size = fid->iounit ? fid->iounit : fid->clnt->msize - P9_IOHDRSZ; |
@@ -471,8 +471,8 @@ v9fs_file_write_internal(struct inode *inode, struct p9_fid *fid, | |||
471 | loff_t origin = *offset; | 471 | loff_t origin = *offset; |
472 | unsigned long pg_start, pg_end; | 472 | unsigned long pg_start, pg_end; |
473 | 473 | ||
474 | P9_DPRINTK(P9_DEBUG_VFS, "data %p count %d offset %x\n", data, | 474 | p9_debug(P9_DEBUG_VFS, "data %p count %d offset %x\n", |
475 | (int)count, (int)*offset); | 475 | data, (int)count, (int)*offset); |
476 | 476 | ||
477 | clnt = fid->clnt; | 477 | clnt = fid->clnt; |
478 | do { | 478 | do { |
@@ -553,7 +553,7 @@ static int v9fs_file_fsync(struct file *filp, loff_t start, loff_t end, | |||
553 | return retval; | 553 | return retval; |
554 | 554 | ||
555 | mutex_lock(&inode->i_mutex); | 555 | mutex_lock(&inode->i_mutex); |
556 | P9_DPRINTK(P9_DEBUG_VFS, "filp %p datasync %x\n", filp, datasync); | 556 | p9_debug(P9_DEBUG_VFS, "filp %p datasync %x\n", filp, datasync); |
557 | 557 | ||
558 | fid = filp->private_data; | 558 | fid = filp->private_data; |
559 | v9fs_blank_wstat(&wstat); | 559 | v9fs_blank_wstat(&wstat); |
@@ -576,8 +576,7 @@ int v9fs_file_fsync_dotl(struct file *filp, loff_t start, loff_t end, | |||
576 | return retval; | 576 | return retval; |
577 | 577 | ||
578 | mutex_lock(&inode->i_mutex); | 578 | mutex_lock(&inode->i_mutex); |
579 | P9_DPRINTK(P9_DEBUG_VFS, "v9fs_file_fsync_dotl: filp %p datasync %x\n", | 579 | p9_debug(P9_DEBUG_VFS, "filp %p datasync %x\n", filp, datasync); |
580 | filp, datasync); | ||
581 | 580 | ||
582 | fid = filp->private_data; | 581 | fid = filp->private_data; |
583 | 582 | ||
@@ -608,8 +607,8 @@ v9fs_vm_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) | |||
608 | struct inode *inode = filp->f_path.dentry->d_inode; | 607 | struct inode *inode = filp->f_path.dentry->d_inode; |
609 | 608 | ||
610 | 609 | ||
611 | P9_DPRINTK(P9_DEBUG_VFS, "page %p fid %lx\n", | 610 | p9_debug(P9_DEBUG_VFS, "page %p fid %lx\n", |
612 | page, (unsigned long)filp->private_data); | 611 | page, (unsigned long)filp->private_data); |
613 | 612 | ||
614 | v9inode = V9FS_I(inode); | 613 | v9inode = V9FS_I(inode); |
615 | /* make sure the cache has finished storing the page */ | 614 | /* make sure the cache has finished storing the page */ |