Skip to content

Commit

Permalink
[PATCH vfs-2.6 6/6] vfs: add LOOKUP_RENAME_TARGET intent
Browse files Browse the repository at this point in the history
This adds LOOKUP_RENAME_TARGET intent for lookup of rename destination.

LOOKUP_RENAME_TARGET is going to be used like LOOKUP_CREATE. But since
the destination of rename() can be existing directory entry, so it has a
difference. Although that difference doesn't matter in my usage, this
tells it to user of this intent.

Signed-off-by: OGAWA Hirofumi <[email protected]>
  • Loading branch information
OGAWAHirofumi authored and Al Viro committed Oct 23, 2008
1 parent 0612d9f commit 4e9ed2f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions fs/namei.c
Original file line number Diff line number Diff line change
Expand Up @@ -2654,6 +2654,7 @@ asmlinkage long sys_renameat(int olddfd, const char __user *oldname,

oldnd.flags &= ~LOOKUP_PARENT;
newnd.flags &= ~LOOKUP_PARENT;
newnd.flags |= LOOKUP_RENAME_TARGET;

trap = lock_rename(new_dir, old_dir);

Expand Down
1 change: 1 addition & 0 deletions include/linux/namei.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND};
#define LOOKUP_OPEN 0x0100
#define LOOKUP_CREATE 0x0200
#define LOOKUP_EXCL 0x0400
#define LOOKUP_RENAME_TARGET 0x0800

extern int user_path_at(int, const char __user *, unsigned, struct path *);

Expand Down

0 comments on commit 4e9ed2f

Please sign in to comment.