aboutsummaryrefslogtreecommitdiffstats
path: root/fs/fat/dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/fat/dir.c')
-rw-r--r--fs/fat/dir.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/fs/fat/dir.c b/fs/fat/dir.c
index 165012ef363a..7a6f02caf286 100644
--- a/fs/fat/dir.c
+++ b/fs/fat/dir.c
@@ -964,6 +964,29 @@ int fat_scan(struct inode *dir, const unsigned char *name,
964} 964}
965EXPORT_SYMBOL_GPL(fat_scan); 965EXPORT_SYMBOL_GPL(fat_scan);
966 966
967/*
968 * Scans a directory for a given logstart.
969 * Returns an error code or zero.
970 */
971int fat_scan_logstart(struct inode *dir, int i_logstart,
972 struct fat_slot_info *sinfo)
973{
974 struct super_block *sb = dir->i_sb;
975
976 sinfo->slot_off = 0;
977 sinfo->bh = NULL;
978 while (fat_get_short_entry(dir, &sinfo->slot_off, &sinfo->bh,
979 &sinfo->de) >= 0) {
980 if (fat_get_start(MSDOS_SB(sb), sinfo->de) == i_logstart) {
981 sinfo->slot_off -= sizeof(*sinfo->de);
982 sinfo->nr_slots = 1;
983 sinfo->i_pos = fat_make_i_pos(sb, sinfo->bh, sinfo->de);
984 return 0;
985 }
986 }
987 return -ENOENT;
988}
989
967static int __fat_remove_entries(struct inode *dir, loff_t pos, int nr_slots) 990static int __fat_remove_entries(struct inode *dir, loff_t pos, int nr_slots)
968{ 991{
969 struct super_block *sb = dir->i_sb; 992 struct super_block *sb = dir->i_sb;