Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Introduce path_put()

* Add path_put() functions for releasing a reference to the dentry and
vfsmount of a struct path in the right order

* Switch from path_release(nd) to path_put(&nd->path)

* Rename dput_path() to path_put_conditional()

[akpm@linux-foundation.org: fix cifs]
Signed-off-by: Jan Blunck <jblunck@suse.de>
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Acked-by: Christoph Hellwig <hch@lst.de>
Cc: <linux-fsdevel@vger.kernel.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Steven French <sfrench@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Jan Blunck and committed by
Linus Torvalds
1d957f9b 4ac91378

+125 -118
+1 -1
arch/alpha/kernel/osf_sys.c
··· 260 260 retval = user_path_walk(path, &nd); 261 261 if (!retval) { 262 262 retval = do_osf_statfs(nd.path.dentry, buffer, bufsiz); 263 - path_release(&nd); 263 + path_put(&nd.path); 264 264 } 265 265 return retval; 266 266 }
+3 -3
arch/mips/kernel/sysirix.c
··· 711 711 } 712 712 713 713 dput_and_out: 714 - path_release(&nd); 714 + path_put(&nd.path); 715 715 out: 716 716 return error; 717 717 } ··· 1385 1385 error |= __put_user(0, &buf->f_fstr[i]); 1386 1386 1387 1387 dput_and_out: 1388 - path_release(&nd); 1388 + path_put(&nd.path); 1389 1389 out: 1390 1390 return error; 1391 1391 } ··· 1636 1636 error |= __put_user(0, &buf->f_fstr[i]); 1637 1637 1638 1638 dput_and_out: 1639 - path_release(&nd); 1639 + path_put(&nd.path); 1640 1640 out: 1641 1641 return error; 1642 1642 }
+1 -1
arch/parisc/hpux/sys_hpux.c
··· 222 222 error = vfs_statfs_hpux(nd.path.dentry, &tmp); 223 223 if (!error && copy_to_user(buf, &tmp, sizeof(tmp))) 224 224 error = -EFAULT; 225 - path_release(&nd); 225 + path_put(&nd.path); 226 226 } 227 227 return error; 228 228 }
+1 -1
arch/powerpc/platforms/cell/spufs/syscalls.c
··· 73 73 LOOKUP_OPEN|LOOKUP_CREATE, &nd); 74 74 if (!ret) { 75 75 ret = spufs_create(&nd, flags, mode, neighbor); 76 - path_release(&nd); 76 + path_put(&nd.path); 77 77 } 78 78 putname(tmp); 79 79 }
+2 -2
arch/sparc64/solaris/fs.c
··· 436 436 if (!error) { 437 437 struct inode *inode = nd.path.dentry->d_inode; 438 438 error = report_statvfs(nd.path.mnt, inode, buf); 439 - path_release(&nd); 439 + path_put(&nd.path); 440 440 } 441 441 return error; 442 442 } ··· 466 466 if (!error) { 467 467 struct inode *inode = nd.path.dentry->d_inode; 468 468 error = report_statvfs64(nd.path.mnt, inode, buf); 469 - path_release(&nd); 469 + path_put(&nd.path); 470 470 } 471 471 unlock_kernel(); 472 472 return error;
+1 -1
drivers/md/dm-table.c
··· 375 375 *dev = inode->i_rdev; 376 376 377 377 out: 378 - path_release(&nd); 378 + path_put(&nd.path); 379 379 return r; 380 380 } 381 381
+2 -2
drivers/mtd/mtdsuper.c
··· 203 203 goto not_an_MTD_device; 204 204 205 205 mtdnr = iminor(nd.path.dentry->d_inode); 206 - path_release(&nd); 206 + path_put(&nd.path); 207 207 208 208 return get_sb_mtd_nr(fs_type, flags, dev_name, data, mtdnr, fill_super, 209 209 mnt); ··· 214 214 "MTD: Attempt to mount non-MTD device \"%s\"\n", 215 215 dev_name); 216 216 out: 217 - path_release(&nd); 217 + path_put(&nd.path); 218 218 return ret; 219 219 220 220 }
+1 -1
fs/afs/mntpt.c
··· 227 227 228 228 newmnt = afs_mntpt_do_automount(nd->path.dentry); 229 229 if (IS_ERR(newmnt)) { 230 - path_release(nd); 230 + path_put(&nd->path); 231 231 return (void *)newmnt; 232 232 } 233 233
+1 -1
fs/autofs4/root.c
··· 383 383 return NULL; 384 384 385 385 out_error: 386 - path_release(nd); 386 + path_put(&nd->path); 387 387 return ERR_PTR(status); 388 388 } 389 389
+1 -1
fs/block_dev.c
··· 1409 1409 if (!bdev) 1410 1410 goto fail; 1411 1411 out: 1412 - path_release(&nd); 1412 + path_put(&nd.path); 1413 1413 return bdev; 1414 1414 fail: 1415 1415 bdev = ERR_PTR(error);
+1 -1
fs/cifs/cifs_dfs_ref.c
··· 368 368 cFYI(1, ("leaving %s" , __FUNCTION__)); 369 369 return ERR_PTR(rc); 370 370 out_err: 371 - path_release(nd); 371 + path_put(&nd->path); 372 372 goto out; 373 373 } 374 374
+2 -2
fs/coda/pioctl.c
··· 80 80 81 81 /* return if it is not a Coda inode */ 82 82 if ( target_inode->i_sb != inode->i_sb ) { 83 - path_release(&nd); 83 + path_put(&nd.path); 84 84 return -EINVAL; 85 85 } 86 86 ··· 89 89 90 90 error = venus_pioctl(inode->i_sb, &(cnp->c_fid), cmd, &data); 91 91 92 - path_release(&nd); 92 + path_put(&nd.path); 93 93 return error; 94 94 } 95 95
+2 -2
fs/compat.c
··· 244 244 error = vfs_statfs(nd.path.dentry, &tmp); 245 245 if (!error) 246 246 error = put_compat_statfs(buf, &tmp); 247 - path_release(&nd); 247 + path_put(&nd.path); 248 248 } 249 249 return error; 250 250 } ··· 312 312 error = vfs_statfs(nd.path.dentry, &tmp); 313 313 if (!error) 314 314 error = put_compat_statfs64(buf, &tmp); 315 - path_release(&nd); 315 + path_put(&nd.path); 316 316 } 317 317 return error; 318 318 }
+2 -2
fs/configfs/symlink.c
··· 103 103 *target = configfs_get_config_item(nd->path.dentry); 104 104 if (!*target) { 105 105 ret = -ENOENT; 106 - path_release(nd); 106 + path_put(&nd->path); 107 107 } 108 108 } else 109 109 ret = -EPERM; ··· 141 141 ret = create_link(parent_item, target_item, dentry); 142 142 143 143 config_item_put(target_item); 144 - path_release(&nd); 144 + path_put(&nd.path); 145 145 146 146 out_put: 147 147 config_item_put(parent_item);
+1 -1
fs/dquot.c
··· 1643 1643 error = vfs_quota_on_inode(nd.path.dentry->d_inode, type, 1644 1644 format_id); 1645 1645 out_path: 1646 - path_release(&nd); 1646 + path_put(&nd.path); 1647 1647 return error; 1648 1648 } 1649 1649
+1 -1
fs/ecryptfs/main.c
··· 526 526 rc = 0; 527 527 goto out; 528 528 out_free: 529 - path_release(&nd); 529 + path_put(&nd.path); 530 530 out: 531 531 return rc; 532 532 }
+2 -2
fs/exec.c
··· 148 148 return error; 149 149 exit: 150 150 release_open_intent(&nd); 151 - path_release(&nd); 151 + path_put(&nd.path); 152 152 goto out; 153 153 } 154 154 ··· 672 672 } 673 673 } 674 674 release_open_intent(&nd); 675 - path_release(&nd); 675 + path_put(&nd.path); 676 676 } 677 677 goto out; 678 678 }
+2 -2
fs/ext3/super.c
··· 2759 2759 return err; 2760 2760 /* Quotafile not on the same filesystem? */ 2761 2761 if (nd.path.mnt->mnt_sb != sb) { 2762 - path_release(&nd); 2762 + path_put(&nd.path); 2763 2763 return -EXDEV; 2764 2764 } 2765 2765 /* Quotafile not of fs root? */ ··· 2767 2767 printk(KERN_WARNING 2768 2768 "EXT3-fs: Quota file not on filesystem root. " 2769 2769 "Journalled quota will not work.\n"); 2770 - path_release(&nd); 2770 + path_put(&nd.path); 2771 2771 return vfs_quota_on(sb, type, format_id, path); 2772 2772 } 2773 2773
+2 -2
fs/ext4/super.c
··· 3159 3159 return err; 3160 3160 /* Quotafile not on the same filesystem? */ 3161 3161 if (nd.path.mnt->mnt_sb != sb) { 3162 - path_release(&nd); 3162 + path_put(&nd.path); 3163 3163 return -EXDEV; 3164 3164 } 3165 3165 /* Quotafile not of fs root? */ ··· 3167 3167 printk(KERN_WARNING 3168 3168 "EXT4-fs: Quota file not on filesystem root. " 3169 3169 "Journalled quota will not work.\n"); 3170 - path_release(&nd); 3170 + path_put(&nd.path); 3171 3171 return vfs_quota_on(sb, type, format_id, path); 3172 3172 } 3173 3173
+1 -1
fs/gfs2/ops_fstype.c
··· 900 900 "mount point %s\n", dev_name); 901 901 902 902 free_nd: 903 - path_release(&nd); 903 + path_put(&nd.path); 904 904 out: 905 905 return sb; 906 906 }
+2 -2
fs/inotify_user.c
··· 367 367 /* you can only watch an inode if you have read permissions on it */ 368 368 error = vfs_permission(nd, MAY_READ); 369 369 if (error) 370 - path_release(nd); 370 + path_put(&nd->path); 371 371 return error; 372 372 } 373 373 ··· 676 676 ret = create_watch(dev, inode, mask); 677 677 mutex_unlock(&dev->up_mutex); 678 678 679 - path_release(&nd); 679 + path_put(&nd.path); 680 680 fput_and_out: 681 681 fput_light(filp, fput_needed); 682 682 return ret;
+31 -25
fs/namei.c
··· 362 362 return 0; 363 363 } 364 364 365 - void path_release(struct nameidata *nd) 365 + /** 366 + * path_put - put a reference to a path 367 + * @path: path to put the reference to 368 + * 369 + * Given a path decrement the reference count to the dentry and the vfsmount. 370 + */ 371 + void path_put(struct path *path) 366 372 { 367 - dput(nd->path.dentry); 368 - mntput(nd->path.mnt); 373 + dput(path->dentry); 374 + mntput(path->mnt); 369 375 } 376 + EXPORT_SYMBOL(path_put); 370 377 371 378 /** 372 379 * release_open_intent - free up open intent resources ··· 558 551 goto fail; 559 552 560 553 if (*link == '/') { 561 - path_release(nd); 554 + path_put(&nd->path); 562 555 if (!walk_init_root(link, nd)) 563 556 /* weird __emul_prefix() stuff did it */ 564 557 goto out; ··· 574 567 */ 575 568 name = __getname(); 576 569 if (unlikely(!name)) { 577 - path_release(nd); 570 + path_put(&nd->path); 578 571 return -ENOMEM; 579 572 } 580 573 strcpy(name, nd->last.name); 581 574 nd->last.name = name; 582 575 return 0; 583 576 fail: 584 - path_release(nd); 577 + path_put(&nd->path); 585 578 return PTR_ERR(link); 586 579 } 587 580 588 - static inline void dput_path(struct path *path, struct nameidata *nd) 581 + static void path_put_conditional(struct path *path, struct nameidata *nd) 589 582 { 590 583 dput(path->dentry); 591 584 if (path->mnt != nd->path.mnt) ··· 658 651 nd->depth--; 659 652 return err; 660 653 loop: 661 - dput_path(path, nd); 662 - path_release(nd); 654 + path_put_conditional(path, nd); 655 + path_put(&nd->path); 663 656 return err; 664 657 } 665 658 ··· 1000 993 return_base: 1001 994 return 0; 1002 995 out_dput: 1003 - dput_path(&next, nd); 996 + path_put_conditional(&next, nd); 1004 997 break; 1005 998 } 1006 - path_release(nd); 999 + path_put(&nd->path); 1007 1000 return_err: 1008 1001 return err; 1009 1002 } ··· 1077 1070 mntput(old_mnt); 1078 1071 return 1; 1079 1072 } 1080 - path_release(nd); 1073 + path_put(&nd->path); 1081 1074 } 1082 1075 nd->path.dentry = old_dentry; 1083 1076 nd->path.mnt = old_mnt; ··· 1237 1230 if (IS_ERR(nd->intent.open.file)) { 1238 1231 if (err == 0) { 1239 1232 err = PTR_ERR(nd->intent.open.file); 1240 - path_release(nd); 1233 + path_put(&nd->path); 1241 1234 } 1242 1235 } else if (err != 0) 1243 1236 release_open_intent(nd); ··· 1813 1806 return 0; 1814 1807 1815 1808 exit_dput: 1816 - dput_path(&path, nd); 1809 + path_put_conditional(&path, nd); 1817 1810 exit: 1818 1811 if (!IS_ERR(nd->intent.open.file)) 1819 1812 release_open_intent(nd); 1820 - path_release(nd); 1813 + path_put(&nd->path); 1821 1814 return error; 1822 1815 1823 1816 do_link: ··· 1986 1979 dput(dentry); 1987 1980 } 1988 1981 mutex_unlock(&nd.path.dentry->d_inode->i_mutex); 1989 - path_release(&nd); 1982 + path_put(&nd.path); 1990 1983 out: 1991 1984 putname(tmp); 1992 1985 ··· 2046 2039 dput(dentry); 2047 2040 out_unlock: 2048 2041 mutex_unlock(&nd.path.dentry->d_inode->i_mutex); 2049 - path_release(&nd); 2042 + path_put(&nd.path); 2050 2043 out: 2051 2044 putname(tmp); 2052 2045 out_err: ··· 2154 2147 exit2: 2155 2148 mutex_unlock(&nd.path.dentry->d_inode->i_mutex); 2156 2149 exit1: 2157 - path_release(&nd); 2150 + path_put(&nd.path); 2158 2151 exit: 2159 2152 putname(name); 2160 2153 return error; ··· 2238 2231 if (inode) 2239 2232 iput(inode); /* truncate the inode here */ 2240 2233 exit1: 2241 - path_release(&nd); 2234 + path_put(&nd.path); 2242 2235 exit: 2243 2236 putname(name); 2244 2237 return error; ··· 2315 2308 dput(dentry); 2316 2309 out_unlock: 2317 2310 mutex_unlock(&nd.path.dentry->d_inode->i_mutex); 2318 - path_release(&nd); 2311 + path_put(&nd.path); 2319 2312 out: 2320 2313 putname(to); 2321 2314 out_putname: ··· 2411 2404 out_unlock: 2412 2405 mutex_unlock(&nd.path.dentry->d_inode->i_mutex); 2413 2406 out_release: 2414 - path_release(&nd); 2407 + path_put(&nd.path); 2415 2408 out: 2416 - path_release(&old_nd); 2409 + path_put(&old_nd.path); 2417 2410 exit: 2418 2411 putname(to); 2419 2412 ··· 2641 2634 exit3: 2642 2635 unlock_rename(new_dir, old_dir); 2643 2636 exit2: 2644 - path_release(&newnd); 2637 + path_put(&newnd.path); 2645 2638 exit1: 2646 - path_release(&oldnd); 2639 + path_put(&oldnd.path); 2647 2640 exit: 2648 2641 return error; 2649 2642 } ··· 2817 2810 EXPORT_SYMBOL(page_symlink_inode_operations); 2818 2811 EXPORT_SYMBOL(path_lookup); 2819 2812 EXPORT_SYMBOL(vfs_path_lookup); 2820 - EXPORT_SYMBOL(path_release); 2821 2813 EXPORT_SYMBOL(permission); 2822 2814 EXPORT_SYMBOL(vfs_permission); 2823 2815 EXPORT_SYMBOL(file_permission);
+10 -10
fs/namespace.c
··· 1007 1007 1008 1008 out: 1009 1009 up_write(&namespace_sem); 1010 - path_release(&old_nd); 1010 + path_put(&old_nd.path); 1011 1011 return err; 1012 1012 } 1013 1013 ··· 1126 1126 out: 1127 1127 up_write(&namespace_sem); 1128 1128 if (!err) 1129 - path_release(&parent_nd); 1130 - path_release(&old_nd); 1129 + path_put(&parent_nd.path); 1130 + path_put(&old_nd.path); 1131 1131 return err; 1132 1132 } 1133 1133 ··· 1512 1512 retval = do_new_mount(&nd, type_page, flags, mnt_flags, 1513 1513 dev_name, data_page); 1514 1514 dput_out: 1515 - path_release(&nd); 1515 + path_put(&nd.path); 1516 1516 return retval; 1517 1517 } 1518 1518 ··· 1768 1768 1769 1769 error = security_sb_pivotroot(&old_nd, &new_nd); 1770 1770 if (error) { 1771 - path_release(&old_nd); 1771 + path_put(&old_nd.path); 1772 1772 goto out1; 1773 1773 } 1774 1774 ··· 1831 1831 chroot_fs_refs(&user_nd, &new_nd); 1832 1832 security_sb_post_pivotroot(&user_nd, &new_nd); 1833 1833 error = 0; 1834 - path_release(&root_parent); 1835 - path_release(&parent_nd); 1834 + path_put(&root_parent.path); 1835 + path_put(&parent_nd.path); 1836 1836 out2: 1837 1837 mutex_unlock(&old_nd.path.dentry->d_inode->i_mutex); 1838 1838 up_write(&namespace_sem); 1839 - path_release(&user_nd); 1840 - path_release(&old_nd); 1839 + path_put(&user_nd.path); 1840 + path_put(&old_nd.path); 1841 1841 out1: 1842 - path_release(&new_nd); 1842 + path_put(&new_nd.path); 1843 1843 out0: 1844 1844 unlock_kernel(); 1845 1845 return error;
+1 -1
fs/nfs/namespace.c
··· 148 148 dprintk("<-- nfs_follow_mountpoint() = %d\n", err); 149 149 return ERR_PTR(err); 150 150 out_err: 151 - path_release(nd); 151 + path_put(&nd->path); 152 152 goto out; 153 153 out_follow: 154 154 while (d_mountpoint(nd->path.dentry) &&
+1 -1
fs/nfsctl.c
··· 43 43 if (!error) 44 44 return dentry_open(nd.path.dentry, nd.path.mnt, flags); 45 45 46 - path_release(&nd); 46 + path_put(&nd.path); 47 47 return ERR_PTR(error); 48 48 } 49 49
+5 -5
fs/nfsd/export.c
··· 177 177 cache_put(&ek->h, &svc_expkey_cache); 178 178 else 179 179 err = -ENOMEM; 180 - path_release(&nd); 180 + path_put(&nd.path); 181 181 } 182 182 cache_flush(); 183 183 out: ··· 630 630 kfree(exp.ex_uuid); 631 631 kfree(exp.ex_path); 632 632 if (nd.path.dentry) 633 - path_release(&nd); 633 + path_put(&nd.path); 634 634 out_no_path: 635 635 if (dom) 636 636 auth_domain_put(dom); ··· 1098 1098 cache_put(&fsid_key->h, &svc_expkey_cache); 1099 1099 if (clp) 1100 1100 auth_domain_put(clp); 1101 - path_release(&nd); 1101 + path_put(&nd.path); 1102 1102 out_unlock: 1103 1103 exp_writeunlock(); 1104 1104 out: ··· 1150 1150 1151 1151 err = -EINVAL; 1152 1152 exp = exp_get_by_name(dom, nd.path.mnt, nd.path.dentry, NULL); 1153 - path_release(&nd); 1153 + path_put(&nd.path); 1154 1154 if (IS_ERR(exp)) 1155 1155 goto out_domain; 1156 1156 ··· 1209 1209 fh_put(&fh); 1210 1210 exp_put(exp); 1211 1211 out: 1212 - path_release(&nd); 1212 + path_put(&nd.path); 1213 1213 return err; 1214 1214 } 1215 1215
+1 -1
fs/nfsd/nfs4recover.c
··· 415 415 if (!rec_dir_init) 416 416 return; 417 417 rec_dir_init = 0; 418 - path_release(&rec_dir); 418 + path_put(&rec_dir.path); 419 419 }
+1 -1
fs/nfsd/nfs4state.c
··· 3265 3265 nfs4_set_recdir(recdir); 3266 3266 status = 0; 3267 3267 } 3268 - path_release(&nd); 3268 + path_put(&nd.path); 3269 3269 return status; 3270 3270 } 3271 3271
+11 -11
fs/open.c
··· 130 130 error = vfs_statfs_native(nd.path.dentry, &tmp); 131 131 if (!error && copy_to_user(buf, &tmp, sizeof(tmp))) 132 132 error = -EFAULT; 133 - path_release(&nd); 133 + path_put(&nd.path); 134 134 } 135 135 return error; 136 136 } ··· 149 149 error = vfs_statfs64(nd.path.dentry, &tmp); 150 150 if (!error && copy_to_user(buf, &tmp, sizeof(tmp))) 151 151 error = -EFAULT; 152 - path_release(&nd); 152 + path_put(&nd.path); 153 153 } 154 154 return error; 155 155 } ··· 277 277 put_write_and_out: 278 278 put_write_access(inode); 279 279 dput_and_out: 280 - path_release(&nd); 280 + path_put(&nd.path); 281 281 out: 282 282 return error; 283 283 } ··· 462 462 res = -EROFS; 463 463 464 464 out_path_release: 465 - path_release(&nd); 465 + path_put(&nd.path); 466 466 out: 467 467 current->fsuid = old_fsuid; 468 468 current->fsgid = old_fsgid; ··· 493 493 set_fs_pwd(current->fs, nd.path.mnt, nd.path.dentry); 494 494 495 495 dput_and_out: 496 - path_release(&nd); 496 + path_put(&nd.path); 497 497 out: 498 498 return error; 499 499 } ··· 549 549 set_fs_altroot(); 550 550 error = 0; 551 551 dput_and_out: 552 - path_release(&nd); 552 + path_put(&nd.path); 553 553 out: 554 554 return error; 555 555 } ··· 621 621 mutex_unlock(&inode->i_mutex); 622 622 623 623 dput_and_out: 624 - path_release(&nd); 624 + path_put(&nd.path); 625 625 out: 626 626 return error; 627 627 } ··· 676 676 if (error) 677 677 goto out; 678 678 error = chown_common(nd.path.dentry, user, group); 679 - path_release(&nd); 679 + path_put(&nd.path); 680 680 out: 681 681 return error; 682 682 } ··· 696 696 if (error) 697 697 goto out; 698 698 error = chown_common(nd.path.dentry, user, group); 699 - path_release(&nd); 699 + path_put(&nd.path); 700 700 out: 701 701 return error; 702 702 } ··· 710 710 if (error) 711 711 goto out; 712 712 error = chown_common(nd.path.dentry, user, group); 713 - path_release(&nd); 713 + path_put(&nd.path); 714 714 out: 715 715 return error; 716 716 } ··· 894 894 filp = __dentry_open(nd->path.dentry, nd->path.mnt, flags, filp, 895 895 NULL); 896 896 else 897 - path_release(nd); 897 + path_put(&nd->path); 898 898 return filp; 899 899 } 900 900
+1 -1
fs/proc/base.c
··· 1164 1164 int error = -EACCES; 1165 1165 1166 1166 /* We don't need a base pointer in the /proc filesystem */ 1167 - path_release(nd); 1167 + path_put(&nd->path); 1168 1168 1169 1169 /* Are we allowed to snoop on the tasks file descriptors? */ 1170 1170 if (!proc_fd_access_allowed(inode))
+4 -4
fs/reiserfs/super.c
··· 2027 2027 return err; 2028 2028 /* Quotafile not on the same filesystem? */ 2029 2029 if (nd.path.mnt->mnt_sb != sb) { 2030 - path_release(&nd); 2030 + path_put(&nd.path); 2031 2031 return -EXDEV; 2032 2032 } 2033 2033 /* We must not pack tails for quota files on reiserfs for quota IO to work */ 2034 2034 if (!REISERFS_I(nd.path.dentry->d_inode)->i_flags & i_nopack_mask) { 2035 2035 reiserfs_warning(sb, 2036 2036 "reiserfs: Quota file must have tail packing disabled."); 2037 - path_release(&nd); 2037 + path_put(&nd.path); 2038 2038 return -EINVAL; 2039 2039 } 2040 2040 /* Not journalling quota? No more tests needed... */ 2041 2041 if (!REISERFS_SB(sb)->s_qf_names[USRQUOTA] && 2042 2042 !REISERFS_SB(sb)->s_qf_names[GRPQUOTA]) { 2043 - path_release(&nd); 2043 + path_put(&nd.path); 2044 2044 return vfs_quota_on(sb, type, format_id, path); 2045 2045 } 2046 2046 /* Quotafile not of fs root? */ ··· 2048 2048 reiserfs_warning(sb, 2049 2049 "reiserfs: Quota file not on filesystem root. " 2050 2050 "Journalled quota will not work."); 2051 - path_release(&nd); 2051 + path_put(&nd.path); 2052 2052 return vfs_quota_on(sb, type, format_id, path); 2053 2053 } 2054 2054
+3 -3
fs/stat.c
··· 63 63 error = __user_walk_fd(dfd, name, LOOKUP_FOLLOW, &nd); 64 64 if (!error) { 65 65 error = vfs_getattr(nd.path.mnt, nd.path.dentry, stat); 66 - path_release(&nd); 66 + path_put(&nd.path); 67 67 } 68 68 return error; 69 69 } ··· 83 83 error = __user_walk_fd(dfd, name, 0, &nd); 84 84 if (!error) { 85 85 error = vfs_getattr(nd.path.mnt, nd.path.dentry, stat); 86 - path_release(&nd); 86 + path_put(&nd.path); 87 87 } 88 88 return error; 89 89 } ··· 313 313 buf, bufsiz); 314 314 } 315 315 } 316 - path_release(&nd); 316 + path_put(&nd.path); 317 317 } 318 318 return error; 319 319 }
+1 -1
fs/utimes.c
··· 138 138 if (f) 139 139 fput(f); 140 140 else 141 - path_release(&nd); 141 + path_put(&nd.path); 142 142 out: 143 143 return error; 144 144 }
+8 -8
fs/xattr.c
··· 263 263 if (error) 264 264 return error; 265 265 error = setxattr(nd.path.dentry, name, value, size, flags); 266 - path_release(&nd); 266 + path_put(&nd.path); 267 267 return error; 268 268 } 269 269 ··· 278 278 if (error) 279 279 return error; 280 280 error = setxattr(nd.path.dentry, name, value, size, flags); 281 - path_release(&nd); 281 + path_put(&nd.path); 282 282 return error; 283 283 } 284 284 ··· 348 348 if (error) 349 349 return error; 350 350 error = getxattr(nd.path.dentry, name, value, size); 351 - path_release(&nd); 351 + path_put(&nd.path); 352 352 return error; 353 353 } 354 354 ··· 363 363 if (error) 364 364 return error; 365 365 error = getxattr(nd.path.dentry, name, value, size); 366 - path_release(&nd); 366 + path_put(&nd.path); 367 367 return error; 368 368 } 369 369 ··· 422 422 if (error) 423 423 return error; 424 424 error = listxattr(nd.path.dentry, list, size); 425 - path_release(&nd); 425 + path_put(&nd.path); 426 426 return error; 427 427 } 428 428 ··· 436 436 if (error) 437 437 return error; 438 438 error = listxattr(nd.path.dentry, list, size); 439 - path_release(&nd); 439 + path_put(&nd.path); 440 440 return error; 441 441 } 442 442 ··· 483 483 if (error) 484 484 return error; 485 485 error = removexattr(nd.path.dentry, name); 486 - path_release(&nd); 486 + path_put(&nd.path); 487 487 return error; 488 488 } 489 489 ··· 497 497 if (error) 498 498 return error; 499 499 error = removexattr(nd.path.dentry, name); 500 - path_release(&nd); 500 + path_put(&nd.path); 501 501 return error; 502 502 } 503 503
+1 -1
fs/xfs/linux-2.6/xfs_ioctl.c
··· 94 94 ASSERT(nd.path.dentry); 95 95 ASSERT(nd.path.dentry->d_inode); 96 96 inode = igrab(nd.path.dentry->d_inode); 97 - path_release(&nd); 97 + path_put(&nd.path); 98 98 break; 99 99 } 100 100
-1
include/linux/namei.h
··· 66 66 extern int path_lookup(const char *, unsigned, struct nameidata *); 67 67 extern int vfs_path_lookup(struct dentry *, struct vfsmount *, 68 68 const char *, unsigned int, struct nameidata *); 69 - extern void path_release(struct nameidata *); 70 69 71 70 extern int __user_path_lookup_open(const char __user *, unsigned lookup_flags, struct nameidata *nd, int open_flags); 72 71 extern int path_lookup_open(int dfd, const char *name, unsigned lookup_flags, struct nameidata *, int open_flags);
+2
include/linux/path.h
··· 9 9 struct dentry *dentry; 10 10 }; 11 11 12 + extern void path_put(struct path *); 13 + 12 14 #endif /* _LINUX_PATH_H */
+6 -6
kernel/audit_tree.c
··· 550 550 goto skip_it; 551 551 552 552 root_mnt = collect_mounts(nd.path.mnt, nd.path.dentry); 553 - path_release(&nd); 553 + path_put(&nd.path); 554 554 if (!root_mnt) 555 555 goto skip_it; 556 556 ··· 642 642 if (err) 643 643 goto Err; 644 644 mnt = collect_mounts(nd.path.mnt, nd.path.dentry); 645 - path_release(&nd); 645 + path_put(&nd.path); 646 646 if (!mnt) { 647 647 err = -ENOMEM; 648 648 goto Err; ··· 702 702 if (err) 703 703 return err; 704 704 tagged = collect_mounts(nd.path.mnt, nd.path.dentry); 705 - path_release(&nd); 705 + path_put(&nd.path); 706 706 if (!tagged) 707 707 return -ENOMEM; 708 708 ··· 713 713 } 714 714 mnt = mntget(nd.path.mnt); 715 715 dentry = dget(nd.path.dentry); 716 - path_release(&nd); 716 + path_put(&nd.path); 717 717 718 718 if (dentry == tagged->mnt_root && dentry == mnt->mnt_root) 719 719 follow_up(&mnt, &dentry); ··· 744 744 spin_lock(&vfsmount_lock); 745 745 if (!is_under(mnt, dentry, &nd)) { 746 746 spin_unlock(&vfsmount_lock); 747 - path_release(&nd); 747 + path_put(&nd.path); 748 748 put_tree(tree); 749 749 mutex_lock(&audit_filter_mutex); 750 750 continue; 751 751 } 752 752 spin_unlock(&vfsmount_lock); 753 - path_release(&nd); 753 + path_put(&nd.path); 754 754 755 755 list_for_each_entry(p, &list, mnt_list) { 756 756 failed = tag_chunk(p->mnt_root->d_inode, tree);
+2 -2
kernel/auditfilter.c
··· 1161 1161 static void audit_put_nd(struct nameidata *ndp, struct nameidata *ndw) 1162 1162 { 1163 1163 if (ndp) { 1164 - path_release(ndp); 1164 + path_put(&ndp->path); 1165 1165 kfree(ndp); 1166 1166 } 1167 1167 if (ndw) { 1168 - path_release(ndw); 1168 + path_put(&ndw->path); 1169 1169 kfree(ndw); 1170 1170 } 1171 1171 }
+1 -1
net/sunrpc/rpc_pipe.c
··· 495 495 static void 496 496 rpc_release_path(struct nameidata *nd) 497 497 { 498 - path_release(nd); 498 + path_put(&nd->path); 499 499 rpc_put_mount(); 500 500 } 501 501
+3 -3
net/unix/af_unix.c
··· 727 727 if (u->sk_type == type) 728 728 touch_atime(nd.path.mnt, nd.path.dentry); 729 729 730 - path_release(&nd); 730 + path_put(&nd.path); 731 731 732 732 err=-EPROTOTYPE; 733 733 if (u->sk_type != type) { ··· 748 748 return u; 749 749 750 750 put_fail: 751 - path_release(&nd); 751 + path_put(&nd.path); 752 752 fail: 753 753 *error=err; 754 754 return NULL; ··· 862 862 dput(dentry); 863 863 out_mknod_unlock: 864 864 mutex_unlock(&nd.path.dentry->d_inode->i_mutex); 865 - path_release(&nd); 865 + path_put(&nd.path); 866 866 out_mknod_parent: 867 867 if (err==-EEXIST) 868 868 err=-EADDRINUSE;