aboutsummaryrefslogtreecommitdiffstats
path: root/fs/9p/vfs_inode_dotl.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_inode_dotl.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_inode_dotl.c')
-rw-r--r--fs/9p/vfs_inode_dotl.c85
1 files changed, 41 insertions, 44 deletions
diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c
index 0b5745e21946..73488fb69d38 100644
--- a/fs/9p/vfs_inode_dotl.c
+++ b/fs/9p/vfs_inode_dotl.c
@@ -283,13 +283,13 @@ v9fs_vfs_create_dotl(struct inode *dir, struct dentry *dentry, int omode,
283 } 283 }
284 284
285 name = (char *) dentry->d_name.name; 285 name = (char *) dentry->d_name.name;
286 P9_DPRINTK(P9_DEBUG_VFS, "v9fs_vfs_create_dotl: name:%s flags:0x%x " 286 p9_debug(P9_DEBUG_VFS, "name:%s flags:0x%x mode:0x%x\n",
287 "mode:0x%x\n", name, flags, omode); 287 name, flags, omode);
288 288
289 dfid = v9fs_fid_lookup(dentry->d_parent); 289 dfid = v9fs_fid_lookup(dentry->d_parent);
290 if (IS_ERR(dfid)) { 290 if (IS_ERR(dfid)) {
291 err = PTR_ERR(dfid); 291 err = PTR_ERR(dfid);
292 P9_DPRINTK(P9_DEBUG_VFS, "fid lookup failed %d\n", err); 292 p9_debug(P9_DEBUG_VFS, "fid lookup failed %d\n", err);
293 return err; 293 return err;
294 } 294 }
295 295
@@ -297,7 +297,7 @@ v9fs_vfs_create_dotl(struct inode *dir, struct dentry *dentry, int omode,
297 ofid = p9_client_walk(dfid, 0, NULL, 1); 297 ofid = p9_client_walk(dfid, 0, NULL, 1);
298 if (IS_ERR(ofid)) { 298 if (IS_ERR(ofid)) {
299 err = PTR_ERR(ofid); 299 err = PTR_ERR(ofid);
300 P9_DPRINTK(P9_DEBUG_VFS, "p9_client_walk failed %d\n", err); 300 p9_debug(P9_DEBUG_VFS, "p9_client_walk failed %d\n", err);
301 return err; 301 return err;
302 } 302 }
303 303
@@ -307,16 +307,15 @@ v9fs_vfs_create_dotl(struct inode *dir, struct dentry *dentry, int omode,
307 /* Update mode based on ACL value */ 307 /* Update mode based on ACL value */
308 err = v9fs_acl_mode(dir, &mode, &dacl, &pacl); 308 err = v9fs_acl_mode(dir, &mode, &dacl, &pacl);
309 if (err) { 309 if (err) {
310 P9_DPRINTK(P9_DEBUG_VFS, 310 p9_debug(P9_DEBUG_VFS, "Failed to get acl values in creat %d\n",
311 "Failed to get acl values in creat %d\n", err); 311 err);
312 goto error; 312 goto error;
313 } 313 }
314 err = p9_client_create_dotl(ofid, name, v9fs_open_to_dotl_flags(flags), 314 err = p9_client_create_dotl(ofid, name, v9fs_open_to_dotl_flags(flags),
315 mode, gid, &qid); 315 mode, gid, &qid);
316 if (err < 0) { 316 if (err < 0) {
317 P9_DPRINTK(P9_DEBUG_VFS, 317 p9_debug(P9_DEBUG_VFS, "p9_client_open_dotl failed in creat %d\n",
318 "p9_client_open_dotl failed in creat %d\n", 318 err);
319 err);
320 goto error; 319 goto error;
321 } 320 }
322 v9fs_invalidate_inode_attr(dir); 321 v9fs_invalidate_inode_attr(dir);
@@ -325,14 +324,14 @@ v9fs_vfs_create_dotl(struct inode *dir, struct dentry *dentry, int omode,
325 fid = p9_client_walk(dfid, 1, &name, 1); 324 fid = p9_client_walk(dfid, 1, &name, 1);
326 if (IS_ERR(fid)) { 325 if (IS_ERR(fid)) {
327 err = PTR_ERR(fid); 326 err = PTR_ERR(fid);
328 P9_DPRINTK(P9_DEBUG_VFS, "p9_client_walk failed %d\n", err); 327 p9_debug(P9_DEBUG_VFS, "p9_client_walk failed %d\n", err);
329 fid = NULL; 328 fid = NULL;
330 goto error; 329 goto error;
331 } 330 }
332 inode = v9fs_get_new_inode_from_fid(v9ses, fid, dir->i_sb); 331 inode = v9fs_get_new_inode_from_fid(v9ses, fid, dir->i_sb);
333 if (IS_ERR(inode)) { 332 if (IS_ERR(inode)) {
334 err = PTR_ERR(inode); 333 err = PTR_ERR(inode);
335 P9_DPRINTK(P9_DEBUG_VFS, "inode creation failed %d\n", err); 334 p9_debug(P9_DEBUG_VFS, "inode creation failed %d\n", err);
336 goto error; 335 goto error;
337 } 336 }
338 err = v9fs_fid_add(dentry, fid); 337 err = v9fs_fid_add(dentry, fid);
@@ -408,7 +407,7 @@ static int v9fs_vfs_mkdir_dotl(struct inode *dir,
408 struct dentry *dir_dentry; 407 struct dentry *dir_dentry;
409 struct posix_acl *dacl = NULL, *pacl = NULL; 408 struct posix_acl *dacl = NULL, *pacl = NULL;
410 409
411 P9_DPRINTK(P9_DEBUG_VFS, "name %s\n", dentry->d_name.name); 410 p9_debug(P9_DEBUG_VFS, "name %s\n", dentry->d_name.name);
412 err = 0; 411 err = 0;
413 v9ses = v9fs_inode2v9ses(dir); 412 v9ses = v9fs_inode2v9ses(dir);
414 413
@@ -420,7 +419,7 @@ static int v9fs_vfs_mkdir_dotl(struct inode *dir,
420 dfid = v9fs_fid_lookup(dir_dentry); 419 dfid = v9fs_fid_lookup(dir_dentry);
421 if (IS_ERR(dfid)) { 420 if (IS_ERR(dfid)) {
422 err = PTR_ERR(dfid); 421 err = PTR_ERR(dfid);
423 P9_DPRINTK(P9_DEBUG_VFS, "fid lookup failed %d\n", err); 422 p9_debug(P9_DEBUG_VFS, "fid lookup failed %d\n", err);
424 dfid = NULL; 423 dfid = NULL;
425 goto error; 424 goto error;
426 } 425 }
@@ -430,8 +429,8 @@ static int v9fs_vfs_mkdir_dotl(struct inode *dir,
430 /* Update mode based on ACL value */ 429 /* Update mode based on ACL value */
431 err = v9fs_acl_mode(dir, &mode, &dacl, &pacl); 430 err = v9fs_acl_mode(dir, &mode, &dacl, &pacl);
432 if (err) { 431 if (err) {
433 P9_DPRINTK(P9_DEBUG_VFS, 432 p9_debug(P9_DEBUG_VFS, "Failed to get acl values in mkdir %d\n",
434 "Failed to get acl values in mkdir %d\n", err); 433 err);
435 goto error; 434 goto error;
436 } 435 }
437 name = (char *) dentry->d_name.name; 436 name = (char *) dentry->d_name.name;
@@ -444,8 +443,8 @@ static int v9fs_vfs_mkdir_dotl(struct inode *dir,
444 fid = p9_client_walk(dfid, 1, &name, 1); 443 fid = p9_client_walk(dfid, 1, &name, 1);
445 if (IS_ERR(fid)) { 444 if (IS_ERR(fid)) {
446 err = PTR_ERR(fid); 445 err = PTR_ERR(fid);
447 P9_DPRINTK(P9_DEBUG_VFS, "p9_client_walk failed %d\n", 446 p9_debug(P9_DEBUG_VFS, "p9_client_walk failed %d\n",
448 err); 447 err);
449 fid = NULL; 448 fid = NULL;
450 goto error; 449 goto error;
451 } 450 }
@@ -453,8 +452,8 @@ static int v9fs_vfs_mkdir_dotl(struct inode *dir,
453 inode = v9fs_get_new_inode_from_fid(v9ses, fid, dir->i_sb); 452 inode = v9fs_get_new_inode_from_fid(v9ses, fid, dir->i_sb);
454 if (IS_ERR(inode)) { 453 if (IS_ERR(inode)) {
455 err = PTR_ERR(inode); 454 err = PTR_ERR(inode);
456 P9_DPRINTK(P9_DEBUG_VFS, "inode creation failed %d\n", 455 p9_debug(P9_DEBUG_VFS, "inode creation failed %d\n",
457 err); 456 err);
458 goto error; 457 goto error;
459 } 458 }
460 err = v9fs_fid_add(dentry, fid); 459 err = v9fs_fid_add(dentry, fid);
@@ -495,7 +494,7 @@ v9fs_vfs_getattr_dotl(struct vfsmount *mnt, struct dentry *dentry,
495 struct p9_fid *fid; 494 struct p9_fid *fid;
496 struct p9_stat_dotl *st; 495 struct p9_stat_dotl *st;
497 496
498 P9_DPRINTK(P9_DEBUG_VFS, "dentry: %p\n", dentry); 497 p9_debug(P9_DEBUG_VFS, "dentry: %p\n", dentry);
499 err = -EPERM; 498 err = -EPERM;
500 v9ses = v9fs_dentry2v9ses(dentry); 499 v9ses = v9fs_dentry2v9ses(dentry);
501 if (v9ses->cache == CACHE_LOOSE || v9ses->cache == CACHE_FSCACHE) { 500 if (v9ses->cache == CACHE_LOOSE || v9ses->cache == CACHE_FSCACHE) {
@@ -537,7 +536,7 @@ int v9fs_vfs_setattr_dotl(struct dentry *dentry, struct iattr *iattr)
537 struct p9_fid *fid; 536 struct p9_fid *fid;
538 struct p9_iattr_dotl p9attr; 537 struct p9_iattr_dotl p9attr;
539 538
540 P9_DPRINTK(P9_DEBUG_VFS, "\n"); 539 p9_debug(P9_DEBUG_VFS, "\n");
541 540
542 retval = inode_change_ok(dentry->d_inode, iattr); 541 retval = inode_change_ok(dentry->d_inode, iattr);
543 if (retval) 542 if (retval)
@@ -670,14 +669,13 @@ v9fs_vfs_symlink_dotl(struct inode *dir, struct dentry *dentry,
670 struct v9fs_session_info *v9ses; 669 struct v9fs_session_info *v9ses;
671 670
672 name = (char *) dentry->d_name.name; 671 name = (char *) dentry->d_name.name;
673 P9_DPRINTK(P9_DEBUG_VFS, "v9fs_vfs_symlink_dotl : %lu,%s,%s\n", 672 p9_debug(P9_DEBUG_VFS, "%lu,%s,%s\n", dir->i_ino, name, symname);
674 dir->i_ino, name, symname);
675 v9ses = v9fs_inode2v9ses(dir); 673 v9ses = v9fs_inode2v9ses(dir);
676 674
677 dfid = v9fs_fid_lookup(dentry->d_parent); 675 dfid = v9fs_fid_lookup(dentry->d_parent);
678 if (IS_ERR(dfid)) { 676 if (IS_ERR(dfid)) {
679 err = PTR_ERR(dfid); 677 err = PTR_ERR(dfid);
680 P9_DPRINTK(P9_DEBUG_VFS, "fid lookup failed %d\n", err); 678 p9_debug(P9_DEBUG_VFS, "fid lookup failed %d\n", err);
681 return err; 679 return err;
682 } 680 }
683 681
@@ -687,7 +685,7 @@ v9fs_vfs_symlink_dotl(struct inode *dir, struct dentry *dentry,
687 err = p9_client_symlink(dfid, name, (char *)symname, gid, &qid); 685 err = p9_client_symlink(dfid, name, (char *)symname, gid, &qid);
688 686
689 if (err < 0) { 687 if (err < 0) {
690 P9_DPRINTK(P9_DEBUG_VFS, "p9_client_symlink failed %d\n", err); 688 p9_debug(P9_DEBUG_VFS, "p9_client_symlink failed %d\n", err);
691 goto error; 689 goto error;
692 } 690 }
693 691
@@ -697,8 +695,8 @@ v9fs_vfs_symlink_dotl(struct inode *dir, struct dentry *dentry,
697 fid = p9_client_walk(dfid, 1, &name, 1); 695 fid = p9_client_walk(dfid, 1, &name, 1);
698 if (IS_ERR(fid)) { 696 if (IS_ERR(fid)) {
699 err = PTR_ERR(fid); 697 err = PTR_ERR(fid);
700 P9_DPRINTK(P9_DEBUG_VFS, "p9_client_walk failed %d\n", 698 p9_debug(P9_DEBUG_VFS, "p9_client_walk failed %d\n",
701 err); 699 err);
702 fid = NULL; 700 fid = NULL;
703 goto error; 701 goto error;
704 } 702 }
@@ -707,8 +705,8 @@ v9fs_vfs_symlink_dotl(struct inode *dir, struct dentry *dentry,
707 inode = v9fs_get_new_inode_from_fid(v9ses, fid, dir->i_sb); 705 inode = v9fs_get_new_inode_from_fid(v9ses, fid, dir->i_sb);
708 if (IS_ERR(inode)) { 706 if (IS_ERR(inode)) {
709 err = PTR_ERR(inode); 707 err = PTR_ERR(inode);
710 P9_DPRINTK(P9_DEBUG_VFS, "inode creation failed %d\n", 708 p9_debug(P9_DEBUG_VFS, "inode creation failed %d\n",
711 err); 709 err);
712 goto error; 710 goto error;
713 } 711 }
714 err = v9fs_fid_add(dentry, fid); 712 err = v9fs_fid_add(dentry, fid);
@@ -751,9 +749,8 @@ v9fs_vfs_link_dotl(struct dentry *old_dentry, struct inode *dir,
751 struct p9_fid *dfid, *oldfid; 749 struct p9_fid *dfid, *oldfid;
752 struct v9fs_session_info *v9ses; 750 struct v9fs_session_info *v9ses;
753 751
754 P9_DPRINTK(P9_DEBUG_VFS, "dir ino: %lu, old_name: %s, new_name: %s\n", 752 p9_debug(P9_DEBUG_VFS, "dir ino: %lu, old_name: %s, new_name: %s\n",
755 dir->i_ino, old_dentry->d_name.name, 753 dir->i_ino, old_dentry->d_name.name, dentry->d_name.name);
756 dentry->d_name.name);
757 754
758 v9ses = v9fs_inode2v9ses(dir); 755 v9ses = v9fs_inode2v9ses(dir);
759 dir_dentry = v9fs_dentry_from_dir_inode(dir); 756 dir_dentry = v9fs_dentry_from_dir_inode(dir);
@@ -770,7 +767,7 @@ v9fs_vfs_link_dotl(struct dentry *old_dentry, struct inode *dir,
770 err = p9_client_link(dfid, oldfid, (char *)dentry->d_name.name); 767 err = p9_client_link(dfid, oldfid, (char *)dentry->d_name.name);
771 768
772 if (err < 0) { 769 if (err < 0) {
773 P9_DPRINTK(P9_DEBUG_VFS, "p9_client_link failed %d\n", err); 770 p9_debug(P9_DEBUG_VFS, "p9_client_link failed %d\n", err);
774 return err; 771 return err;
775 } 772 }
776 773
@@ -813,9 +810,9 @@ v9fs_vfs_mknod_dotl(struct inode *dir, struct dentry *dentry, int omode,
813 struct dentry *dir_dentry; 810 struct dentry *dir_dentry;
814 struct posix_acl *dacl = NULL, *pacl = NULL; 811 struct posix_acl *dacl = NULL, *pacl = NULL;
815 812
816 P9_DPRINTK(P9_DEBUG_VFS, 813 p9_debug(P9_DEBUG_VFS, " %lu,%s mode: %x MAJOR: %u MINOR: %u\n",
817 " %lu,%s mode: %x MAJOR: %u MINOR: %u\n", dir->i_ino, 814 dir->i_ino, dentry->d_name.name, omode,
818 dentry->d_name.name, omode, MAJOR(rdev), MINOR(rdev)); 815 MAJOR(rdev), MINOR(rdev));
819 816
820 if (!new_valid_dev(rdev)) 817 if (!new_valid_dev(rdev))
821 return -EINVAL; 818 return -EINVAL;
@@ -825,7 +822,7 @@ v9fs_vfs_mknod_dotl(struct inode *dir, struct dentry *dentry, int omode,
825 dfid = v9fs_fid_lookup(dir_dentry); 822 dfid = v9fs_fid_lookup(dir_dentry);
826 if (IS_ERR(dfid)) { 823 if (IS_ERR(dfid)) {
827 err = PTR_ERR(dfid); 824 err = PTR_ERR(dfid);
828 P9_DPRINTK(P9_DEBUG_VFS, "fid lookup failed %d\n", err); 825 p9_debug(P9_DEBUG_VFS, "fid lookup failed %d\n", err);
829 dfid = NULL; 826 dfid = NULL;
830 goto error; 827 goto error;
831 } 828 }
@@ -835,8 +832,8 @@ v9fs_vfs_mknod_dotl(struct inode *dir, struct dentry *dentry, int omode,
835 /* Update mode based on ACL value */ 832 /* Update mode based on ACL value */
836 err = v9fs_acl_mode(dir, &mode, &dacl, &pacl); 833 err = v9fs_acl_mode(dir, &mode, &dacl, &pacl);
837 if (err) { 834 if (err) {
838 P9_DPRINTK(P9_DEBUG_VFS, 835 p9_debug(P9_DEBUG_VFS, "Failed to get acl values in mknod %d\n",
839 "Failed to get acl values in mknod %d\n", err); 836 err);
840 goto error; 837 goto error;
841 } 838 }
842 name = (char *) dentry->d_name.name; 839 name = (char *) dentry->d_name.name;
@@ -851,8 +848,8 @@ v9fs_vfs_mknod_dotl(struct inode *dir, struct dentry *dentry, int omode,
851 fid = p9_client_walk(dfid, 1, &name, 1); 848 fid = p9_client_walk(dfid, 1, &name, 1);
852 if (IS_ERR(fid)) { 849 if (IS_ERR(fid)) {
853 err = PTR_ERR(fid); 850 err = PTR_ERR(fid);
854 P9_DPRINTK(P9_DEBUG_VFS, "p9_client_walk failed %d\n", 851 p9_debug(P9_DEBUG_VFS, "p9_client_walk failed %d\n",
855 err); 852 err);
856 fid = NULL; 853 fid = NULL;
857 goto error; 854 goto error;
858 } 855 }
@@ -860,8 +857,8 @@ v9fs_vfs_mknod_dotl(struct inode *dir, struct dentry *dentry, int omode,
860 inode = v9fs_get_new_inode_from_fid(v9ses, fid, dir->i_sb); 857 inode = v9fs_get_new_inode_from_fid(v9ses, fid, dir->i_sb);
861 if (IS_ERR(inode)) { 858 if (IS_ERR(inode)) {
862 err = PTR_ERR(inode); 859 err = PTR_ERR(inode);
863 P9_DPRINTK(P9_DEBUG_VFS, "inode creation failed %d\n", 860 p9_debug(P9_DEBUG_VFS, "inode creation failed %d\n",
864 err); 861 err);
865 goto error; 862 goto error;
866 } 863 }
867 err = v9fs_fid_add(dentry, fid); 864 err = v9fs_fid_add(dentry, fid);
@@ -905,7 +902,7 @@ v9fs_vfs_follow_link_dotl(struct dentry *dentry, struct nameidata *nd)
905 char *link = __getname(); 902 char *link = __getname();
906 char *target; 903 char *target;
907 904
908 P9_DPRINTK(P9_DEBUG_VFS, "%s\n", dentry->d_name.name); 905 p9_debug(P9_DEBUG_VFS, "%s\n", dentry->d_name.name);
909 906
910 if (!link) { 907 if (!link) {
911 link = ERR_PTR(-ENOMEM); 908 link = ERR_PTR(-ENOMEM);