~ubuntu-branches/ubuntu/precise/linux-ti-omap4/precise

« back to all changes in this revision

Viewing changes to fs/adfs/dir_f.c

  • Committer: Bazaar Package Importer
  • Author(s): Paolo Pisati
  • Date: 2011-06-29 15:23:51 UTC
  • mfrom: (26.1.1 natty-proposed)
  • Revision ID: james.westby@ubuntu.com-20110629152351-xs96tm303d95rpbk
Tags: 3.0.0-1200.2
* Rebased against 3.0.0-6.7
* BSP from TI based on 3.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
52
52
                        *buf++ = *ptr;
53
53
                ptr++;
54
54
        }
55
 
        *buf = '\0';
56
55
 
57
56
        return buf - old_buf;
58
57
}
208
207
 * convert a disk-based directory entry to a Linux ADFS directory entry
209
208
 */
210
209
static inline void
211
 
adfs_dir2obj(struct object_info *obj, struct adfs_direntry *de)
 
210
adfs_dir2obj(struct adfs_dir *dir, struct object_info *obj,
 
211
        struct adfs_direntry *de)
212
212
{
213
213
        obj->name_len = adfs_readname(obj->name, de->dirobname, ADFS_F_NAME_LEN);
214
214
        obj->file_id  = adfs_readval(de->dirinddiscadd, 3);
216
216
        obj->execaddr = adfs_readval(de->direxec, 4);
217
217
        obj->size     = adfs_readval(de->dirlen,  4);
218
218
        obj->attr     = de->newdiratts;
 
219
        obj->filetype = -1;
 
220
 
 
221
        /*
 
222
         * object is a file and is filetyped and timestamped?
 
223
         * RISC OS 12-bit filetype is stored in load_address[19:8]
 
224
         */
 
225
        if ((0 == (obj->attr & ADFS_NDA_DIRECTORY)) &&
 
226
                (0xfff00000 == (0xfff00000 & obj->loadaddr))) {
 
227
                obj->filetype = (__u16) ((0x000fff00 & obj->loadaddr) >> 8);
 
228
 
 
229
                /* optionally append the ,xyz hex filetype suffix */
 
230
                if (ADFS_SB(dir->sb)->s_ftsuffix)
 
231
                        obj->name_len +=
 
232
                                append_filetype_suffix(
 
233
                                        &obj->name[obj->name_len],
 
234
                                        obj->filetype);
 
235
        }
219
236
}
220
237
 
221
238
/*
260
277
        if (!de.dirobname[0])
261
278
                return -ENOENT;
262
279
 
263
 
        adfs_dir2obj(obj, &de);
 
280
        adfs_dir2obj(dir, obj, &de);
264
281
 
265
282
        return 0;
266
283
}