|
@@ -187,11 +187,31 @@ static int bpf_mkobj(struct inode *dir, struct dentry *dentry, umode_t mode,
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static int bpf_link(struct dentry *old_dentry, struct inode *dir,
|
|
|
|
+ struct dentry *new_dentry)
|
|
|
|
+{
|
|
|
|
+ if (bpf_dname_reserved(new_dentry))
|
|
|
|
+ return -EPERM;
|
|
|
|
+
|
|
|
|
+ return simple_link(old_dentry, dir, new_dentry);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static int bpf_rename(struct inode *old_dir, struct dentry *old_dentry,
|
|
|
|
+ struct inode *new_dir, struct dentry *new_dentry)
|
|
|
|
+{
|
|
|
|
+ if (bpf_dname_reserved(new_dentry))
|
|
|
|
+ return -EPERM;
|
|
|
|
+
|
|
|
|
+ return simple_rename(old_dir, old_dentry, new_dir, new_dentry);
|
|
|
|
+}
|
|
|
|
+
|
|
static const struct inode_operations bpf_dir_iops = {
|
|
static const struct inode_operations bpf_dir_iops = {
|
|
.lookup = simple_lookup,
|
|
.lookup = simple_lookup,
|
|
.mknod = bpf_mkobj,
|
|
.mknod = bpf_mkobj,
|
|
.mkdir = bpf_mkdir,
|
|
.mkdir = bpf_mkdir,
|
|
.rmdir = simple_rmdir,
|
|
.rmdir = simple_rmdir,
|
|
|
|
+ .rename = bpf_rename,
|
|
|
|
+ .link = bpf_link,
|
|
.unlink = simple_unlink,
|
|
.unlink = simple_unlink,
|
|
};
|
|
};
|
|
|
|
|