diff options
author | Arjan van de Ven <arjan@infradead.org> | 2006-03-23 06:00:33 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-23 10:38:12 -0500 |
commit | a11f3a0574a5734db3e5de38922430d005d35118 (patch) | |
tree | 2f332f623463c5909dc37d20cbf44421854f775a /fs/cifs | |
parent | 144efe3e3e5ad57af549bf800fa4560d7c74e9fe (diff) |
[PATCH] sem2mutex: vfs_rename_mutex
Semaphore to mutex conversion.
The conversion was generated via scripts, and the result was validated
automatically via a script as well.
Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Al Viro <viro@ftp.linux.org.uk>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/dir.c | 8 | ||||
-rw-r--r-- | fs/cifs/fcntl.c | 4 | ||||
-rw-r--r-- | fs/cifs/file.c | 4 | ||||
-rw-r--r-- | fs/cifs/inode.c | 16 | ||||
-rw-r--r-- | fs/cifs/link.c | 16 | ||||
-rw-r--r-- | fs/cifs/readdir.c | 4 | ||||
-rw-r--r-- | fs/cifs/xattr.c | 16 |
7 files changed, 34 insertions, 34 deletions
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index fed55e3c53df..632561dd9c50 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c | |||
@@ -138,9 +138,9 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode, | |||
138 | cifs_sb = CIFS_SB(inode->i_sb); | 138 | cifs_sb = CIFS_SB(inode->i_sb); |
139 | pTcon = cifs_sb->tcon; | 139 | pTcon = cifs_sb->tcon; |
140 | 140 | ||
141 | down(&direntry->d_sb->s_vfs_rename_sem); | 141 | mutex_lock(&direntry->d_sb->s_vfs_rename_mutex); |
142 | full_path = build_path_from_dentry(direntry); | 142 | full_path = build_path_from_dentry(direntry); |
143 | up(&direntry->d_sb->s_vfs_rename_sem); | 143 | mutex_unlock(&direntry->d_sb->s_vfs_rename_mutex); |
144 | if(full_path == NULL) { | 144 | if(full_path == NULL) { |
145 | FreeXid(xid); | 145 | FreeXid(xid); |
146 | return -ENOMEM; | 146 | return -ENOMEM; |
@@ -317,9 +317,9 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode, | |||
317 | cifs_sb = CIFS_SB(inode->i_sb); | 317 | cifs_sb = CIFS_SB(inode->i_sb); |
318 | pTcon = cifs_sb->tcon; | 318 | pTcon = cifs_sb->tcon; |
319 | 319 | ||
320 | down(&direntry->d_sb->s_vfs_rename_sem); | 320 | mutex_lock(&direntry->d_sb->s_vfs_rename_mutex); |
321 | full_path = build_path_from_dentry(direntry); | 321 | full_path = build_path_from_dentry(direntry); |
322 | up(&direntry->d_sb->s_vfs_rename_sem); | 322 | mutex_unlock(&direntry->d_sb->s_vfs_rename_mutex); |
323 | if(full_path == NULL) | 323 | if(full_path == NULL) |
324 | rc = -ENOMEM; | 324 | rc = -ENOMEM; |
325 | else if (pTcon->ses->capabilities & CAP_UNIX) { | 325 | else if (pTcon->ses->capabilities & CAP_UNIX) { |
diff --git a/fs/cifs/fcntl.c b/fs/cifs/fcntl.c index a7a47bb36bf3..ec4dfe9bf5ef 100644 --- a/fs/cifs/fcntl.c +++ b/fs/cifs/fcntl.c | |||
@@ -86,9 +86,9 @@ int cifs_dir_notify(struct file * file, unsigned long arg) | |||
86 | cifs_sb = CIFS_SB(file->f_dentry->d_sb); | 86 | cifs_sb = CIFS_SB(file->f_dentry->d_sb); |
87 | pTcon = cifs_sb->tcon; | 87 | pTcon = cifs_sb->tcon; |
88 | 88 | ||
89 | down(&file->f_dentry->d_sb->s_vfs_rename_sem); | 89 | mutex_lock(&file->f_dentry->d_sb->s_vfs_rename_mutex); |
90 | full_path = build_path_from_dentry(file->f_dentry); | 90 | full_path = build_path_from_dentry(file->f_dentry); |
91 | up(&file->f_dentry->d_sb->s_vfs_rename_sem); | 91 | mutex_unlock(&file->f_dentry->d_sb->s_vfs_rename_mutex); |
92 | 92 | ||
93 | if(full_path == NULL) { | 93 | if(full_path == NULL) { |
94 | rc = -ENOMEM; | 94 | rc = -ENOMEM; |
diff --git a/fs/cifs/file.c b/fs/cifs/file.c index 675bd2568297..165d67426381 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c | |||
@@ -203,9 +203,9 @@ int cifs_open(struct inode *inode, struct file *file) | |||
203 | } | 203 | } |
204 | } | 204 | } |
205 | 205 | ||
206 | down(&inode->i_sb->s_vfs_rename_sem); | 206 | mutex_lock(&inode->i_sb->s_vfs_rename_mutex); |
207 | full_path = build_path_from_dentry(file->f_dentry); | 207 | full_path = build_path_from_dentry(file->f_dentry); |
208 | up(&inode->i_sb->s_vfs_rename_sem); | 208 | mutex_unlock(&inode->i_sb->s_vfs_rename_mutex); |
209 | if (full_path == NULL) { | 209 | if (full_path == NULL) { |
210 | FreeXid(xid); | 210 | FreeXid(xid); |
211 | return -ENOMEM; | 211 | return -ENOMEM; |
diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c index 59359911f481..ff93a9f81d1c 100644 --- a/fs/cifs/inode.c +++ b/fs/cifs/inode.c | |||
@@ -574,9 +574,9 @@ int cifs_unlink(struct inode *inode, struct dentry *direntry) | |||
574 | 574 | ||
575 | /* Unlink can be called from rename so we can not grab the sem here | 575 | /* Unlink can be called from rename so we can not grab the sem here |
576 | since we deadlock otherwise */ | 576 | since we deadlock otherwise */ |
577 | /* down(&direntry->d_sb->s_vfs_rename_sem);*/ | 577 | /* mutex_lock(&direntry->d_sb->s_vfs_rename_mutex);*/ |
578 | full_path = build_path_from_dentry(direntry); | 578 | full_path = build_path_from_dentry(direntry); |
579 | /* up(&direntry->d_sb->s_vfs_rename_sem);*/ | 579 | /* mutex_unlock(&direntry->d_sb->s_vfs_rename_mutex);*/ |
580 | if (full_path == NULL) { | 580 | if (full_path == NULL) { |
581 | FreeXid(xid); | 581 | FreeXid(xid); |
582 | return -ENOMEM; | 582 | return -ENOMEM; |
@@ -718,9 +718,9 @@ int cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode) | |||
718 | cifs_sb = CIFS_SB(inode->i_sb); | 718 | cifs_sb = CIFS_SB(inode->i_sb); |
719 | pTcon = cifs_sb->tcon; | 719 | pTcon = cifs_sb->tcon; |
720 | 720 | ||
721 | down(&inode->i_sb->s_vfs_rename_sem); | 721 | mutex_lock(&inode->i_sb->s_vfs_rename_mutex); |
722 | full_path = build_path_from_dentry(direntry); | 722 | full_path = build_path_from_dentry(direntry); |
723 | up(&inode->i_sb->s_vfs_rename_sem); | 723 | mutex_unlock(&inode->i_sb->s_vfs_rename_mutex); |
724 | if (full_path == NULL) { | 724 | if (full_path == NULL) { |
725 | FreeXid(xid); | 725 | FreeXid(xid); |
726 | return -ENOMEM; | 726 | return -ENOMEM; |
@@ -803,9 +803,9 @@ int cifs_rmdir(struct inode *inode, struct dentry *direntry) | |||
803 | cifs_sb = CIFS_SB(inode->i_sb); | 803 | cifs_sb = CIFS_SB(inode->i_sb); |
804 | pTcon = cifs_sb->tcon; | 804 | pTcon = cifs_sb->tcon; |
805 | 805 | ||
806 | down(&inode->i_sb->s_vfs_rename_sem); | 806 | mutex_lock(&inode->i_sb->s_vfs_rename_mutex); |
807 | full_path = build_path_from_dentry(direntry); | 807 | full_path = build_path_from_dentry(direntry); |
808 | up(&inode->i_sb->s_vfs_rename_sem); | 808 | mutex_unlock(&inode->i_sb->s_vfs_rename_mutex); |
809 | if (full_path == NULL) { | 809 | if (full_path == NULL) { |
810 | FreeXid(xid); | 810 | FreeXid(xid); |
811 | return -ENOMEM; | 811 | return -ENOMEM; |
@@ -1137,9 +1137,9 @@ int cifs_setattr(struct dentry *direntry, struct iattr *attrs) | |||
1137 | rc = 0; | 1137 | rc = 0; |
1138 | } | 1138 | } |
1139 | 1139 | ||
1140 | down(&direntry->d_sb->s_vfs_rename_sem); | 1140 | mutex_lock(&direntry->d_sb->s_vfs_rename_mutex); |
1141 | full_path = build_path_from_dentry(direntry); | 1141 | full_path = build_path_from_dentry(direntry); |
1142 | up(&direntry->d_sb->s_vfs_rename_sem); | 1142 | mutex_unlock(&direntry->d_sb->s_vfs_rename_mutex); |
1143 | if (full_path == NULL) { | 1143 | if (full_path == NULL) { |
1144 | FreeXid(xid); | 1144 | FreeXid(xid); |
1145 | return -ENOMEM; | 1145 | return -ENOMEM; |
diff --git a/fs/cifs/link.c b/fs/cifs/link.c index 0f99aae33162..8d0da7c87c7b 100644 --- a/fs/cifs/link.c +++ b/fs/cifs/link.c | |||
@@ -48,10 +48,10 @@ cifs_hardlink(struct dentry *old_file, struct inode *inode, | |||
48 | /* No need to check for cross device links since server will do that | 48 | /* No need to check for cross device links since server will do that |
49 | BB note DFS case in future though (when we may have to check) */ | 49 | BB note DFS case in future though (when we may have to check) */ |
50 | 50 | ||
51 | down(&inode->i_sb->s_vfs_rename_sem); | 51 | mutex_lock(&inode->i_sb->s_vfs_rename_mutex); |
52 | fromName = build_path_from_dentry(old_file); | 52 | fromName = build_path_from_dentry(old_file); |
53 | toName = build_path_from_dentry(direntry); | 53 | toName = build_path_from_dentry(direntry); |
54 | up(&inode->i_sb->s_vfs_rename_sem); | 54 | mutex_unlock(&inode->i_sb->s_vfs_rename_mutex); |
55 | if((fromName == NULL) || (toName == NULL)) { | 55 | if((fromName == NULL) || (toName == NULL)) { |
56 | rc = -ENOMEM; | 56 | rc = -ENOMEM; |
57 | goto cifs_hl_exit; | 57 | goto cifs_hl_exit; |
@@ -103,9 +103,9 @@ cifs_follow_link(struct dentry *direntry, struct nameidata *nd) | |||
103 | 103 | ||
104 | xid = GetXid(); | 104 | xid = GetXid(); |
105 | 105 | ||
106 | down(&direntry->d_sb->s_vfs_rename_sem); | 106 | mutex_lock(&direntry->d_sb->s_vfs_rename_mutex); |
107 | full_path = build_path_from_dentry(direntry); | 107 | full_path = build_path_from_dentry(direntry); |
108 | up(&direntry->d_sb->s_vfs_rename_sem); | 108 | mutex_unlock(&direntry->d_sb->s_vfs_rename_mutex); |
109 | 109 | ||
110 | if (!full_path) | 110 | if (!full_path) |
111 | goto out_no_free; | 111 | goto out_no_free; |
@@ -164,9 +164,9 @@ cifs_symlink(struct inode *inode, struct dentry *direntry, const char *symname) | |||
164 | cifs_sb = CIFS_SB(inode->i_sb); | 164 | cifs_sb = CIFS_SB(inode->i_sb); |
165 | pTcon = cifs_sb->tcon; | 165 | pTcon = cifs_sb->tcon; |
166 | 166 | ||
167 | down(&inode->i_sb->s_vfs_rename_sem); | 167 | mutex_lock(&inode->i_sb->s_vfs_rename_mutex); |
168 | full_path = build_path_from_dentry(direntry); | 168 | full_path = build_path_from_dentry(direntry); |
169 | up(&inode->i_sb->s_vfs_rename_sem); | 169 | mutex_unlock(&inode->i_sb->s_vfs_rename_mutex); |
170 | 170 | ||
171 | if(full_path == NULL) { | 171 | if(full_path == NULL) { |
172 | FreeXid(xid); | 172 | FreeXid(xid); |
@@ -232,9 +232,9 @@ cifs_readlink(struct dentry *direntry, char __user *pBuffer, int buflen) | |||
232 | 232 | ||
233 | /* BB would it be safe against deadlock to grab this sem | 233 | /* BB would it be safe against deadlock to grab this sem |
234 | even though rename itself grabs the sem and calls lookup? */ | 234 | even though rename itself grabs the sem and calls lookup? */ |
235 | /* down(&inode->i_sb->s_vfs_rename_sem);*/ | 235 | /* mutex_lock(&inode->i_sb->s_vfs_rename_mutex);*/ |
236 | full_path = build_path_from_dentry(direntry); | 236 | full_path = build_path_from_dentry(direntry); |
237 | /* up(&inode->i_sb->s_vfs_rename_sem);*/ | 237 | /* mutex_unlock(&inode->i_sb->s_vfs_rename_mutex);*/ |
238 | 238 | ||
239 | if(full_path == NULL) { | 239 | if(full_path == NULL) { |
240 | FreeXid(xid); | 240 | FreeXid(xid); |
diff --git a/fs/cifs/readdir.c b/fs/cifs/readdir.c index 288cc048d37f..edb3b6eb34bc 100644 --- a/fs/cifs/readdir.c +++ b/fs/cifs/readdir.c | |||
@@ -404,9 +404,9 @@ static int initiate_cifs_search(const int xid, struct file *file) | |||
404 | if(pTcon == NULL) | 404 | if(pTcon == NULL) |
405 | return -EINVAL; | 405 | return -EINVAL; |
406 | 406 | ||
407 | down(&file->f_dentry->d_sb->s_vfs_rename_sem); | 407 | mutex_lock(&file->f_dentry->d_sb->s_vfs_rename_mutex); |
408 | full_path = build_path_from_dentry(file->f_dentry); | 408 | full_path = build_path_from_dentry(file->f_dentry); |
409 | up(&file->f_dentry->d_sb->s_vfs_rename_sem); | 409 | mutex_unlock(&file->f_dentry->d_sb->s_vfs_rename_mutex); |
410 | 410 | ||
411 | if(full_path == NULL) { | 411 | if(full_path == NULL) { |
412 | return -ENOMEM; | 412 | return -ENOMEM; |
diff --git a/fs/cifs/xattr.c b/fs/cifs/xattr.c index 777e3363c2a4..3938444d87b2 100644 --- a/fs/cifs/xattr.c +++ b/fs/cifs/xattr.c | |||
@@ -62,9 +62,9 @@ int cifs_removexattr(struct dentry * direntry, const char * ea_name) | |||
62 | cifs_sb = CIFS_SB(sb); | 62 | cifs_sb = CIFS_SB(sb); |
63 | pTcon = cifs_sb->tcon; | 63 | pTcon = cifs_sb->tcon; |
64 | 64 | ||
65 | down(&sb->s_vfs_rename_sem); | 65 | mutex_lock(&sb->s_vfs_rename_mutex); |
66 | full_path = build_path_from_dentry(direntry); | 66 | full_path = build_path_from_dentry(direntry); |
67 | up(&sb->s_vfs_rename_sem); | 67 | mutex_unlock(&sb->s_vfs_rename_mutex); |
68 | if(full_path == NULL) { | 68 | if(full_path == NULL) { |
69 | FreeXid(xid); | 69 | FreeXid(xid); |
70 | return -ENOMEM; | 70 | return -ENOMEM; |
@@ -116,9 +116,9 @@ int cifs_setxattr(struct dentry * direntry, const char * ea_name, | |||
116 | cifs_sb = CIFS_SB(sb); | 116 | cifs_sb = CIFS_SB(sb); |
117 | pTcon = cifs_sb->tcon; | 117 | pTcon = cifs_sb->tcon; |
118 | 118 | ||
119 | down(&sb->s_vfs_rename_sem); | 119 | mutex_lock(&sb->s_vfs_rename_mutex); |
120 | full_path = build_path_from_dentry(direntry); | 120 | full_path = build_path_from_dentry(direntry); |
121 | up(&sb->s_vfs_rename_sem); | 121 | mutex_unlock(&sb->s_vfs_rename_mutex); |
122 | if(full_path == NULL) { | 122 | if(full_path == NULL) { |
123 | FreeXid(xid); | 123 | FreeXid(xid); |
124 | return -ENOMEM; | 124 | return -ENOMEM; |
@@ -223,9 +223,9 @@ ssize_t cifs_getxattr(struct dentry * direntry, const char * ea_name, | |||
223 | cifs_sb = CIFS_SB(sb); | 223 | cifs_sb = CIFS_SB(sb); |
224 | pTcon = cifs_sb->tcon; | 224 | pTcon = cifs_sb->tcon; |
225 | 225 | ||
226 | down(&sb->s_vfs_rename_sem); | 226 | mutex_lock(&sb->s_vfs_rename_mutex); |
227 | full_path = build_path_from_dentry(direntry); | 227 | full_path = build_path_from_dentry(direntry); |
228 | up(&sb->s_vfs_rename_sem); | 228 | mutex_unlock(&sb->s_vfs_rename_mutex); |
229 | if(full_path == NULL) { | 229 | if(full_path == NULL) { |
230 | FreeXid(xid); | 230 | FreeXid(xid); |
231 | return -ENOMEM; | 231 | return -ENOMEM; |
@@ -341,9 +341,9 @@ ssize_t cifs_listxattr(struct dentry * direntry, char * data, size_t buf_size) | |||
341 | cifs_sb = CIFS_SB(sb); | 341 | cifs_sb = CIFS_SB(sb); |
342 | pTcon = cifs_sb->tcon; | 342 | pTcon = cifs_sb->tcon; |
343 | 343 | ||
344 | down(&sb->s_vfs_rename_sem); | 344 | mutex_lock(&sb->s_vfs_rename_mutex); |
345 | full_path = build_path_from_dentry(direntry); | 345 | full_path = build_path_from_dentry(direntry); |
346 | up(&sb->s_vfs_rename_sem); | 346 | mutex_unlock(&sb->s_vfs_rename_mutex); |
347 | if(full_path == NULL) { | 347 | if(full_path == NULL) { |
348 | FreeXid(xid); | 348 | FreeXid(xid); |
349 | return -ENOMEM; | 349 | return -ENOMEM; |