Skip to content

Commit 4d94ce8

Browse files
neilbrownbrauner
authored andcommitted
VFS: unexport lock_rename(), lock_rename_child(), unlock_rename()
These three function are now only used in namei.c, so they don't need to be exported. Reviewed-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: NeilBrown <neil@brown.name> Link: https://patch.msgid.link/20260224222542.3458677-16-neilb@ownmail.net Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent 54d7ea7 commit 4d94ce8

3 files changed

Lines changed: 10 additions & 9 deletions

File tree

Documentation/filesystems/porting.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1368,3 +1368,10 @@ lifetime, consider using inode_set_cached_link() instead.
13681368

13691369
lookup_one_qstr_excl() is no longer exported - use start_creating() or
13701370
similar.
1371+
---
1372+
1373+
** mandatory**
1374+
1375+
lock_rename(), lock_rename_child(), unlock_rename() are no
1376+
longer available. Use start_renaming() or similar.
1377+

fs/namei.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3775,7 +3775,7 @@ static struct dentry *lock_two_directories(struct dentry *p1, struct dentry *p2)
37753775
/*
37763776
* p1 and p2 should be directories on the same fs.
37773777
*/
3778-
struct dentry *lock_rename(struct dentry *p1, struct dentry *p2)
3778+
static struct dentry *lock_rename(struct dentry *p1, struct dentry *p2)
37793779
{
37803780
if (p1 == p2) {
37813781
inode_lock_nested(p1->d_inode, I_MUTEX_PARENT);
@@ -3785,12 +3785,11 @@ struct dentry *lock_rename(struct dentry *p1, struct dentry *p2)
37853785
mutex_lock(&p1->d_sb->s_vfs_rename_mutex);
37863786
return lock_two_directories(p1, p2);
37873787
}
3788-
EXPORT_SYMBOL(lock_rename);
37893788

37903789
/*
37913790
* c1 and p2 should be on the same fs.
37923791
*/
3793-
struct dentry *lock_rename_child(struct dentry *c1, struct dentry *p2)
3792+
static struct dentry *lock_rename_child(struct dentry *c1, struct dentry *p2)
37943793
{
37953794
if (READ_ONCE(c1->d_parent) == p2) {
37963795
/*
@@ -3827,17 +3826,15 @@ struct dentry *lock_rename_child(struct dentry *c1, struct dentry *p2)
38273826
mutex_unlock(&c1->d_sb->s_vfs_rename_mutex);
38283827
return NULL;
38293828
}
3830-
EXPORT_SYMBOL(lock_rename_child);
38313829

3832-
void unlock_rename(struct dentry *p1, struct dentry *p2)
3830+
static void unlock_rename(struct dentry *p1, struct dentry *p2)
38333831
{
38343832
inode_unlock(p1->d_inode);
38353833
if (p1 != p2) {
38363834
inode_unlock(p2->d_inode);
38373835
mutex_unlock(&p1->d_sb->s_vfs_rename_mutex);
38383836
}
38393837
}
3840-
EXPORT_SYMBOL(unlock_rename);
38413838

38423839
/**
38433840
* __start_renaming - lookup and lock names for rename

include/linux/namei.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,6 @@ extern int follow_down_one(struct path *);
165165
extern int follow_down(struct path *path, unsigned int flags);
166166
extern int follow_up(struct path *);
167167

168-
extern struct dentry *lock_rename(struct dentry *, struct dentry *);
169-
extern struct dentry *lock_rename_child(struct dentry *, struct dentry *);
170-
extern void unlock_rename(struct dentry *, struct dentry *);
171168
int start_renaming(struct renamedata *rd, int lookup_flags,
172169
struct qstr *old_last, struct qstr *new_last);
173170
int start_renaming_dentry(struct renamedata *rd, int lookup_flags,

0 commit comments

Comments
 (0)