diff options
Diffstat (limited to 'fs/adfs/dir_f.c')
-rw-r--r-- | fs/adfs/dir_f.c | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/fs/adfs/dir_f.c b/fs/adfs/dir_f.c index ea7df2146921..bafc71222e25 100644 --- a/fs/adfs/dir_f.c +++ b/fs/adfs/dir_f.c | |||
@@ -9,15 +9,7 @@ | |||
9 | * | 9 | * |
10 | * E and F format directory handling | 10 | * E and F format directory handling |
11 | */ | 11 | */ |
12 | #include <linux/errno.h> | ||
13 | #include <linux/fs.h> | ||
14 | #include <linux/adfs_fs.h> | ||
15 | #include <linux/time.h> | ||
16 | #include <linux/stat.h> | ||
17 | #include <linux/spinlock.h> | ||
18 | #include <linux/buffer_head.h> | 12 | #include <linux/buffer_head.h> |
19 | #include <linux/string.h> | ||
20 | |||
21 | #include "adfs.h" | 13 | #include "adfs.h" |
22 | #include "dir_f.h" | 14 | #include "dir_f.h" |
23 | 15 | ||
@@ -437,6 +429,22 @@ bad_dir: | |||
437 | #endif | 429 | #endif |
438 | } | 430 | } |
439 | 431 | ||
432 | static int | ||
433 | adfs_f_sync(struct adfs_dir *dir) | ||
434 | { | ||
435 | int err = 0; | ||
436 | int i; | ||
437 | |||
438 | for (i = dir->nr_buffers - 1; i >= 0; i--) { | ||
439 | struct buffer_head *bh = dir->bh[i]; | ||
440 | sync_dirty_buffer(bh); | ||
441 | if (buffer_req(bh) && !buffer_uptodate(bh)) | ||
442 | err = -EIO; | ||
443 | } | ||
444 | |||
445 | return err; | ||
446 | } | ||
447 | |||
440 | static void | 448 | static void |
441 | adfs_f_free(struct adfs_dir *dir) | 449 | adfs_f_free(struct adfs_dir *dir) |
442 | { | 450 | { |
@@ -456,5 +464,6 @@ struct adfs_dir_ops adfs_f_dir_ops = { | |||
456 | .setpos = adfs_f_setpos, | 464 | .setpos = adfs_f_setpos, |
457 | .getnext = adfs_f_getnext, | 465 | .getnext = adfs_f_getnext, |
458 | .update = adfs_f_update, | 466 | .update = adfs_f_update, |
467 | .sync = adfs_f_sync, | ||
459 | .free = adfs_f_free | 468 | .free = adfs_f_free |
460 | }; | 469 | }; |