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

[PATCH vfs-2.6 6/6] vfs: add LOOKUP_RENAME_TARGET intent

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 <hirofumi@mail.parknet.co.jp>

authored by

OGAWA Hirofumi and committed by
Al Viro
4e9ed2f8 0612d9fb

+2
+1
fs/namei.c
··· 2654 2654 2655 2655 oldnd.flags &= ~LOOKUP_PARENT; 2656 2656 newnd.flags &= ~LOOKUP_PARENT; 2657 + newnd.flags |= LOOKUP_RENAME_TARGET; 2657 2658 2658 2659 trap = lock_rename(new_dir, old_dir); 2659 2660
+1
include/linux/namei.h
··· 54 54 #define LOOKUP_OPEN 0x0100 55 55 #define LOOKUP_CREATE 0x0200 56 56 #define LOOKUP_EXCL 0x0400 57 + #define LOOKUP_RENAME_TARGET 0x0800 57 58 58 59 extern int user_path_at(int, const char __user *, unsigned, struct path *); 59 60