Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 11840
b: refs/heads/master
c: 18a19cb
h: refs/heads/master
v: v3
  • Loading branch information
Paul Jackson authored and Linus Torvalds committed Oct 31, 2005
1 parent c30a76a commit 4fadc42
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 053199edf54f685e7dea765b60d4d5e9070dadec
refs/heads/master: 18a19cb3047e454ee5ecbc35d7acf3f8e09e0466
16 changes: 16 additions & 0 deletions trunk/kernel/cpuset.c
Original file line number Diff line number Diff line change
Expand Up @@ -1113,6 +1113,21 @@ static int cpuset_file_release(struct inode *inode, struct file *file)
return 0;
}

/*
* cpuset_rename - Only allow simple rename of directories in place.
*/
static int cpuset_rename(struct inode *old_dir, struct dentry *old_dentry,
struct inode *new_dir, struct dentry *new_dentry)
{
if (!S_ISDIR(old_dentry->d_inode->i_mode))
return -ENOTDIR;
if (new_dentry->d_inode)
return -EEXIST;
if (old_dir != new_dir)
return -EIO;
return simple_rename(old_dir, old_dentry, new_dir, new_dentry);
}

static struct file_operations cpuset_file_operations = {
.read = cpuset_file_read,
.write = cpuset_file_write,
Expand All @@ -1125,6 +1140,7 @@ static struct inode_operations cpuset_dir_inode_operations = {
.lookup = simple_lookup,
.mkdir = cpuset_mkdir,
.rmdir = cpuset_rmdir,
.rename = cpuset_rename,
};

static int cpuset_create_file(struct dentry *dentry, int mode)
Expand Down

0 comments on commit 4fadc42

Please sign in to comment.