aboutsummaryrefslogtreecommitdiffstats
path: root/fs/open.c
diff options
context:
space:
mode:
authorJes Sorensen <jes@sgi.com>2006-01-09 18:59:24 -0500
committerIngo Molnar <mingo@hera.kernel.org>2006-01-09 18:59:24 -0500
commit1b1dcc1b57a49136f118a0f16367256ff9994a69 (patch)
treeb0b36d4f41d28c9d6514fb309d33c1a084d6309b /fs/open.c
parent794ee1baee1c26be40410233e6c20bceb2b03c08 (diff)
[PATCH] mutex subsystem, semaphore to mutex: VFS, ->i_sem
This patch converts the inode semaphore to a mutex. I have tested it on XFS and compiled as much as one can consider on an ia64. Anyway your luck with it might be different. Modified-by: Ingo Molnar <mingo@elte.hu> (finished the conversion) Signed-off-by: Jes Sorensen <jes@sgi.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'fs/open.c')
-rw-r--r--fs/open.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/fs/open.c b/fs/open.c
index 75f3329e8a67..a3b3a9b5c2ff 100644
--- a/fs/open.c
+++ b/fs/open.c
@@ -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);
404dput_and_out: 404dput_and_out:
405 path_release(&nd); 405 path_release(&nd);
406out: 406out:
@@ -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);
457dput_and_out: 457dput_and_out:
458 path_release(&nd); 458 path_release(&nd);
459out: 459out:
@@ -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
631out_putf: 631out_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
665dput_and_out: 665dput_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);
702out: 702out:
703 return error; 703 return error;
704} 704}