/*
* Type of the last component on LOOKUP_PARENT
*/
-enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT};
+enum last_type {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT};
void __init filename_init(void)
{
struct inode *inode; /* path.dentry.d_inode */
unsigned int flags, state;
unsigned seq, next_seq, m_seq, r_seq;
- int last_type;
+ enum last_type last_type;
unsigned depth;
int total_link_count;
struct saved {
return dget(nd->path.dentry);
}
-static const char *handle_dots(struct nameidata *nd, int type)
+static const char *handle_dots(struct nameidata *nd, enum last_type type)
{
if (type == LAST_DOTDOT) {
const char *error = NULL;
/* Note: this does not consume "name" */
static int __filename_parentat(int dfd, struct filename *name,
unsigned int flags, struct path *parent,
- struct qstr *last, int *type,
+ struct qstr *last, enum last_type *type,
const struct path *root)
{
int retval;
static int filename_parentat(int dfd, struct filename *name,
unsigned int flags, struct path *parent,
- struct qstr *last, int *type)
+ struct qstr *last, enum last_type *type)
{
return __filename_parentat(dfd, name, flags, parent, last, type, NULL);
}
struct path parent_path __free(path_put) = {};
struct dentry *d;
struct qstr last;
- int type, error;
+ enum last_type type;
+ int error;
error = filename_parentat(dfd, name, 0, &parent_path, &last, &type);
if (error)
CLASS(filename_kernel, filename)(name);
struct dentry *d;
struct qstr last;
- int type, error;
+ enum last_type type;
+ int error;
error = filename_parentat(AT_FDCWD, filename, 0, &parent_path, &last, &type);
if (error)
struct path *parent, struct qstr *last,
const struct path *root)
{
- int type;
+ enum last_type type;
int err = __filename_parentat(AT_FDCWD, filename, flags, parent, last,
&type, root);
if (err)
bool want_dir = lookup_flags & LOOKUP_DIRECTORY;
unsigned int reval_flag = lookup_flags & LOOKUP_REVAL;
unsigned int create_flags = LOOKUP_CREATE | LOOKUP_EXCL;
- int type;
+ enum last_type type;
int error;
error = filename_parentat(dfd, name, reval_flag, path, &last, &type);
struct dentry *dentry;
struct path path;
struct qstr last;
- int type;
+ enum last_type type;
unsigned int lookup_flags = 0;
struct delegated_inode delegated_inode = { };
retry:
return error;
switch (type) {
+ case LAST_NORM:
+ break;
case LAST_DOTDOT:
error = -ENOTEMPTY;
goto exit2;
struct dentry *dentry;
struct path path;
struct qstr last;
- int type;
+ enum last_type type;
struct inode *inode;
struct delegated_inode delegated_inode = { };
unsigned int lookup_flags = 0;
struct renamedata rd;
struct path old_path, new_path;
struct qstr old_last, new_last;
- int old_type, new_type;
+ enum last_type old_type, new_type;
struct delegated_inode delegated_inode = { };
unsigned int lookup_flags = 0;
bool should_retry = false;