diff options
| author | Jes Sorensen <jes@sgi.com> | 2006-01-09 18:59:24 -0500 |
|---|---|---|
| committer | Ingo Molnar <mingo@hera.kernel.org> | 2006-01-09 18:59:24 -0500 |
| commit | 1b1dcc1b57a49136f118a0f16367256ff9994a69 (patch) | |
| tree | b0b36d4f41d28c9d6514fb309d33c1a084d6309b /fs/nfsd | |
| parent | 794ee1baee1c26be40410233e6c20bceb2b03c08 (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/nfsd')
| -rw-r--r-- | fs/nfsd/nfs4recover.c | 20 | ||||
| -rw-r--r-- | fs/nfsd/vfs.c | 12 |
2 files changed, 16 insertions, 16 deletions
diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c index 954cf893d50c..be963a133aaa 100644 --- a/fs/nfsd/nfs4recover.c +++ b/fs/nfsd/nfs4recover.c | |||
| @@ -121,9 +121,9 @@ out: | |||
| 121 | static void | 121 | static void |
| 122 | nfsd4_sync_rec_dir(void) | 122 | nfsd4_sync_rec_dir(void) |
| 123 | { | 123 | { |
| 124 | down(&rec_dir.dentry->d_inode->i_sem); | 124 | mutex_lock(&rec_dir.dentry->d_inode->i_mutex); |
| 125 | nfsd_sync_dir(rec_dir.dentry); | 125 | nfsd_sync_dir(rec_dir.dentry); |
| 126 | up(&rec_dir.dentry->d_inode->i_sem); | 126 | mutex_unlock(&rec_dir.dentry->d_inode->i_mutex); |
| 127 | } | 127 | } |
| 128 | 128 | ||
| 129 | int | 129 | int |
| @@ -143,7 +143,7 @@ nfsd4_create_clid_dir(struct nfs4_client *clp) | |||
| 143 | nfs4_save_user(&uid, &gid); | 143 | nfs4_save_user(&uid, &gid); |
| 144 | 144 | ||
| 145 | /* lock the parent */ | 145 | /* lock the parent */ |
| 146 | down(&rec_dir.dentry->d_inode->i_sem); | 146 | mutex_lock(&rec_dir.dentry->d_inode->i_mutex); |
| 147 | 147 | ||
| 148 | dentry = lookup_one_len(dname, rec_dir.dentry, HEXDIR_LEN-1); | 148 | dentry = lookup_one_len(dname, rec_dir.dentry, HEXDIR_LEN-1); |
| 149 | if (IS_ERR(dentry)) { | 149 | if (IS_ERR(dentry)) { |
| @@ -159,7 +159,7 @@ nfsd4_create_clid_dir(struct nfs4_client *clp) | |||
| 159 | out_put: | 159 | out_put: |
| 160 | dput(dentry); | 160 | dput(dentry); |
| 161 | out_unlock: | 161 | out_unlock: |
| 162 | up(&rec_dir.dentry->d_inode->i_sem); | 162 | mutex_unlock(&rec_dir.dentry->d_inode->i_mutex); |
| 163 | if (status == 0) { | 163 | if (status == 0) { |
| 164 | clp->cl_firststate = 1; | 164 | clp->cl_firststate = 1; |
| 165 | nfsd4_sync_rec_dir(); | 165 | nfsd4_sync_rec_dir(); |
| @@ -259,9 +259,9 @@ nfsd4_remove_clid_file(struct dentry *dir, struct dentry *dentry) | |||
| 259 | printk("nfsd4: non-file found in client recovery directory\n"); | 259 | printk("nfsd4: non-file found in client recovery directory\n"); |
| 260 | return -EINVAL; | 260 | return -EINVAL; |
| 261 | } | 261 | } |
| 262 | down(&dir->d_inode->i_sem); | 262 | mutex_lock(&dir->d_inode->i_mutex); |
| 263 | status = vfs_unlink(dir->d_inode, dentry); | 263 | status = vfs_unlink(dir->d_inode, dentry); |
| 264 | up(&dir->d_inode->i_sem); | 264 | mutex_unlock(&dir->d_inode->i_mutex); |
| 265 | return status; | 265 | return status; |
| 266 | } | 266 | } |
| 267 | 267 | ||
| @@ -274,9 +274,9 @@ nfsd4_clear_clid_dir(struct dentry *dir, struct dentry *dentry) | |||
| 274 | * any regular files anyway, just in case the directory was created by | 274 | * any regular files anyway, just in case the directory was created by |
| 275 | * a kernel from the future.... */ | 275 | * a kernel from the future.... */ |
| 276 | nfsd4_list_rec_dir(dentry, nfsd4_remove_clid_file); | 276 | nfsd4_list_rec_dir(dentry, nfsd4_remove_clid_file); |
| 277 | down(&dir->d_inode->i_sem); | 277 | mutex_lock(&dir->d_inode->i_mutex); |
| 278 | status = vfs_rmdir(dir->d_inode, dentry); | 278 | status = vfs_rmdir(dir->d_inode, dentry); |
| 279 | up(&dir->d_inode->i_sem); | 279 | mutex_unlock(&dir->d_inode->i_mutex); |
| 280 | return status; | 280 | return status; |
| 281 | } | 281 | } |
| 282 | 282 | ||
| @@ -288,9 +288,9 @@ nfsd4_unlink_clid_dir(char *name, int namlen) | |||
| 288 | 288 | ||
| 289 | dprintk("NFSD: nfsd4_unlink_clid_dir. name %.*s\n", namlen, name); | 289 | dprintk("NFSD: nfsd4_unlink_clid_dir. name %.*s\n", namlen, name); |
| 290 | 290 | ||
| 291 | down(&rec_dir.dentry->d_inode->i_sem); | 291 | mutex_lock(&rec_dir.dentry->d_inode->i_mutex); |
| 292 | dentry = lookup_one_len(name, rec_dir.dentry, namlen); | 292 | dentry = lookup_one_len(name, rec_dir.dentry, namlen); |
| 293 | up(&rec_dir.dentry->d_inode->i_sem); | 293 | mutex_unlock(&rec_dir.dentry->d_inode->i_mutex); |
| 294 | if (IS_ERR(dentry)) { | 294 | if (IS_ERR(dentry)) { |
| 295 | status = PTR_ERR(dentry); | 295 | status = PTR_ERR(dentry); |
| 296 | return status; | 296 | return status; |
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index df4019f04560..bb36b4304491 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c | |||
| @@ -390,12 +390,12 @@ set_nfsv4_acl_one(struct dentry *dentry, struct posix_acl *pacl, char *key) | |||
| 390 | 390 | ||
| 391 | error = -EOPNOTSUPP; | 391 | error = -EOPNOTSUPP; |
| 392 | if (inode->i_op && inode->i_op->setxattr) { | 392 | if (inode->i_op && inode->i_op->setxattr) { |
| 393 | down(&inode->i_sem); | 393 | mutex_lock(&inode->i_mutex); |
| 394 | security_inode_setxattr(dentry, key, buf, len, 0); | 394 | security_inode_setxattr(dentry, key, buf, len, 0); |
| 395 | error = inode->i_op->setxattr(dentry, key, buf, len, 0); | 395 | error = inode->i_op->setxattr(dentry, key, buf, len, 0); |
| 396 | if (!error) | 396 | if (!error) |
| 397 | security_inode_post_setxattr(dentry, key, buf, len, 0); | 397 | security_inode_post_setxattr(dentry, key, buf, len, 0); |
| 398 | up(&inode->i_sem); | 398 | mutex_unlock(&inode->i_mutex); |
| 399 | } | 399 | } |
| 400 | out: | 400 | out: |
| 401 | kfree(buf); | 401 | kfree(buf); |
| @@ -739,9 +739,9 @@ nfsd_sync(struct file *filp) | |||
| 739 | int err; | 739 | int err; |
| 740 | struct inode *inode = filp->f_dentry->d_inode; | 740 | struct inode *inode = filp->f_dentry->d_inode; |
| 741 | dprintk("nfsd: sync file %s\n", filp->f_dentry->d_name.name); | 741 | dprintk("nfsd: sync file %s\n", filp->f_dentry->d_name.name); |
| 742 | down(&inode->i_sem); | 742 | mutex_lock(&inode->i_mutex); |
| 743 | err=nfsd_dosync(filp, filp->f_dentry, filp->f_op); | 743 | err=nfsd_dosync(filp, filp->f_dentry, filp->f_op); |
| 744 | up(&inode->i_sem); | 744 | mutex_unlock(&inode->i_mutex); |
| 745 | 745 | ||
| 746 | return err; | 746 | return err; |
| 747 | } | 747 | } |
| @@ -885,9 +885,9 @@ static void kill_suid(struct dentry *dentry) | |||
| 885 | struct iattr ia; | 885 | struct iattr ia; |
| 886 | ia.ia_valid = ATTR_KILL_SUID | ATTR_KILL_SGID; | 886 | ia.ia_valid = ATTR_KILL_SUID | ATTR_KILL_SGID; |
| 887 | 887 | ||
| 888 | down(&dentry->d_inode->i_sem); | 888 | mutex_lock(&dentry->d_inode->i_mutex); |
| 889 | notify_change(dentry, &ia); | 889 | notify_change(dentry, &ia); |
| 890 | up(&dentry->d_inode->i_sem); | 890 | mutex_unlock(&dentry->d_inode->i_mutex); |
| 891 | } | 891 | } |
| 892 | 892 | ||
| 893 | static inline int | 893 | static inline int |
