mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
don't pass nameidata to ->create()
boolean "does it have to be exclusive?" flag is passed instead; Local filesystem should just ignore it - the object is guaranteed not to be there yet. Change-Id: I25efea9892458f6f64070c62bd1adb5194dcd8c1 Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
4ff32315d8
commit
dcb9cda2ea
53 changed files with 65 additions and 67 deletions
|
@ -37,7 +37,7 @@ d_manage: no no yes (ref-walk) maybe
|
||||||
|
|
||||||
--------------------------- inode_operations ---------------------------
|
--------------------------- inode_operations ---------------------------
|
||||||
prototypes:
|
prototypes:
|
||||||
int (*create) (struct inode *,struct dentry *,umode_t, struct nameidata *);
|
int (*create) (struct inode *,struct dentry *,umode_t, bool);
|
||||||
struct dentry * (*lookup) (struct inode *,struct dentry *, unsigned int);
|
struct dentry * (*lookup) (struct inode *,struct dentry *, unsigned int);
|
||||||
int (*link) (struct dentry *,struct inode *,struct dentry *);
|
int (*link) (struct dentry *,struct inode *,struct dentry *);
|
||||||
int (*unlink) (struct inode *,struct dentry *);
|
int (*unlink) (struct inode *,struct dentry *);
|
||||||
|
|
|
@ -440,3 +440,9 @@ d_make_root() drops the reference to inode if dentry allocation fails.
|
||||||
[mandatory]
|
[mandatory]
|
||||||
The witch is dead! Well, 2/3 of it, anyway. ->d_revalidate() and
|
The witch is dead! Well, 2/3 of it, anyway. ->d_revalidate() and
|
||||||
->lookup() do *not* take struct nameidata anymore; just the flags.
|
->lookup() do *not* take struct nameidata anymore; just the flags.
|
||||||
|
--
|
||||||
|
[mandatory]
|
||||||
|
->create() doesn't take struct nameidata *; unlike the previous
|
||||||
|
two, it gets "is it an O_EXCL or equivalent?" boolean argument. Note that
|
||||||
|
local filesystems can ignore tha argument - they are guaranteed that the
|
||||||
|
object doesn't exist. It's remote/distributed ones that might care...
|
||||||
|
|
|
@ -341,7 +341,7 @@ This describes how the VFS can manipulate an inode in your
|
||||||
filesystem. As of kernel 2.6.22, the following members are defined:
|
filesystem. As of kernel 2.6.22, the following members are defined:
|
||||||
|
|
||||||
struct inode_operations {
|
struct inode_operations {
|
||||||
int (*create) (struct inode *,struct dentry *, umode_t, struct nameidata *);
|
int (*create) (struct inode *,struct dentry *, umode_t, bool);
|
||||||
struct dentry * (*lookup) (struct inode *,struct dentry *, unsigned int);
|
struct dentry * (*lookup) (struct inode *,struct dentry *, unsigned int);
|
||||||
int (*link) (struct dentry *,struct inode *,struct dentry *);
|
int (*link) (struct dentry *,struct inode *,struct dentry *);
|
||||||
int (*unlink) (struct inode *,struct dentry *);
|
int (*unlink) (struct inode *,struct dentry *);
|
||||||
|
|
|
@ -724,7 +724,7 @@ error:
|
||||||
|
|
||||||
static int
|
static int
|
||||||
v9fs_vfs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
v9fs_vfs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
||||||
struct nameidata *nd)
|
bool excl)
|
||||||
{
|
{
|
||||||
struct v9fs_session_info *v9ses = v9fs_inode2v9ses(dir);
|
struct v9fs_session_info *v9ses = v9fs_inode2v9ses(dir);
|
||||||
u32 perm = unixmode2p9mode(v9ses, mode);
|
u32 perm = unixmode2p9mode(v9ses, mode);
|
||||||
|
|
|
@ -252,7 +252,7 @@ int v9fs_open_to_dotl_flags(int flags)
|
||||||
|
|
||||||
static int
|
static int
|
||||||
v9fs_vfs_create_dotl(struct inode *dir, struct dentry *dentry, umode_t omode,
|
v9fs_vfs_create_dotl(struct inode *dir, struct dentry *dentry, umode_t omode,
|
||||||
struct nameidata *nd)
|
bool excl)
|
||||||
{
|
{
|
||||||
return v9fs_vfs_mknod_dotl(dir, dentry, omode, 0);
|
return v9fs_vfs_mknod_dotl(dir, dentry, omode, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -156,7 +156,7 @@ extern void affs_free_bitmap(struct super_block *sb);
|
||||||
extern int affs_hash_name(struct super_block *sb, const u8 *name, unsigned int len);
|
extern int affs_hash_name(struct super_block *sb, const u8 *name, unsigned int len);
|
||||||
extern struct dentry *affs_lookup(struct inode *dir, struct dentry *dentry, unsigned int);
|
extern struct dentry *affs_lookup(struct inode *dir, struct dentry *dentry, unsigned int);
|
||||||
extern int affs_unlink(struct inode *dir, struct dentry *dentry);
|
extern int affs_unlink(struct inode *dir, struct dentry *dentry);
|
||||||
extern int affs_create(struct inode *dir, struct dentry *dentry, umode_t mode, struct nameidata *);
|
extern int affs_create(struct inode *dir, struct dentry *dentry, umode_t mode, bool);
|
||||||
extern int affs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode);
|
extern int affs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode);
|
||||||
extern int affs_rmdir(struct inode *dir, struct dentry *dentry);
|
extern int affs_rmdir(struct inode *dir, struct dentry *dentry);
|
||||||
extern int affs_link(struct dentry *olddentry, struct inode *dir,
|
extern int affs_link(struct dentry *olddentry, struct inode *dir,
|
||||||
|
|
|
@ -255,7 +255,7 @@ affs_unlink(struct inode *dir, struct dentry *dentry)
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
affs_create(struct inode *dir, struct dentry *dentry, umode_t mode, struct nameidata *nd)
|
affs_create(struct inode *dir, struct dentry *dentry, umode_t mode, bool excl)
|
||||||
{
|
{
|
||||||
struct super_block *sb = dir->i_sb;
|
struct super_block *sb = dir->i_sb;
|
||||||
struct inode *inode;
|
struct inode *inode;
|
||||||
|
|
|
@ -29,7 +29,7 @@ static void afs_d_release(struct dentry *dentry);
|
||||||
static int afs_lookup_filldir(void *_cookie, const char *name, int nlen,
|
static int afs_lookup_filldir(void *_cookie, const char *name, int nlen,
|
||||||
loff_t fpos, u64 ino, unsigned dtype);
|
loff_t fpos, u64 ino, unsigned dtype);
|
||||||
static int afs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
static int afs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
||||||
struct nameidata *nd);
|
bool excl);
|
||||||
static int afs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode);
|
static int afs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode);
|
||||||
static int afs_rmdir(struct inode *dir, struct dentry *dentry);
|
static int afs_rmdir(struct inode *dir, struct dentry *dentry);
|
||||||
static int afs_unlink(struct inode *dir, struct dentry *dentry);
|
static int afs_unlink(struct inode *dir, struct dentry *dentry);
|
||||||
|
@ -949,7 +949,7 @@ error:
|
||||||
* create a regular file on an AFS filesystem
|
* create a regular file on an AFS filesystem
|
||||||
*/
|
*/
|
||||||
static int afs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
static int afs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
||||||
struct nameidata *nd)
|
bool excl)
|
||||||
{
|
{
|
||||||
struct afs_file_status status;
|
struct afs_file_status status;
|
||||||
struct afs_callback cb;
|
struct afs_callback cb;
|
||||||
|
|
|
@ -173,7 +173,7 @@ static const struct file_operations bad_file_ops =
|
||||||
};
|
};
|
||||||
|
|
||||||
static int bad_inode_create (struct inode *dir, struct dentry *dentry,
|
static int bad_inode_create (struct inode *dir, struct dentry *dentry,
|
||||||
umode_t mode, struct nameidata *nd)
|
umode_t mode, bool excl)
|
||||||
{
|
{
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,7 +85,7 @@ const struct file_operations bfs_dir_operations = {
|
||||||
extern void dump_imap(const char *, struct super_block *);
|
extern void dump_imap(const char *, struct super_block *);
|
||||||
|
|
||||||
static int bfs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
static int bfs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
||||||
struct nameidata *nd)
|
bool excl)
|
||||||
{
|
{
|
||||||
int err;
|
int err;
|
||||||
struct inode *inode;
|
struct inode *inode;
|
||||||
|
|
|
@ -4860,7 +4860,7 @@ out_unlock:
|
||||||
}
|
}
|
||||||
|
|
||||||
static int btrfs_create(struct inode *dir, struct dentry *dentry,
|
static int btrfs_create(struct inode *dir, struct dentry *dentry,
|
||||||
umode_t mode, struct nameidata *nd)
|
umode_t mode, bool excl)
|
||||||
{
|
{
|
||||||
struct btrfs_trans_handle *trans;
|
struct btrfs_trans_handle *trans;
|
||||||
struct btrfs_root *root = BTRFS_I(dir)->root;
|
struct btrfs_root *root = BTRFS_I(dir)->root;
|
||||||
|
|
|
@ -730,7 +730,7 @@ static int ceph_mknod(struct inode *dir, struct dentry *dentry,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ceph_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
static int ceph_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
||||||
struct nameidata *nd)
|
bool excl)
|
||||||
{
|
{
|
||||||
return ceph_mknod(dir, dentry, mode, 0);
|
return ceph_mknod(dir, dentry, mode, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,7 @@ extern void cifs_sb_deactive(struct super_block *sb);
|
||||||
extern const struct inode_operations cifs_dir_inode_ops;
|
extern const struct inode_operations cifs_dir_inode_ops;
|
||||||
extern struct inode *cifs_root_iget(struct super_block *);
|
extern struct inode *cifs_root_iget(struct super_block *);
|
||||||
extern int cifs_create(struct inode *, struct dentry *, umode_t,
|
extern int cifs_create(struct inode *, struct dentry *, umode_t,
|
||||||
struct nameidata *);
|
bool excl);
|
||||||
extern int cifs_atomic_open(struct inode *, struct dentry *,
|
extern int cifs_atomic_open(struct inode *, struct dentry *,
|
||||||
struct file *, unsigned, umode_t,
|
struct file *, unsigned, umode_t,
|
||||||
int *);
|
int *);
|
||||||
|
|
|
@ -451,7 +451,7 @@ free_xid:
|
||||||
}
|
}
|
||||||
|
|
||||||
int cifs_create(struct inode *inode, struct dentry *direntry, umode_t mode,
|
int cifs_create(struct inode *inode, struct dentry *direntry, umode_t mode,
|
||||||
struct nameidata *nd)
|
bool excl)
|
||||||
{
|
{
|
||||||
int rc;
|
int rc;
|
||||||
int xid = GetXid();
|
int xid = GetXid();
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
#include "coda_int.h"
|
#include "coda_int.h"
|
||||||
|
|
||||||
/* dir inode-ops */
|
/* dir inode-ops */
|
||||||
static int coda_create(struct inode *dir, struct dentry *new, umode_t mode, struct nameidata *nd);
|
static int coda_create(struct inode *dir, struct dentry *new, umode_t mode, bool excl);
|
||||||
static struct dentry *coda_lookup(struct inode *dir, struct dentry *target, unsigned int flags);
|
static struct dentry *coda_lookup(struct inode *dir, struct dentry *target, unsigned int flags);
|
||||||
static int coda_link(struct dentry *old_dentry, struct inode *dir_inode,
|
static int coda_link(struct dentry *old_dentry, struct inode *dir_inode,
|
||||||
struct dentry *entry);
|
struct dentry *entry);
|
||||||
|
@ -188,7 +188,7 @@ static inline void coda_dir_drop_nlink(struct inode *dir)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* creation routines: create, mknod, mkdir, link, symlink */
|
/* creation routines: create, mknod, mkdir, link, symlink */
|
||||||
static int coda_create(struct inode *dir, struct dentry *de, umode_t mode, struct nameidata *nd)
|
static int coda_create(struct inode *dir, struct dentry *de, umode_t mode, bool excl)
|
||||||
{
|
{
|
||||||
int error;
|
int error;
|
||||||
const char *name=de->d_name.name;
|
const char *name=de->d_name.name;
|
||||||
|
|
|
@ -267,7 +267,6 @@ out:
|
||||||
* @dir: The inode of the directory in which to create the file.
|
* @dir: The inode of the directory in which to create the file.
|
||||||
* @dentry: The eCryptfs dentry
|
* @dentry: The eCryptfs dentry
|
||||||
* @mode: The mode of the new file.
|
* @mode: The mode of the new file.
|
||||||
* @nd: nameidata
|
|
||||||
*
|
*
|
||||||
* Creates a new file.
|
* Creates a new file.
|
||||||
*
|
*
|
||||||
|
@ -275,7 +274,7 @@ out:
|
||||||
*/
|
*/
|
||||||
static int
|
static int
|
||||||
ecryptfs_create(struct inode *directory_inode, struct dentry *ecryptfs_dentry,
|
ecryptfs_create(struct inode *directory_inode, struct dentry *ecryptfs_dentry,
|
||||||
umode_t mode, struct nameidata *nd)
|
umode_t mode, bool excl)
|
||||||
{
|
{
|
||||||
struct inode *ecryptfs_inode;
|
struct inode *ecryptfs_inode;
|
||||||
int rc;
|
int rc;
|
||||||
|
|
|
@ -60,7 +60,7 @@ static struct dentry *exofs_lookup(struct inode *dir, struct dentry *dentry,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int exofs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
static int exofs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
||||||
struct nameidata *nd)
|
bool excl)
|
||||||
{
|
{
|
||||||
struct inode *inode = exofs_new_inode(dir, mode);
|
struct inode *inode = exofs_new_inode(dir, mode);
|
||||||
int err = PTR_ERR(inode);
|
int err = PTR_ERR(inode);
|
||||||
|
|
|
@ -94,7 +94,7 @@ struct dentry *ext2_get_parent(struct dentry *child)
|
||||||
* If the create succeeds, we fill in the inode information
|
* If the create succeeds, we fill in the inode information
|
||||||
* with d_instantiate().
|
* with d_instantiate().
|
||||||
*/
|
*/
|
||||||
static int ext2_create (struct inode * dir, struct dentry * dentry, umode_t mode, struct nameidata *nd)
|
static int ext2_create (struct inode * dir, struct dentry * dentry, umode_t mode, bool excl)
|
||||||
{
|
{
|
||||||
struct inode *inode;
|
struct inode *inode;
|
||||||
|
|
||||||
|
|
|
@ -1687,7 +1687,7 @@ static int ext3_add_nondir(handle_t *handle,
|
||||||
* with d_instantiate().
|
* with d_instantiate().
|
||||||
*/
|
*/
|
||||||
static int ext3_create (struct inode * dir, struct dentry * dentry, umode_t mode,
|
static int ext3_create (struct inode * dir, struct dentry * dentry, umode_t mode,
|
||||||
struct nameidata *nd)
|
bool excl)
|
||||||
{
|
{
|
||||||
handle_t *handle;
|
handle_t *handle;
|
||||||
struct inode * inode;
|
struct inode * inode;
|
||||||
|
|
|
@ -1759,7 +1759,7 @@ static int ext4_add_nondir(handle_t *handle,
|
||||||
* with d_instantiate().
|
* with d_instantiate().
|
||||||
*/
|
*/
|
||||||
static int ext4_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
static int ext4_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
||||||
struct nameidata *nd)
|
bool excl)
|
||||||
{
|
{
|
||||||
handle_t *handle;
|
handle_t *handle;
|
||||||
struct inode *inode;
|
struct inode *inode;
|
||||||
|
|
|
@ -121,7 +121,7 @@ static inline void set_cold_files(struct f2fs_sb_info *sbi, struct inode *inode,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int f2fs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
static int f2fs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
||||||
struct nameidata *nd)
|
bool excl)
|
||||||
{
|
{
|
||||||
struct f2fs_sb_info *sbi = F2FS_I_SB(dir);
|
struct f2fs_sb_info *sbi = F2FS_I_SB(dir);
|
||||||
struct inode *inode;
|
struct inode *inode;
|
||||||
|
|
|
@ -265,7 +265,7 @@ static int msdos_add_entry(struct inode *dir, const unsigned char *name,
|
||||||
|
|
||||||
/***** Create a file */
|
/***** Create a file */
|
||||||
static int msdos_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
static int msdos_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
||||||
struct nameidata *nd)
|
bool excl)
|
||||||
{
|
{
|
||||||
struct super_block *sb = dir->i_sb;
|
struct super_block *sb = dir->i_sb;
|
||||||
struct inode *inode = NULL;
|
struct inode *inode = NULL;
|
||||||
|
|
|
@ -772,7 +772,7 @@ error:
|
||||||
}
|
}
|
||||||
|
|
||||||
static int vfat_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
static int vfat_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
||||||
struct nameidata *nd)
|
bool excl)
|
||||||
{
|
{
|
||||||
struct super_block *sb = dir->i_sb;
|
struct super_block *sb = dir->i_sb;
|
||||||
struct inode *inode;
|
struct inode *inode;
|
||||||
|
|
|
@ -656,7 +656,7 @@ static int fuse_mknod(struct inode *dir, struct dentry *entry, umode_t mode,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int fuse_create(struct inode *dir, struct dentry *entry, umode_t mode,
|
static int fuse_create(struct inode *dir, struct dentry *entry, umode_t mode,
|
||||||
struct nameidata *nd)
|
bool excl)
|
||||||
{
|
{
|
||||||
return fuse_mknod(dir, entry, mode, 0);
|
return fuse_mknod(dir, entry, mode, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -755,11 +755,8 @@ fail:
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static int gfs2_create(struct inode *dir, struct dentry *dentry,
|
static int gfs2_create(struct inode *dir, struct dentry *dentry,
|
||||||
umode_t mode, struct nameidata *nd)
|
umode_t mode, bool excl)
|
||||||
{
|
{
|
||||||
int excl = 0;
|
|
||||||
if (nd && (nd->flags & LOOKUP_EXCL))
|
|
||||||
excl = 1;
|
|
||||||
return gfs2_create_inode(dir, dentry, S_IFREG | mode, 0, NULL, 0, excl);
|
return gfs2_create_inode(dir, dentry, S_IFREG | mode, 0, NULL, 0, excl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -187,7 +187,7 @@ static int hfs_dir_release(struct inode *inode, struct file *file)
|
||||||
* the directory and the name (and its length) of the new file.
|
* the directory and the name (and its length) of the new file.
|
||||||
*/
|
*/
|
||||||
static int hfs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
static int hfs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
||||||
struct nameidata *nd)
|
bool excl)
|
||||||
{
|
{
|
||||||
struct inode *inode;
|
struct inode *inode;
|
||||||
int res;
|
int res;
|
||||||
|
|
|
@ -465,7 +465,7 @@ out:
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hfsplus_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
static int hfsplus_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
||||||
struct nameidata *nd)
|
bool excl)
|
||||||
{
|
{
|
||||||
return hfsplus_mknod(dir, dentry, mode, 0);
|
return hfsplus_mknod(dir, dentry, mode, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -553,7 +553,7 @@ static int read_name(struct inode *ino, char *name)
|
||||||
}
|
}
|
||||||
|
|
||||||
int hostfs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
int hostfs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
||||||
struct nameidata *nd)
|
bool excl)
|
||||||
{
|
{
|
||||||
struct inode *inode;
|
struct inode *inode;
|
||||||
char *name;
|
char *name;
|
||||||
|
|
|
@ -127,7 +127,7 @@ bail:
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hpfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, struct nameidata *nd)
|
static int hpfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, bool excl)
|
||||||
{
|
{
|
||||||
const unsigned char *name = dentry->d_name.name;
|
const unsigned char *name = dentry->d_name.name;
|
||||||
unsigned len = dentry->d_name.len;
|
unsigned len = dentry->d_name.len;
|
||||||
|
|
|
@ -565,7 +565,7 @@ static int hugetlbfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mod
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int hugetlbfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, struct nameidata *nd)
|
static int hugetlbfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, bool excl)
|
||||||
{
|
{
|
||||||
return hugetlbfs_mknod(dir, dentry, mode | S_IFREG, 0);
|
return hugetlbfs_mknod(dir, dentry, mode | S_IFREG, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
static int jffs2_readdir (struct file *, void *, filldir_t);
|
static int jffs2_readdir (struct file *, void *, filldir_t);
|
||||||
|
|
||||||
static int jffs2_create (struct inode *,struct dentry *,umode_t,
|
static int jffs2_create (struct inode *,struct dentry *,umode_t,
|
||||||
struct nameidata *);
|
bool);
|
||||||
static struct dentry *jffs2_lookup (struct inode *,struct dentry *,
|
static struct dentry *jffs2_lookup (struct inode *,struct dentry *,
|
||||||
unsigned int);
|
unsigned int);
|
||||||
static int jffs2_link (struct dentry *,struct inode *,struct dentry *);
|
static int jffs2_link (struct dentry *,struct inode *,struct dentry *);
|
||||||
|
@ -175,7 +175,7 @@ static int jffs2_readdir(struct file *filp, void *dirent, filldir_t filldir)
|
||||||
|
|
||||||
|
|
||||||
static int jffs2_create(struct inode *dir_i, struct dentry *dentry,
|
static int jffs2_create(struct inode *dir_i, struct dentry *dentry,
|
||||||
umode_t mode, struct nameidata *nd)
|
umode_t mode, bool excl)
|
||||||
{
|
{
|
||||||
struct jffs2_raw_inode *ri;
|
struct jffs2_raw_inode *ri;
|
||||||
struct jffs2_inode_info *f, *dir_f;
|
struct jffs2_inode_info *f, *dir_f;
|
||||||
|
|
|
@ -73,7 +73,7 @@ static inline void free_ea_wmap(struct inode *inode)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
static int jfs_create(struct inode *dip, struct dentry *dentry, umode_t mode,
|
static int jfs_create(struct inode *dip, struct dentry *dentry, umode_t mode,
|
||||||
struct nameidata *nd)
|
bool excl)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
tid_t tid; /* transaction id */
|
tid_t tid; /* transaction id */
|
||||||
|
|
|
@ -502,7 +502,7 @@ static int logfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int logfs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
static int logfs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
||||||
struct nameidata *nd)
|
bool excl)
|
||||||
{
|
{
|
||||||
struct inode *inode;
|
struct inode *inode;
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ static int minix_mknod(struct inode * dir, struct dentry *dentry, umode_t mode,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int minix_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
static int minix_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
||||||
struct nameidata *nd)
|
bool excl)
|
||||||
{
|
{
|
||||||
return minix_mknod(dir, dentry, mode, 0);
|
return minix_mknod(dir, dentry, mode, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2172,7 +2172,6 @@ int vfs_create2(struct vfsmount *mnt, struct inode *dir, struct dentry *dentry,
|
||||||
umode_t mode, struct nameidata *nd)
|
umode_t mode, struct nameidata *nd)
|
||||||
{
|
{
|
||||||
int error = may_create(mnt, dir, dentry);
|
int error = may_create(mnt, dir, dentry);
|
||||||
|
|
||||||
if (error)
|
if (error)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
|
@ -2183,7 +2182,7 @@ int vfs_create2(struct vfsmount *mnt, struct inode *dir, struct dentry *dentry,
|
||||||
error = security_inode_create(dir, dentry, mode);
|
error = security_inode_create(dir, dentry, mode);
|
||||||
if (error)
|
if (error)
|
||||||
return error;
|
return error;
|
||||||
error = dir->i_op->create(dir, dentry, mode, nd);
|
error = dir->i_op->create(dir, dentry, mode, !nd || (nd->flags & LOOKUP_EXCL));
|
||||||
if (!error)
|
if (!error)
|
||||||
fsnotify_create(dir, dentry);
|
fsnotify_create(dir, dentry);
|
||||||
return error;
|
return error;
|
||||||
|
|
|
@ -30,7 +30,7 @@ static void ncp_do_readdir(struct file *, void *, filldir_t,
|
||||||
|
|
||||||
static int ncp_readdir(struct file *, void *, filldir_t);
|
static int ncp_readdir(struct file *, void *, filldir_t);
|
||||||
|
|
||||||
static int ncp_create(struct inode *, struct dentry *, umode_t, struct nameidata *);
|
static int ncp_create(struct inode *, struct dentry *, umode_t, bool);
|
||||||
static struct dentry *ncp_lookup(struct inode *, struct dentry *, unsigned int);
|
static struct dentry *ncp_lookup(struct inode *, struct dentry *, unsigned int);
|
||||||
static int ncp_unlink(struct inode *, struct dentry *);
|
static int ncp_unlink(struct inode *, struct dentry *);
|
||||||
static int ncp_mkdir(struct inode *, struct dentry *, umode_t);
|
static int ncp_mkdir(struct inode *, struct dentry *, umode_t);
|
||||||
|
@ -980,7 +980,7 @@ out:
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ncp_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
static int ncp_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
||||||
struct nameidata *nd)
|
bool excl)
|
||||||
{
|
{
|
||||||
return ncp_create_new(dir, dentry, mode, 0, 0);
|
return ncp_create_new(dir, dentry, mode, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ static int nfs_opendir(struct inode *, struct file *);
|
||||||
static int nfs_closedir(struct inode *, struct file *);
|
static int nfs_closedir(struct inode *, struct file *);
|
||||||
static int nfs_readdir(struct file *, void *, filldir_t);
|
static int nfs_readdir(struct file *, void *, filldir_t);
|
||||||
static struct dentry *nfs_lookup(struct inode *, struct dentry *, unsigned int);
|
static struct dentry *nfs_lookup(struct inode *, struct dentry *, unsigned int);
|
||||||
static int nfs_create(struct inode *, struct dentry *, umode_t, struct nameidata *);
|
static int nfs_create(struct inode *, struct dentry *, umode_t, bool);
|
||||||
static int nfs_mkdir(struct inode *, struct dentry *, umode_t);
|
static int nfs_mkdir(struct inode *, struct dentry *, umode_t);
|
||||||
static int nfs_rmdir(struct inode *, struct dentry *);
|
static int nfs_rmdir(struct inode *, struct dentry *);
|
||||||
static int nfs_unlink(struct inode *, struct dentry *);
|
static int nfs_unlink(struct inode *, struct dentry *);
|
||||||
|
@ -1563,11 +1563,11 @@ out_error:
|
||||||
* reply path made it appear to have failed.
|
* reply path made it appear to have failed.
|
||||||
*/
|
*/
|
||||||
static int nfs_create(struct inode *dir, struct dentry *dentry,
|
static int nfs_create(struct inode *dir, struct dentry *dentry,
|
||||||
umode_t mode, struct nameidata *nd)
|
umode_t mode, bool excl)
|
||||||
{
|
{
|
||||||
struct iattr attr;
|
struct iattr attr;
|
||||||
|
int open_flags = excl ? O_CREAT | O_EXCL : O_CREAT;
|
||||||
int error;
|
int error;
|
||||||
int open_flags = O_CREAT|O_EXCL;
|
|
||||||
|
|
||||||
dfprintk(VFS, "NFS: create(%s/%ld), %s\n",
|
dfprintk(VFS, "NFS: create(%s/%ld), %s\n",
|
||||||
dir->i_sb->s_id, dir->i_ino, dentry->d_name.name);
|
dir->i_sb->s_id, dir->i_ino, dentry->d_name.name);
|
||||||
|
@ -1575,9 +1575,6 @@ static int nfs_create(struct inode *dir, struct dentry *dentry,
|
||||||
attr.ia_mode = mode;
|
attr.ia_mode = mode;
|
||||||
attr.ia_valid = ATTR_MODE;
|
attr.ia_valid = ATTR_MODE;
|
||||||
|
|
||||||
if (nd && !(nd->flags & LOOKUP_EXCL))
|
|
||||||
open_flags = O_CREAT;
|
|
||||||
|
|
||||||
error = NFS_PROTO(dir)->create(dir, dentry, &attr, open_flags);
|
error = NFS_PROTO(dir)->create(dir, dentry, &attr, open_flags);
|
||||||
if (error != 0)
|
if (error != 0)
|
||||||
goto out_err;
|
goto out_err;
|
||||||
|
|
|
@ -85,7 +85,7 @@ nilfs_lookup(struct inode *dir, struct dentry *dentry, unsigned int flags)
|
||||||
* with d_instantiate().
|
* with d_instantiate().
|
||||||
*/
|
*/
|
||||||
static int nilfs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
static int nilfs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
||||||
struct nameidata *nd)
|
bool excl)
|
||||||
{
|
{
|
||||||
struct inode *inode;
|
struct inode *inode;
|
||||||
struct nilfs_transaction_info ti;
|
struct nilfs_transaction_info ti;
|
||||||
|
|
|
@ -526,7 +526,7 @@ bail:
|
||||||
static int dlmfs_create(struct inode *dir,
|
static int dlmfs_create(struct inode *dir,
|
||||||
struct dentry *dentry,
|
struct dentry *dentry,
|
||||||
umode_t mode,
|
umode_t mode,
|
||||||
struct nameidata *nd)
|
bool excl)
|
||||||
{
|
{
|
||||||
int status = 0;
|
int status = 0;
|
||||||
struct inode *inode;
|
struct inode *inode;
|
||||||
|
|
|
@ -618,7 +618,7 @@ static int ocfs2_mkdir(struct inode *dir,
|
||||||
static int ocfs2_create(struct inode *dir,
|
static int ocfs2_create(struct inode *dir,
|
||||||
struct dentry *dentry,
|
struct dentry *dentry,
|
||||||
umode_t mode,
|
umode_t mode,
|
||||||
struct nameidata *nd)
|
bool excl)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
|
|
|
@ -285,7 +285,7 @@ static int omfs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int omfs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
static int omfs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
||||||
struct nameidata *nd)
|
bool excl)
|
||||||
{
|
{
|
||||||
return omfs_add_node(dir, dentry, mode | S_IFREG);
|
return omfs_add_node(dir, dentry, mode | S_IFREG);
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,7 +114,7 @@ static int ramfs_mkdir(struct inode * dir, struct dentry * dentry, umode_t mode)
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ramfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, struct nameidata *nd)
|
static int ramfs_create(struct inode *dir, struct dentry *dentry, umode_t mode, bool excl)
|
||||||
{
|
{
|
||||||
return ramfs_mknod(dir, dentry, mode | S_IFREG, 0);
|
return ramfs_mknod(dir, dentry, mode | S_IFREG, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -573,7 +573,7 @@ static int new_inode_init(struct inode *inode, struct inode *dir, umode_t mode)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int reiserfs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
static int reiserfs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
||||||
struct nameidata *nd)
|
bool excl)
|
||||||
{
|
{
|
||||||
int retval;
|
int retval;
|
||||||
struct inode *inode;
|
struct inode *inode;
|
||||||
|
|
|
@ -62,7 +62,7 @@
|
||||||
static int xattr_create(struct inode *dir, struct dentry *dentry, int mode)
|
static int xattr_create(struct inode *dir, struct dentry *dentry, int mode)
|
||||||
{
|
{
|
||||||
BUG_ON(!mutex_is_locked(&dir->i_mutex));
|
BUG_ON(!mutex_is_locked(&dir->i_mutex));
|
||||||
return dir->i_op->create(dir, dentry, mode, NULL);
|
return dir->i_op->create(dir, dentry, mode, true);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -61,7 +61,7 @@ void revert_fsids(const struct cred *old_cred)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int sdcardfs_create(struct inode *dir, struct dentry *dentry,
|
static int sdcardfs_create(struct inode *dir, struct dentry *dentry,
|
||||||
umode_t mode, struct nameidata *nd)
|
umode_t mode, bool want_excl)
|
||||||
{
|
{
|
||||||
int err = 0;
|
int err = 0;
|
||||||
struct dentry *lower_dentry;
|
struct dentry *lower_dentry;
|
||||||
|
@ -101,7 +101,7 @@ static int sdcardfs_create(struct inode *dir, struct dentry *dentry,
|
||||||
}
|
}
|
||||||
current->fs = copied_fs;
|
current->fs = copied_fs;
|
||||||
current->fs->umask = 0;
|
current->fs->umask = 0;
|
||||||
err = vfs_create2(lower_dentry_mnt, lower_parent_dentry->d_inode, lower_dentry, mode, nd);
|
err = vfs_create2(lower_dentry_mnt, lower_parent_dentry->d_inode, lower_dentry, mode, want_excl);
|
||||||
if (err)
|
if (err)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
|
|
@ -80,7 +80,7 @@ static int sysv_mknod(struct inode * dir, struct dentry * dentry, umode_t mode,
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int sysv_create(struct inode * dir, struct dentry * dentry, umode_t mode, struct nameidata *nd)
|
static int sysv_create(struct inode * dir, struct dentry * dentry, umode_t mode, bool excl)
|
||||||
{
|
{
|
||||||
return sysv_mknod(dir, dentry, mode, 0);
|
return sysv_mknod(dir, dentry, mode, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -254,7 +254,7 @@ out:
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ubifs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
static int ubifs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
||||||
struct nameidata *nd)
|
bool excl)
|
||||||
{
|
{
|
||||||
struct inode *inode;
|
struct inode *inode;
|
||||||
struct ubifs_info *c = dir->i_sb->s_fs_info;
|
struct ubifs_info *c = dir->i_sb->s_fs_info;
|
||||||
|
|
|
@ -552,7 +552,7 @@ static int udf_delete_entry(struct inode *inode, struct fileIdentDesc *fi,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int udf_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
static int udf_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
||||||
struct nameidata *nd)
|
bool excl)
|
||||||
{
|
{
|
||||||
struct udf_fileident_bh fibh;
|
struct udf_fileident_bh fibh;
|
||||||
struct inode *inode;
|
struct inode *inode;
|
||||||
|
|
|
@ -71,7 +71,7 @@ static struct dentry *ufs_lookup(struct inode * dir, struct dentry *dentry, unsi
|
||||||
* with d_instantiate().
|
* with d_instantiate().
|
||||||
*/
|
*/
|
||||||
static int ufs_create (struct inode * dir, struct dentry * dentry, umode_t mode,
|
static int ufs_create (struct inode * dir, struct dentry * dentry, umode_t mode,
|
||||||
struct nameidata *nd)
|
bool excl)
|
||||||
{
|
{
|
||||||
struct inode *inode;
|
struct inode *inode;
|
||||||
int err;
|
int err;
|
||||||
|
|
|
@ -182,7 +182,7 @@ xfs_vn_create(
|
||||||
struct inode *dir,
|
struct inode *dir,
|
||||||
struct dentry *dentry,
|
struct dentry *dentry,
|
||||||
umode_t mode,
|
umode_t mode,
|
||||||
struct nameidata *nd)
|
bool flags)
|
||||||
{
|
{
|
||||||
return xfs_vn_mknod(dir, dentry, mode, 0);
|
return xfs_vn_mknod(dir, dentry, mode, 0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1689,7 +1689,7 @@ struct inode_operations {
|
||||||
int (*readlink) (struct dentry *, char __user *,int);
|
int (*readlink) (struct dentry *, char __user *,int);
|
||||||
void (*put_link) (struct dentry *, struct nameidata *, void *);
|
void (*put_link) (struct dentry *, struct nameidata *, void *);
|
||||||
|
|
||||||
int (*create) (struct inode *,struct dentry *,umode_t,struct nameidata *);
|
int (*create) (struct inode *,struct dentry *, umode_t, bool);
|
||||||
int (*link) (struct dentry *,struct inode *,struct dentry *);
|
int (*link) (struct dentry *,struct inode *,struct dentry *);
|
||||||
int (*unlink) (struct inode *,struct dentry *);
|
int (*unlink) (struct inode *,struct dentry *);
|
||||||
int (*symlink) (struct inode *,struct dentry *,const char *);
|
int (*symlink) (struct inode *,struct dentry *,const char *);
|
||||||
|
|
|
@ -285,7 +285,7 @@ static void mqueue_evict_inode(struct inode *inode)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int mqueue_create(struct inode *dir, struct dentry *dentry,
|
static int mqueue_create(struct inode *dir, struct dentry *dentry,
|
||||||
umode_t mode, struct nameidata *nd)
|
umode_t mode, bool excl)
|
||||||
{
|
{
|
||||||
struct inode *inode;
|
struct inode *inode;
|
||||||
struct mq_attr *attr = dentry->d_fsdata;
|
struct mq_attr *attr = dentry->d_fsdata;
|
||||||
|
|
|
@ -1653,7 +1653,7 @@ static int shmem_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int shmem_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
static int shmem_create(struct inode *dir, struct dentry *dentry, umode_t mode,
|
||||||
struct nameidata *nd)
|
bool excl)
|
||||||
{
|
{
|
||||||
return shmem_mknod(dir, dentry, mode | S_IFREG, 0);
|
return shmem_mknod(dir, dentry, mode | S_IFREG, 0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue