Skip to content

Commit ebfc3b4

Browse files
author
Al Viro
committed
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. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
1 parent 72bd866 commit ebfc3b4

51 files changed

Lines changed: 62 additions & 64 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎Documentation/filesystems/Locking‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ d_manage: no no yes (ref-walk) maybe
3737

3838
--------------------------- inode_operations ---------------------------
3939
prototypes:
40-
int (*create) (struct inode *,struct dentry *,umode_t, struct nameidata *);
40+
int (*create) (struct inode *,struct dentry *,umode_t, bool);
4141
struct dentry * (*lookup) (struct inode *,struct dentry *, unsigned int);
4242
int (*link) (struct dentry *,struct inode *,struct dentry *);
4343
int (*unlink) (struct inode *,struct dentry *);

‎Documentation/filesystems/porting‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,3 +436,9 @@ d_make_root() drops the reference to inode if dentry allocation fails.
436436
[mandatory]
437437
The witch is dead! Well, 2/3 of it, anyway. ->d_revalidate() and
438438
->lookup() do *not* take struct nameidata anymore; just the flags.
439+
--
440+
[mandatory]
441+
->create() doesn't take struct nameidata *; unlike the previous
442+
two, it gets "is it an O_EXCL or equivalent?" boolean argument. Note that
443+
local filesystems can ignore tha argument - they are guaranteed that the
444+
object doesn't exist. It's remote/distributed ones that might care...

‎Documentation/filesystems/vfs.txt‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ This describes how the VFS can manipulate an inode in your
341341
filesystem. As of kernel 2.6.22, the following members are defined:
342342

343343
struct inode_operations {
344-
int (*create) (struct inode *,struct dentry *, umode_t, struct nameidata *);
344+
int (*create) (struct inode *,struct dentry *, umode_t, bool);
345345
struct dentry * (*lookup) (struct inode *,struct dentry *, unsigned int);
346346
int (*link) (struct dentry *,struct inode *,struct dentry *);
347347
int (*unlink) (struct inode *,struct dentry *);

‎fs/9p/vfs_inode.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ v9fs_create(struct v9fs_session_info *v9ses, struct inode *dir,
725725

726726
static int
727727
v9fs_vfs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
728-
struct nameidata *nd)
728+
bool excl)
729729
{
730730
struct v9fs_session_info *v9ses = v9fs_inode2v9ses(dir);
731731
u32 perm = unixmode2p9mode(v9ses, mode);

‎fs/9p/vfs_inode_dotl.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ int v9fs_open_to_dotl_flags(int flags)
235235

236236
static int
237237
v9fs_vfs_create_dotl(struct inode *dir, struct dentry *dentry, umode_t omode,
238-
struct nameidata *nd)
238+
bool excl)
239239
{
240240
return v9fs_vfs_mknod_dotl(dir, dentry, omode, 0);
241241
}

‎fs/affs/affs.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ extern void affs_free_bitmap(struct super_block *sb);
155155
extern int affs_hash_name(struct super_block *sb, const u8 *name, unsigned int len);
156156
extern struct dentry *affs_lookup(struct inode *dir, struct dentry *dentry, unsigned int);
157157
extern int affs_unlink(struct inode *dir, struct dentry *dentry);
158-
extern int affs_create(struct inode *dir, struct dentry *dentry, umode_t mode, struct nameidata *);
158+
extern int affs_create(struct inode *dir, struct dentry *dentry, umode_t mode, bool);
159159
extern int affs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode);
160160
extern int affs_rmdir(struct inode *dir, struct dentry *dentry);
161161
extern int affs_link(struct dentry *olddentry, struct inode *dir,

‎fs/affs/namei.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ affs_unlink(struct inode *dir, struct dentry *dentry)
255255
}
256256

257257
int
258-
affs_create(struct inode *dir, struct dentry *dentry, umode_t mode, struct nameidata *nd)
258+
affs_create(struct inode *dir, struct dentry *dentry, umode_t mode, bool excl)
259259
{
260260
struct super_block *sb = dir->i_sb;
261261
struct inode *inode;

‎fs/afs/dir.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ static void afs_d_release(struct dentry *dentry);
2929
static int afs_lookup_filldir(void *_cookie, const char *name, int nlen,
3030
loff_t fpos, u64 ino, unsigned dtype);
3131
static int afs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
32-
struct nameidata *nd);
32+
bool excl);
3333
static int afs_mkdir(struct inode *dir, struct dentry *dentry, umode_t mode);
3434
static int afs_rmdir(struct inode *dir, struct dentry *dentry);
3535
static int afs_unlink(struct inode *dir, struct dentry *dentry);
@@ -949,7 +949,7 @@ static int afs_unlink(struct inode *dir, struct dentry *dentry)
949949
* create a regular file on an AFS filesystem
950950
*/
951951
static int afs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
952-
struct nameidata *nd)
952+
bool excl)
953953
{
954954
struct afs_file_status status;
955955
struct afs_callback cb;

‎fs/bad_inode.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ static const struct file_operations bad_file_ops =
173173
};
174174

175175
static int bad_inode_create (struct inode *dir, struct dentry *dentry,
176-
umode_t mode, struct nameidata *nd)
176+
umode_t mode, bool excl)
177177
{
178178
return -EIO;
179179
}

‎fs/bfs/dir.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ const struct file_operations bfs_dir_operations = {
8585
extern void dump_imap(const char *, struct super_block *);
8686

8787
static int bfs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
88-
struct nameidata *nd)
88+
bool excl)
8989
{
9090
int err;
9191
struct inode *inode;

0 commit comments

Comments
 (0)