aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/filesystems/vfs.txt
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2014-04-01 11:08:42 -0400
committerMiklos Szeredi <mszeredi@suse.cz>2014-04-01 11:08:42 -0400
commit520c8b16505236fc82daa352e6c5e73cd9870cff (patch)
treee61b78440874e083928821423e226c0ecc2d6647 /Documentation/filesystems/vfs.txt
parentbc27027a73e8b80376b51a1583ad1c7445605e8a (diff)
vfs: add renameat2 syscall
Add new renameat2 syscall, which is the same as renameat with an added flags argument. Pass flags to vfs_rename() and to i_op->rename() as well. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Reviewed-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'Documentation/filesystems/vfs.txt')
-rw-r--r--Documentation/filesystems/vfs.txt16
1 files changed, 16 insertions, 0 deletions
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt
index c53784c119c8..94eb86287bcb 100644
--- a/Documentation/filesystems/vfs.txt
+++ b/Documentation/filesystems/vfs.txt
@@ -347,6 +347,8 @@ struct inode_operations {
347 int (*mknod) (struct inode *,struct dentry *,umode_t,dev_t); 347 int (*mknod) (struct inode *,struct dentry *,umode_t,dev_t);
348 int (*rename) (struct inode *, struct dentry *, 348 int (*rename) (struct inode *, struct dentry *,
349 struct inode *, struct dentry *); 349 struct inode *, struct dentry *);
350 int (*rename2) (struct inode *, struct dentry *,
351 struct inode *, struct dentry *, unsigned int);
350 int (*readlink) (struct dentry *, char __user *,int); 352 int (*readlink) (struct dentry *, char __user *,int);
351 void * (*follow_link) (struct dentry *, struct nameidata *); 353 void * (*follow_link) (struct dentry *, struct nameidata *);
352 void (*put_link) (struct dentry *, struct nameidata *, void *); 354 void (*put_link) (struct dentry *, struct nameidata *, void *);
@@ -414,6 +416,20 @@ otherwise noted.
414 rename: called by the rename(2) system call to rename the object to 416 rename: called by the rename(2) system call to rename the object to
415 have the parent and name given by the second inode and dentry. 417 have the parent and name given by the second inode and dentry.
416 418
419 rename2: this has an additional flags argument compared to rename.
420 If no flags are supported by the filesystem then this method
421 need not be implemented. If some flags are supported then the
422 filesystem must return -EINVAL for any unsupported or unknown
423 flags. Currently the following flags are implemented:
424 (1) RENAME_NOREPLACE: this flag indicates that if the target
425 of the rename exists the rename should fail with -EEXIST
426 instead of replacing the target. The VFS already checks for
427 existence, so for local filesystems the RENAME_NOREPLACE
428 implementation is equivalent to plain rename.
429 (2) RENAME_EXCHANGE: exchange source and target. Both must
430 exist; this is checked by the VFS. Unlike plain rename,
431 source and target may be of different type.
432
417 readlink: called by the readlink(2) system call. Only required if 433 readlink: called by the readlink(2) system call. Only required if
418 you want to support reading symbolic links 434 you want to support reading symbolic links
419 435