diff options
-rw-r--r-- | fs/namei.c | 55 |
1 files changed, 27 insertions, 28 deletions
diff --git a/fs/namei.c b/fs/namei.c index 2fb4fe57f4b1..617de9e9967b 100644 --- a/fs/namei.c +++ b/fs/namei.c | |||
@@ -358,6 +358,7 @@ int generic_permission(struct inode *inode, int mask) | |||
358 | 358 | ||
359 | return -EACCES; | 359 | return -EACCES; |
360 | } | 360 | } |
361 | EXPORT_SYMBOL(generic_permission); | ||
361 | 362 | ||
362 | /* | 363 | /* |
363 | * We _really_ want to just do "generic_permission()" without | 364 | * We _really_ want to just do "generic_permission()" without |
@@ -455,6 +456,7 @@ int inode_permission(struct inode *inode, int mask) | |||
455 | return retval; | 456 | return retval; |
456 | return __inode_permission(inode, mask); | 457 | return __inode_permission(inode, mask); |
457 | } | 458 | } |
459 | EXPORT_SYMBOL(inode_permission); | ||
458 | 460 | ||
459 | /** | 461 | /** |
460 | * path_get - get a reference to a path | 462 | * path_get - get a reference to a path |
@@ -924,6 +926,7 @@ int follow_up(struct path *path) | |||
924 | path->mnt = &parent->mnt; | 926 | path->mnt = &parent->mnt; |
925 | return 1; | 927 | return 1; |
926 | } | 928 | } |
929 | EXPORT_SYMBOL(follow_up); | ||
927 | 930 | ||
928 | /* | 931 | /* |
929 | * Perform an automount | 932 | * Perform an automount |
@@ -1085,6 +1088,7 @@ int follow_down_one(struct path *path) | |||
1085 | } | 1088 | } |
1086 | return 0; | 1089 | return 0; |
1087 | } | 1090 | } |
1091 | EXPORT_SYMBOL(follow_down_one); | ||
1088 | 1092 | ||
1089 | static inline bool managed_dentry_might_block(struct dentry *dentry) | 1093 | static inline bool managed_dentry_might_block(struct dentry *dentry) |
1090 | { | 1094 | { |
@@ -1223,6 +1227,7 @@ int follow_down(struct path *path) | |||
1223 | } | 1227 | } |
1224 | return 0; | 1228 | return 0; |
1225 | } | 1229 | } |
1230 | EXPORT_SYMBOL(follow_down); | ||
1226 | 1231 | ||
1227 | /* | 1232 | /* |
1228 | * Skip to top of mountpoint pile in refwalk mode for follow_dotdot() | 1233 | * Skip to top of mountpoint pile in refwalk mode for follow_dotdot() |
@@ -2025,6 +2030,7 @@ int kern_path(const char *name, unsigned int flags, struct path *path) | |||
2025 | *path = nd.path; | 2030 | *path = nd.path; |
2026 | return res; | 2031 | return res; |
2027 | } | 2032 | } |
2033 | EXPORT_SYMBOL(kern_path); | ||
2028 | 2034 | ||
2029 | /** | 2035 | /** |
2030 | * vfs_path_lookup - lookup a file path relative to a dentry-vfsmount pair | 2036 | * vfs_path_lookup - lookup a file path relative to a dentry-vfsmount pair |
@@ -2049,6 +2055,7 @@ int vfs_path_lookup(struct dentry *dentry, struct vfsmount *mnt, | |||
2049 | *path = nd.path; | 2055 | *path = nd.path; |
2050 | return err; | 2056 | return err; |
2051 | } | 2057 | } |
2058 | EXPORT_SYMBOL(vfs_path_lookup); | ||
2052 | 2059 | ||
2053 | /* | 2060 | /* |
2054 | * Restricted form of lookup. Doesn't follow links, single-component only, | 2061 | * Restricted form of lookup. Doesn't follow links, single-component only, |
@@ -2111,6 +2118,7 @@ struct dentry *lookup_one_len(const char *name, struct dentry *base, int len) | |||
2111 | 2118 | ||
2112 | return __lookup_hash(&this, base, 0); | 2119 | return __lookup_hash(&this, base, 0); |
2113 | } | 2120 | } |
2121 | EXPORT_SYMBOL(lookup_one_len); | ||
2114 | 2122 | ||
2115 | int user_path_at_empty(int dfd, const char __user *name, unsigned flags, | 2123 | int user_path_at_empty(int dfd, const char __user *name, unsigned flags, |
2116 | struct path *path, int *empty) | 2124 | struct path *path, int *empty) |
@@ -2135,6 +2143,7 @@ int user_path_at(int dfd, const char __user *name, unsigned flags, | |||
2135 | { | 2143 | { |
2136 | return user_path_at_empty(dfd, name, flags, path, NULL); | 2144 | return user_path_at_empty(dfd, name, flags, path, NULL); |
2137 | } | 2145 | } |
2146 | EXPORT_SYMBOL(user_path_at); | ||
2138 | 2147 | ||
2139 | /* | 2148 | /* |
2140 | * NB: most callers don't do anything directly with the reference to the | 2149 | * NB: most callers don't do anything directly with the reference to the |
@@ -2477,6 +2486,7 @@ struct dentry *lock_rename(struct dentry *p1, struct dentry *p2) | |||
2477 | mutex_lock_nested(&p2->d_inode->i_mutex, I_MUTEX_CHILD); | 2486 | mutex_lock_nested(&p2->d_inode->i_mutex, I_MUTEX_CHILD); |
2478 | return NULL; | 2487 | return NULL; |
2479 | } | 2488 | } |
2489 | EXPORT_SYMBOL(lock_rename); | ||
2480 | 2490 | ||
2481 | void unlock_rename(struct dentry *p1, struct dentry *p2) | 2491 | void unlock_rename(struct dentry *p1, struct dentry *p2) |
2482 | { | 2492 | { |
@@ -2486,6 +2496,7 @@ void unlock_rename(struct dentry *p1, struct dentry *p2) | |||
2486 | mutex_unlock(&p1->d_inode->i_sb->s_vfs_rename_mutex); | 2496 | mutex_unlock(&p1->d_inode->i_sb->s_vfs_rename_mutex); |
2487 | } | 2497 | } |
2488 | } | 2498 | } |
2499 | EXPORT_SYMBOL(unlock_rename); | ||
2489 | 2500 | ||
2490 | int vfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, | 2501 | int vfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, |
2491 | bool want_excl) | 2502 | bool want_excl) |
@@ -2506,6 +2517,7 @@ int vfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, | |||
2506 | fsnotify_create(dir, dentry); | 2517 | fsnotify_create(dir, dentry); |
2507 | return error; | 2518 | return error; |
2508 | } | 2519 | } |
2520 | EXPORT_SYMBOL(vfs_create); | ||
2509 | 2521 | ||
2510 | static int may_open(struct path *path, int acc_mode, int flag) | 2522 | static int may_open(struct path *path, int acc_mode, int flag) |
2511 | { | 2523 | { |
@@ -3376,6 +3388,7 @@ int vfs_mknod(struct inode *dir, struct dentry *dentry, umode_t mode, dev_t dev) | |||
3376 | fsnotify_create(dir, dentry); | 3388 | fsnotify_create(dir, dentry); |
3377 | return error; | 3389 | return error; |
3378 | } | 3390 | } |
3391 | EXPORT_SYMBOL(vfs_mknod); | ||
3379 | 3392 | ||
3380 | static int may_mknod(umode_t mode) | 3393 | static int may_mknod(umode_t mode) |
3381 | { | 3394 | { |
@@ -3465,6 +3478,7 @@ int vfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode) | |||
3465 | fsnotify_mkdir(dir, dentry); | 3478 | fsnotify_mkdir(dir, dentry); |
3466 | return error; | 3479 | return error; |
3467 | } | 3480 | } |
3481 | EXPORT_SYMBOL(vfs_mkdir); | ||
3468 | 3482 | ||
3469 | SYSCALL_DEFINE3(mkdirat, int, dfd, const char __user *, pathname, umode_t, mode) | 3483 | SYSCALL_DEFINE3(mkdirat, int, dfd, const char __user *, pathname, umode_t, mode) |
3470 | { | 3484 | { |
@@ -3519,6 +3533,7 @@ void dentry_unhash(struct dentry *dentry) | |||
3519 | __d_drop(dentry); | 3533 | __d_drop(dentry); |
3520 | spin_unlock(&dentry->d_lock); | 3534 | spin_unlock(&dentry->d_lock); |
3521 | } | 3535 | } |
3536 | EXPORT_SYMBOL(dentry_unhash); | ||
3522 | 3537 | ||
3523 | int vfs_rmdir(struct inode *dir, struct dentry *dentry) | 3538 | int vfs_rmdir(struct inode *dir, struct dentry *dentry) |
3524 | { | 3539 | { |
@@ -3556,6 +3571,7 @@ out: | |||
3556 | d_delete(dentry); | 3571 | d_delete(dentry); |
3557 | return error; | 3572 | return error; |
3558 | } | 3573 | } |
3574 | EXPORT_SYMBOL(vfs_rmdir); | ||
3559 | 3575 | ||
3560 | static long do_rmdir(int dfd, const char __user *pathname) | 3576 | static long do_rmdir(int dfd, const char __user *pathname) |
3561 | { | 3577 | { |
@@ -3673,6 +3689,7 @@ out: | |||
3673 | 3689 | ||
3674 | return error; | 3690 | return error; |
3675 | } | 3691 | } |
3692 | EXPORT_SYMBOL(vfs_unlink); | ||
3676 | 3693 | ||
3677 | /* | 3694 | /* |
3678 | * Make sure that the actual truncation of the file will occur outside its | 3695 | * Make sure that the actual truncation of the file will occur outside its |
@@ -3786,6 +3803,7 @@ int vfs_symlink(struct inode *dir, struct dentry *dentry, const char *oldname) | |||
3786 | fsnotify_create(dir, dentry); | 3803 | fsnotify_create(dir, dentry); |
3787 | return error; | 3804 | return error; |
3788 | } | 3805 | } |
3806 | EXPORT_SYMBOL(vfs_symlink); | ||
3789 | 3807 | ||
3790 | SYSCALL_DEFINE3(symlinkat, const char __user *, oldname, | 3808 | SYSCALL_DEFINE3(symlinkat, const char __user *, oldname, |
3791 | int, newdfd, const char __user *, newname) | 3809 | int, newdfd, const char __user *, newname) |
@@ -3894,6 +3912,7 @@ int vfs_link(struct dentry *old_dentry, struct inode *dir, struct dentry *new_de | |||
3894 | fsnotify_link(dir, inode, new_dentry); | 3912 | fsnotify_link(dir, inode, new_dentry); |
3895 | return error; | 3913 | return error; |
3896 | } | 3914 | } |
3915 | EXPORT_SYMBOL(vfs_link); | ||
3897 | 3916 | ||
3898 | /* | 3917 | /* |
3899 | * Hardlinks are often used in delicate situations. We avoid | 3918 | * Hardlinks are often used in delicate situations. We avoid |
@@ -4156,6 +4175,7 @@ int vfs_rename(struct inode *old_dir, struct dentry *old_dentry, | |||
4156 | 4175 | ||
4157 | return error; | 4176 | return error; |
4158 | } | 4177 | } |
4178 | EXPORT_SYMBOL(vfs_rename); | ||
4159 | 4179 | ||
4160 | SYSCALL_DEFINE4(renameat, int, olddfd, const char __user *, oldname, | 4180 | SYSCALL_DEFINE4(renameat, int, olddfd, const char __user *, oldname, |
4161 | int, newdfd, const char __user *, newname) | 4181 | int, newdfd, const char __user *, newname) |
@@ -4293,6 +4313,7 @@ int vfs_readlink(struct dentry *dentry, char __user *buffer, int buflen, const c | |||
4293 | out: | 4313 | out: |
4294 | return len; | 4314 | return len; |
4295 | } | 4315 | } |
4316 | EXPORT_SYMBOL(vfs_readlink); | ||
4296 | 4317 | ||
4297 | /* | 4318 | /* |
4298 | * A helper for ->readlink(). This should be used *ONLY* for symlinks that | 4319 | * A helper for ->readlink(). This should be used *ONLY* for symlinks that |
@@ -4315,6 +4336,7 @@ int generic_readlink(struct dentry *dentry, char __user *buffer, int buflen) | |||
4315 | dentry->d_inode->i_op->put_link(dentry, &nd, cookie); | 4336 | dentry->d_inode->i_op->put_link(dentry, &nd, cookie); |
4316 | return res; | 4337 | return res; |
4317 | } | 4338 | } |
4339 | EXPORT_SYMBOL(generic_readlink); | ||
4318 | 4340 | ||
4319 | /* get the link contents into pagecache */ | 4341 | /* get the link contents into pagecache */ |
4320 | static char *page_getlink(struct dentry * dentry, struct page **ppage) | 4342 | static char *page_getlink(struct dentry * dentry, struct page **ppage) |
@@ -4342,6 +4364,7 @@ int page_readlink(struct dentry *dentry, char __user *buffer, int buflen) | |||
4342 | } | 4364 | } |
4343 | return res; | 4365 | return res; |
4344 | } | 4366 | } |
4367 | EXPORT_SYMBOL(page_readlink); | ||
4345 | 4368 | ||
4346 | void *page_follow_link_light(struct dentry *dentry, struct nameidata *nd) | 4369 | void *page_follow_link_light(struct dentry *dentry, struct nameidata *nd) |
4347 | { | 4370 | { |
@@ -4349,6 +4372,7 @@ void *page_follow_link_light(struct dentry *dentry, struct nameidata *nd) | |||
4349 | nd_set_link(nd, page_getlink(dentry, &page)); | 4372 | nd_set_link(nd, page_getlink(dentry, &page)); |
4350 | return page; | 4373 | return page; |
4351 | } | 4374 | } |
4375 | EXPORT_SYMBOL(page_follow_link_light); | ||
4352 | 4376 | ||
4353 | void page_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie) | 4377 | void page_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie) |
4354 | { | 4378 | { |
@@ -4359,6 +4383,7 @@ void page_put_link(struct dentry *dentry, struct nameidata *nd, void *cookie) | |||
4359 | page_cache_release(page); | 4383 | page_cache_release(page); |
4360 | } | 4384 | } |
4361 | } | 4385 | } |
4386 | EXPORT_SYMBOL(page_put_link); | ||
4362 | 4387 | ||
4363 | /* | 4388 | /* |
4364 | * The nofs argument instructs pagecache_write_begin to pass AOP_FLAG_NOFS | 4389 | * The nofs argument instructs pagecache_write_begin to pass AOP_FLAG_NOFS |
@@ -4396,44 +4421,18 @@ retry: | |||
4396 | fail: | 4421 | fail: |
4397 | return err; | 4422 | return err; |
4398 | } | 4423 | } |
4424 | EXPORT_SYMBOL(__page_symlink); | ||
4399 | 4425 | ||
4400 | int page_symlink(struct inode *inode, const char *symname, int len) | 4426 | int page_symlink(struct inode *inode, const char *symname, int len) |
4401 | { | 4427 | { |
4402 | return __page_symlink(inode, symname, len, | 4428 | return __page_symlink(inode, symname, len, |
4403 | !(mapping_gfp_mask(inode->i_mapping) & __GFP_FS)); | 4429 | !(mapping_gfp_mask(inode->i_mapping) & __GFP_FS)); |
4404 | } | 4430 | } |
4431 | EXPORT_SYMBOL(page_symlink); | ||
4405 | 4432 | ||
4406 | const struct inode_operations page_symlink_inode_operations = { | 4433 | const struct inode_operations page_symlink_inode_operations = { |
4407 | .readlink = generic_readlink, | 4434 | .readlink = generic_readlink, |
4408 | .follow_link = page_follow_link_light, | 4435 | .follow_link = page_follow_link_light, |
4409 | .put_link = page_put_link, | 4436 | .put_link = page_put_link, |
4410 | }; | 4437 | }; |
4411 | |||
4412 | EXPORT_SYMBOL(user_path_at); | ||
4413 | EXPORT_SYMBOL(follow_down_one); | ||
4414 | EXPORT_SYMBOL(follow_down); | ||
4415 | EXPORT_SYMBOL(follow_up); | ||
4416 | EXPORT_SYMBOL(lock_rename); | ||
4417 | EXPORT_SYMBOL(lookup_one_len); | ||
4418 | EXPORT_SYMBOL(page_follow_link_light); | ||
4419 | EXPORT_SYMBOL(page_put_link); | ||
4420 | EXPORT_SYMBOL(page_readlink); | ||
4421 | EXPORT_SYMBOL(__page_symlink); | ||
4422 | EXPORT_SYMBOL(page_symlink); | ||
4423 | EXPORT_SYMBOL(page_symlink_inode_operations); | 4438 | EXPORT_SYMBOL(page_symlink_inode_operations); |
4424 | EXPORT_SYMBOL(kern_path); | ||
4425 | EXPORT_SYMBOL(vfs_path_lookup); | ||
4426 | EXPORT_SYMBOL(inode_permission); | ||
4427 | EXPORT_SYMBOL(unlock_rename); | ||
4428 | EXPORT_SYMBOL(vfs_create); | ||
4429 | EXPORT_SYMBOL(vfs_link); | ||
4430 | EXPORT_SYMBOL(vfs_mkdir); | ||
4431 | EXPORT_SYMBOL(vfs_mknod); | ||
4432 | EXPORT_SYMBOL(generic_permission); | ||
4433 | EXPORT_SYMBOL(vfs_readlink); | ||
4434 | EXPORT_SYMBOL(vfs_rename); | ||
4435 | EXPORT_SYMBOL(vfs_rmdir); | ||
4436 | EXPORT_SYMBOL(vfs_symlink); | ||
4437 | EXPORT_SYMBOL(vfs_unlink); | ||
4438 | EXPORT_SYMBOL(dentry_unhash); | ||
4439 | EXPORT_SYMBOL(generic_readlink); | ||