diff options
Diffstat (limited to 'fs/open.c')
| -rw-r--r-- | fs/open.c | 24 |
1 files changed, 12 insertions, 12 deletions
| @@ -211,9 +211,9 @@ int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs, | |||
| 211 | newattrs.ia_valid |= ATTR_FILE; | 211 | newattrs.ia_valid |= ATTR_FILE; |
| 212 | } | 212 | } |
| 213 | 213 | ||
| 214 | down(&dentry->d_inode->i_sem); | 214 | mutex_lock(&dentry->d_inode->i_mutex); |
| 215 | err = notify_change(dentry, &newattrs); | 215 | err = notify_change(dentry, &newattrs); |
| 216 | up(&dentry->d_inode->i_sem); | 216 | mutex_unlock(&dentry->d_inode->i_mutex); |
| 217 | return err; | 217 | return err; |
| 218 | } | 218 | } |
| 219 | 219 | ||
| @@ -398,9 +398,9 @@ asmlinkage long sys_utime(char __user * filename, struct utimbuf __user * times) | |||
| 398 | (error = vfs_permission(&nd, MAY_WRITE)) != 0) | 398 | (error = vfs_permission(&nd, MAY_WRITE)) != 0) |
| 399 | goto dput_and_out; | 399 | goto dput_and_out; |
| 400 | } | 400 | } |
| 401 | down(&inode->i_sem); | 401 | mutex_lock(&inode->i_mutex); |
| 402 | error = notify_change(nd.dentry, &newattrs); | 402 | error = notify_change(nd.dentry, &newattrs); |
| 403 | up(&inode->i_sem); | 403 | mutex_unlock(&inode->i_mutex); |
| 404 | dput_and_out: | 404 | dput_and_out: |
| 405 | path_release(&nd); | 405 | path_release(&nd); |
| 406 | out: | 406 | out: |
| @@ -451,9 +451,9 @@ long do_utimes(char __user * filename, struct timeval * times) | |||
| 451 | (error = vfs_permission(&nd, MAY_WRITE)) != 0) | 451 | (error = vfs_permission(&nd, MAY_WRITE)) != 0) |
| 452 | goto dput_and_out; | 452 | goto dput_and_out; |
| 453 | } | 453 | } |
| 454 | down(&inode->i_sem); | 454 | mutex_lock(&inode->i_mutex); |
| 455 | error = notify_change(nd.dentry, &newattrs); | 455 | error = notify_change(nd.dentry, &newattrs); |
| 456 | up(&inode->i_sem); | 456 | mutex_unlock(&inode->i_mutex); |
| 457 | dput_and_out: | 457 | dput_and_out: |
| 458 | path_release(&nd); | 458 | path_release(&nd); |
| 459 | out: | 459 | out: |
| @@ -620,13 +620,13 @@ asmlinkage long sys_fchmod(unsigned int fd, mode_t mode) | |||
| 620 | err = -EPERM; | 620 | err = -EPERM; |
| 621 | if (IS_IMMUTABLE(inode) || IS_APPEND(inode)) | 621 | if (IS_IMMUTABLE(inode) || IS_APPEND(inode)) |
| 622 | goto out_putf; | 622 | goto out_putf; |
| 623 | down(&inode->i_sem); | 623 | mutex_lock(&inode->i_mutex); |
| 624 | if (mode == (mode_t) -1) | 624 | if (mode == (mode_t) -1) |
| 625 | mode = inode->i_mode; | 625 | mode = inode->i_mode; |
| 626 | newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO); | 626 | newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO); |
| 627 | newattrs.ia_valid = ATTR_MODE | ATTR_CTIME; | 627 | newattrs.ia_valid = ATTR_MODE | ATTR_CTIME; |
| 628 | err = notify_change(dentry, &newattrs); | 628 | err = notify_change(dentry, &newattrs); |
| 629 | up(&inode->i_sem); | 629 | mutex_unlock(&inode->i_mutex); |
| 630 | 630 | ||
| 631 | out_putf: | 631 | out_putf: |
| 632 | fput(file); | 632 | fput(file); |
| @@ -654,13 +654,13 @@ asmlinkage long sys_chmod(const char __user * filename, mode_t mode) | |||
| 654 | if (IS_IMMUTABLE(inode) || IS_APPEND(inode)) | 654 | if (IS_IMMUTABLE(inode) || IS_APPEND(inode)) |
| 655 | goto dput_and_out; | 655 | goto dput_and_out; |
| 656 | 656 | ||
| 657 | down(&inode->i_sem); | 657 | mutex_lock(&inode->i_mutex); |
| 658 | if (mode == (mode_t) -1) | 658 | if (mode == (mode_t) -1) |
| 659 | mode = inode->i_mode; | 659 | mode = inode->i_mode; |
| 660 | newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO); | 660 | newattrs.ia_mode = (mode & S_IALLUGO) | (inode->i_mode & ~S_IALLUGO); |
| 661 | newattrs.ia_valid = ATTR_MODE | ATTR_CTIME; | 661 | newattrs.ia_valid = ATTR_MODE | ATTR_CTIME; |
| 662 | error = notify_change(nd.dentry, &newattrs); | 662 | error = notify_change(nd.dentry, &newattrs); |
| 663 | up(&inode->i_sem); | 663 | mutex_unlock(&inode->i_mutex); |
| 664 | 664 | ||
| 665 | dput_and_out: | 665 | dput_and_out: |
| 666 | path_release(&nd); | 666 | path_release(&nd); |
| @@ -696,9 +696,9 @@ static int chown_common(struct dentry * dentry, uid_t user, gid_t group) | |||
| 696 | } | 696 | } |
| 697 | if (!S_ISDIR(inode->i_mode)) | 697 | if (!S_ISDIR(inode->i_mode)) |
| 698 | newattrs.ia_valid |= ATTR_KILL_SUID|ATTR_KILL_SGID; | 698 | newattrs.ia_valid |= ATTR_KILL_SUID|ATTR_KILL_SGID; |
| 699 | down(&inode->i_sem); | 699 | mutex_lock(&inode->i_mutex); |
| 700 | error = notify_change(dentry, &newattrs); | 700 | error = notify_change(dentry, &newattrs); |
| 701 | up(&inode->i_sem); | 701 | mutex_unlock(&inode->i_mutex); |
| 702 | out: | 702 | out: |
| 703 | return error; | 703 | return error; |
| 704 | } | 704 | } |
