+ if (error)
+ break;
+ /***** TOMOYO Linux end. *****/
- error = vfs_mknod(nd.path.dentry->d_inode,dentry,mode,
- new_decode_dev(dev));
+ error = vfs_mknod(nd.path.dentry->d_inode, dentry,
+ nd.path.mnt, mode, new_decode_dev(dev));
break;
case S_IFIFO: case S_IFSOCK:
+ /***** TOMOYO Linux start. *****/
+ if (error)
+ break;
+ /***** TOMOYO Linux end. *****/
- error = vfs_mknod(nd.path.dentry->d_inode,dentry,mode,0);
+ error = vfs_mknod(nd.path.dentry->d_inode, dentry,
+ nd.path.mnt, mode, 0);
break;
- }
@@ -2068,6 +2124,13 @@ SYSCALL_DEFINE3(mkdirat, int, dfd, const
error = mnt_want_write(nd.path.mnt);
if (error)
+ nd.path.mnt);
+ if (!error)
+ /***** TOMOYO Linux end. *****/
- error = vfs_mkdir(nd.path.dentry->d_inode, dentry, mode);
+ error = vfs_mkdir(nd.path.dentry->d_inode, dentry, nd.path.mnt, mode);
mnt_drop_write(nd.path.mnt);
out_dput:
@@ -2178,6 +2241,13 @@ static long do_rmdir(int dfd, const char
+ nd.path.mnt);
+ if (!error)
+ /***** TOMOYO Linux end. *****/
- error = vfs_rmdir(nd.path.dentry->d_inode, dentry);
+ error = vfs_rmdir(nd.path.dentry->d_inode, dentry, nd.path.mnt);
mnt_drop_write(nd.path.mnt);
- exit3:
+ if (!error && (saved_dev || saved_ino))
@@ -2239,6 +2309,10 @@ static long do_unlinkat(int dfd, const c
struct inode *inode = NULL;
ino_t saved_ino = 0;
+ nd.path.mnt);
+ if (!error)
+ /***** TOMOYO Linux end. *****/
- error = vfs_unlink(nd.path.dentry->d_inode, dentry);
- mnt_drop_write(nd.path.mnt);
- exit2:
+ error = vfs_unlink(nd.path.dentry->d_inode, dentry, nd.path.mnt);
+ if (!error && (saved_ino || saved_dev))
+ gr_handle_delete(saved_ino, saved_dev);
@@ -2327,6 +2408,10 @@ SYSCALL_DEFINE3(symlinkat, const char __
char *to;
struct dentry *dentry;
+ nd.path.mnt);
+ if (!error)
+ /***** TOMOYO Linux end. *****/
- error = vfs_symlink(nd.path.dentry->d_inode, dentry, from);
- mnt_drop_write(nd.path.mnt);
- out_dput:
+ error = vfs_symlink(nd.path.dentry->d_inode, dentry, nd.path.mnt, from);
+ if (!error)
+ gr_handle_create(dentry, nd.path.mnt);
@@ -2420,6 +2512,10 @@ SYSCALL_DEFINE5(linkat, int, olddfd, con
if ((flags & ~AT_SYMLINK_FOLLOW) != 0)
+ nd.path.mnt);
+ if (!error)
+ /***** TOMOYO Linux end. *****/
- error = vfs_link(old_path.dentry, nd.path.dentry->d_inode, new_dentry);
- mnt_drop_write(nd.path.mnt);
- out_dput:
+ error = vfs_link(old_path.dentry, old_path.mnt,
+ nd.path.dentry->d_inode,
+ new_dentry, nd.path.mnt);
@@ -2616,6 +2721,10 @@ SYSCALL_DEFINE4(renameat, int, olddfd, c
char *from;
char *to;
+ nd.path.mnt);
+ if (!err)
+ /***** TOMOYO Linux end. *****/
- err = vfs_mknod(nd.path.dentry->d_inode, dentry, mode, 0);
+ err = vfs_mknod(nd.path.dentry->d_inode, dentry, nd.path.mnt,
+ mode, 0);
mnt_drop_write(nd.path.mnt);
- if (err)