mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: viro@zeniv.linux.org.uk
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
	hirofumi@mail.parknet.co.jp
Subject: [PATCH vfs-2.6 6/6] vfs: add LOOKUP_RENAME_TARGET intent
Date: Thu, 16 Oct 2008 07:50:29 +0900	[thread overview]
Message-ID: <11d623e93e848f673b5620397.ps@mail.parknet.co.jp> (raw)
In-Reply-To: <e8c7efff3e848f673b5520397.ps@mail.parknet.co.jp>


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>
---

 fs/namei.c            |    1 +
 include/linux/namei.h |    1 +
 2 files changed, 2 insertions(+)

diff -puN fs/namei.c~dcache-add-rename-intent fs/namei.c
--- vfs-2.6/fs/namei.c~dcache-add-rename-intent	2008-10-16 06:57:40.000000000 +0900
+++ vfs-2.6-hirofumi/fs/namei.c	2008-10-16 06:57:40.000000000 +0900
@@ -2654,6 +2654,7 @@ asmlinkage long sys_renameat(int olddfd,
 
 	oldnd.flags &= ~LOOKUP_PARENT;
 	newnd.flags &= ~LOOKUP_PARENT;
+	newnd.flags |= LOOKUP_RENAME_TARGET;
 
 	trap = lock_rename(new_dir, old_dir);
 
diff -puN include/linux/namei.h~dcache-add-rename-intent include/linux/namei.h
--- vfs-2.6/include/linux/namei.h~dcache-add-rename-intent	2008-10-16 06:57:40.000000000 +0900
+++ vfs-2.6-hirofumi/include/linux/namei.h	2008-10-16 06:58:05.000000000 +0900
@@ -54,6 +54,7 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LA
 #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 *);
 
_

  reply	other threads:[~2008-10-15 22:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-15 22:50 [PATCH vfs-2.6 1/6] vfs: replace parent == dentry->d_parent by IS_ROOT() OGAWA Hirofumi
2008-10-15 22:50 ` [PATCH vfs-2.6 2/6] vfs: add d_ancestor() OGAWA Hirofumi
2008-10-15 22:50   ` [PATCH vfs-2.6 3/6] vfs: add __d_instantiate() helper OGAWA Hirofumi
2008-10-15 22:50     ` [PATCH vfs-2.6 4/6] vfs: remove unnecessary fsnotify_d_instantiate() OGAWA Hirofumi
2008-10-15 22:50       ` [PATCH vfs-2.6 5/6] vfs: remove LOOKUP_PARENT from non LOOKUP_PARENT lookup OGAWA Hirofumi
2008-10-15 22:50         ` OGAWA Hirofumi [this message]
2008-10-16 22:29           ` [PATCH vfs-2.6 6/6] vfs: add LOOKUP_RENAME_TARGET intent Andrew Morton
2008-10-16 23:30             ` OGAWA Hirofumi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=11d623e93e848f673b5620397.ps@mail.parknet.co.jp \
    --to=hirofumi@mail.parknet.co.jp \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®