diff options
author | David Howells <dhowells@redhat.com> | 2007-04-26 18:49:28 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2007-04-26 18:49:28 -0400 |
commit | ec26815ad847dbf74a1e27aa5515fb7d5dc6ee6f (patch) | |
tree | 32510ab35b3524f6be9231ab8065b80be5d9b68d /fs/afs/dir.c | |
parent | 17926a79320afa9b95df6b977b40cca6d8713cea (diff) |
[AFS]: Clean up the AFS sources
Clean up the AFS sources.
Also remove references to AFS keys. RxRPC keys are used instead.
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'fs/afs/dir.c')
-rw-r--r-- | fs/afs/dir.c | 50 |
1 files changed, 18 insertions, 32 deletions
diff --git a/fs/afs/dir.c b/fs/afs/dir.c index b6dc2ebe47a8..2f6d92376461 100644 --- a/fs/afs/dir.c +++ b/fs/afs/dir.c | |||
@@ -112,7 +112,6 @@ struct afs_dir_lookup_cookie { | |||
112 | int found; | 112 | int found; |
113 | }; | 113 | }; |
114 | 114 | ||
115 | /*****************************************************************************/ | ||
116 | /* | 115 | /* |
117 | * check that a directory page is valid | 116 | * check that a directory page is valid |
118 | */ | 117 | */ |
@@ -157,13 +156,11 @@ static inline void afs_dir_check_page(struct inode *dir, struct page *page) | |||
157 | SetPageChecked(page); | 156 | SetPageChecked(page); |
158 | return; | 157 | return; |
159 | 158 | ||
160 | error: | 159 | error: |
161 | SetPageChecked(page); | 160 | SetPageChecked(page); |
162 | SetPageError(page); | 161 | SetPageError(page); |
162 | } | ||
163 | 163 | ||
164 | } /* end afs_dir_check_page() */ | ||
165 | |||
166 | /*****************************************************************************/ | ||
167 | /* | 164 | /* |
168 | * discard a page cached in the pagecache | 165 | * discard a page cached in the pagecache |
169 | */ | 166 | */ |
@@ -171,10 +168,8 @@ static inline void afs_dir_put_page(struct page *page) | |||
171 | { | 168 | { |
172 | kunmap(page); | 169 | kunmap(page); |
173 | page_cache_release(page); | 170 | page_cache_release(page); |
171 | } | ||
174 | 172 | ||
175 | } /* end afs_dir_put_page() */ | ||
176 | |||
177 | /*****************************************************************************/ | ||
178 | /* | 173 | /* |
179 | * get a page into the pagecache | 174 | * get a page into the pagecache |
180 | */ | 175 | */ |
@@ -197,12 +192,11 @@ static struct page *afs_dir_get_page(struct inode *dir, unsigned long index) | |||
197 | } | 192 | } |
198 | return page; | 193 | return page; |
199 | 194 | ||
200 | fail: | 195 | fail: |
201 | afs_dir_put_page(page); | 196 | afs_dir_put_page(page); |
202 | return ERR_PTR(-EIO); | 197 | return ERR_PTR(-EIO); |
203 | } /* end afs_dir_get_page() */ | 198 | } |
204 | 199 | ||
205 | /*****************************************************************************/ | ||
206 | /* | 200 | /* |
207 | * open an AFS directory file | 201 | * open an AFS directory file |
208 | */ | 202 | */ |
@@ -218,10 +212,8 @@ static int afs_dir_open(struct inode *inode, struct file *file) | |||
218 | 212 | ||
219 | _leave(" = 0"); | 213 | _leave(" = 0"); |
220 | return 0; | 214 | return 0; |
215 | } | ||
221 | 216 | ||
222 | } /* end afs_dir_open() */ | ||
223 | |||
224 | /*****************************************************************************/ | ||
225 | /* | 217 | /* |
226 | * deal with one block in an AFS directory | 218 | * deal with one block in an AFS directory |
227 | */ | 219 | */ |
@@ -316,9 +308,8 @@ static int afs_dir_iterate_block(unsigned *fpos, | |||
316 | 308 | ||
317 | _leave(" = 1 [more]"); | 309 | _leave(" = 1 [more]"); |
318 | return 1; | 310 | return 1; |
319 | } /* end afs_dir_iterate_block() */ | 311 | } |
320 | 312 | ||
321 | /*****************************************************************************/ | ||
322 | /* | 313 | /* |
323 | * read an AFS directory | 314 | * read an AFS directory |
324 | */ | 315 | */ |
@@ -377,12 +368,11 @@ static int afs_dir_iterate(struct inode *dir, unsigned *fpos, void *cookie, | |||
377 | ret = 0; | 368 | ret = 0; |
378 | } | 369 | } |
379 | 370 | ||
380 | out: | 371 | out: |
381 | _leave(" = %d", ret); | 372 | _leave(" = %d", ret); |
382 | return ret; | 373 | return ret; |
383 | } /* end afs_dir_iterate() */ | 374 | } |
384 | 375 | ||
385 | /*****************************************************************************/ | ||
386 | /* | 376 | /* |
387 | * read an AFS directory | 377 | * read an AFS directory |
388 | */ | 378 | */ |
@@ -399,9 +389,8 @@ static int afs_dir_readdir(struct file *file, void *cookie, filldir_t filldir) | |||
399 | 389 | ||
400 | _leave(" = %d", ret); | 390 | _leave(" = %d", ret); |
401 | return ret; | 391 | return ret; |
402 | } /* end afs_dir_readdir() */ | 392 | } |
403 | 393 | ||
404 | /*****************************************************************************/ | ||
405 | /* | 394 | /* |
406 | * search the directory for a name | 395 | * search the directory for a name |
407 | * - if afs_dir_iterate_block() spots this function, it'll pass the FID | 396 | * - if afs_dir_iterate_block() spots this function, it'll pass the FID |
@@ -426,9 +415,8 @@ static int afs_dir_lookup_filldir(void *_cookie, const char *name, int nlen, | |||
426 | 415 | ||
427 | _leave(" = -1 [found]"); | 416 | _leave(" = -1 [found]"); |
428 | return -1; | 417 | return -1; |
429 | } /* end afs_dir_lookup_filldir() */ | 418 | } |
430 | 419 | ||
431 | /*****************************************************************************/ | ||
432 | /* | 420 | /* |
433 | * look up an entry in a directory | 421 | * look up an entry in a directory |
434 | */ | 422 | */ |
@@ -498,9 +486,8 @@ static struct dentry *afs_dir_lookup(struct inode *dir, struct dentry *dentry, | |||
498 | dentry->d_inode->i_version); | 486 | dentry->d_inode->i_version); |
499 | 487 | ||
500 | return NULL; | 488 | return NULL; |
501 | } /* end afs_dir_lookup() */ | 489 | } |
502 | 490 | ||
503 | /*****************************************************************************/ | ||
504 | /* | 491 | /* |
505 | * check that a dentry lookup hit has found a valid entry | 492 | * check that a dentry lookup hit has found a valid entry |
506 | * - NOTE! the hit can be a negative hit too, so we can't assume we have an | 493 | * - NOTE! the hit can be a negative hit too, so we can't assume we have an |
@@ -605,18 +592,18 @@ static int afs_d_revalidate(struct dentry *dentry, struct nameidata *nd) | |||
605 | (void *) (unsigned long) AFS_FS_I(dir)->status.version; | 592 | (void *) (unsigned long) AFS_FS_I(dir)->status.version; |
606 | } | 593 | } |
607 | 594 | ||
608 | out_valid: | 595 | out_valid: |
609 | dput(parent); | 596 | dput(parent); |
610 | _leave(" = 1 [valid]"); | 597 | _leave(" = 1 [valid]"); |
611 | return 1; | 598 | return 1; |
612 | 599 | ||
613 | /* the dirent, if it exists, now points to a different vnode */ | 600 | /* the dirent, if it exists, now points to a different vnode */ |
614 | not_found: | 601 | not_found: |
615 | spin_lock(&dentry->d_lock); | 602 | spin_lock(&dentry->d_lock); |
616 | dentry->d_flags |= DCACHE_NFSFS_RENAMED; | 603 | dentry->d_flags |= DCACHE_NFSFS_RENAMED; |
617 | spin_unlock(&dentry->d_lock); | 604 | spin_unlock(&dentry->d_lock); |
618 | 605 | ||
619 | out_bad: | 606 | out_bad: |
620 | if (inode) { | 607 | if (inode) { |
621 | /* don't unhash if we have submounts */ | 608 | /* don't unhash if we have submounts */ |
622 | if (have_submounts(dentry)) | 609 | if (have_submounts(dentry)) |
@@ -633,9 +620,8 @@ static int afs_d_revalidate(struct dentry *dentry, struct nameidata *nd) | |||
633 | 620 | ||
634 | _leave(" = 0 [bad]"); | 621 | _leave(" = 0 [bad]"); |
635 | return 0; | 622 | return 0; |
636 | } /* end afs_d_revalidate() */ | 623 | } |
637 | 624 | ||
638 | /*****************************************************************************/ | ||
639 | /* | 625 | /* |
640 | * allow the VFS to enquire as to whether a dentry should be unhashed (mustn't | 626 | * allow the VFS to enquire as to whether a dentry should be unhashed (mustn't |
641 | * sleep) | 627 | * sleep) |
@@ -657,7 +643,7 @@ static int afs_d_delete(struct dentry *dentry) | |||
657 | _leave(" = 0 [keep]"); | 643 | _leave(" = 0 [keep]"); |
658 | return 0; | 644 | return 0; |
659 | 645 | ||
660 | zap: | 646 | zap: |
661 | _leave(" = 1 [zap]"); | 647 | _leave(" = 1 [zap]"); |
662 | return 1; | 648 | return 1; |
663 | } /* end afs_d_delete() */ | 649 | } |