Skip to content

Commit

Permalink
Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/jack/linux-udf-2.6

* 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-udf-2.6: (41 commits)
  udf: use crc_itu_t from lib instead of udf_crc
  udf: Fix compilation warnings when UDF debug is on
  udf: Fix bug in VAT mapping code
  udf: Add read-only support for 2.50 UDF media
  udf: Fix handling of multisession media
  udf: Mount filesystem read-only if it has pseudooverwrite partition
  udf: Handle VAT packed inside inode properly
  udf: Allow loading of VAT inode
  udf: Fix detection of VAT version
  udf: Silence warning about accesses beyond end of device
  udf: Improve anchor block detection
  udf: Cleanup anchor block detection.
  udf: Move processing of virtual partitions
  udf: Move filling of partition descriptor info into a separate function
  udf: Improve error recovery on mount
  udf: Cleanup volume descriptor sequence processing
  udf: fix anchor point detection
  udf: Remove declarations of arrays of size UDF_NAME_LEN (256 bytes)
  udf: Remove checking of existence of filename in udf_add_entry()
  udf: Mark udf_process_sequence() as noinline
  ...
  • Loading branch information
Linus Torvalds committed Apr 22, 2008
2 parents 26defe3 + f845fce commit 62429f4
Show file tree
Hide file tree
Showing 26 changed files with 1,173 additions and 1,561 deletions.
1 change: 1 addition & 0 deletions fs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -689,6 +689,7 @@ config ZISOFS

config UDF_FS
tristate "UDF file system support"
select CRC_ITU_T
help
This is the new file system used on some CD-ROMs and DVDs. Say Y if
you intend to mount DVD discs or CDRW's written in packet mode, or
Expand Down
2 changes: 1 addition & 1 deletion fs/udf/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ obj-$(CONFIG_UDF_FS) += udf.o

udf-objs := balloc.o dir.o file.o ialloc.o inode.o lowlevel.o namei.o \
partition.o super.o truncate.o symlink.o fsync.o \
crc.o directory.o misc.o udftime.o unicode.o
directory.o misc.o udftime.o unicode.o
13 changes: 4 additions & 9 deletions fs/udf/balloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,7 @@ static bool udf_add_free_space(struct udf_sb_info *sbi,
return false;

lvid = (struct logicalVolIntegrityDesc *)sbi->s_lvid_bh->b_data;
lvid->freeSpaceTable[partition] = cpu_to_le32(le32_to_cpu(
lvid->freeSpaceTable[partition]) + cnt);
le32_add_cpu(&lvid->freeSpaceTable[partition], cnt);
return true;
}

Expand Down Expand Up @@ -589,10 +588,8 @@ static void udf_table_free_blocks(struct super_block *sb,
sptr = oepos.bh->b_data + epos.offset;
aed = (struct allocExtDesc *)
oepos.bh->b_data;
aed->lengthAllocDescs =
cpu_to_le32(le32_to_cpu(
aed->lengthAllocDescs) +
adsize);
le32_add_cpu(&aed->lengthAllocDescs,
adsize);
} else {
sptr = iinfo->i_ext.i_data +
epos.offset;
Expand Down Expand Up @@ -645,9 +642,7 @@ static void udf_table_free_blocks(struct super_block *sb,
mark_inode_dirty(table);
} else {
aed = (struct allocExtDesc *)epos.bh->b_data;
aed->lengthAllocDescs =
cpu_to_le32(le32_to_cpu(
aed->lengthAllocDescs) + adsize);
le32_add_cpu(&aed->lengthAllocDescs, adsize);
udf_update_tag(epos.bh->b_data, epos.offset);
mark_buffer_dirty(epos.bh);
}
Expand Down
172 changes: 0 additions & 172 deletions fs/udf/crc.c

This file was deleted.

83 changes: 27 additions & 56 deletions fs/udf/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@
static int do_udf_readdir(struct inode *dir, struct file *filp,
filldir_t filldir, void *dirent)
{
struct udf_fileident_bh fibh;
struct udf_fileident_bh fibh = { .sbh = NULL, .ebh = NULL};
struct fileIdentDesc *fi = NULL;
struct fileIdentDesc cfi;
int block, iblock;
loff_t nf_pos = (filp->f_pos - 1) << 2;
int flen;
char fname[UDF_NAME_LEN];
char *fname = NULL;
char *nameptr;
uint16_t liu;
uint8_t lfi;
Expand All @@ -54,23 +54,32 @@ static int do_udf_readdir(struct inode *dir, struct file *filp,
kernel_lb_addr eloc;
uint32_t elen;
sector_t offset;
int i, num;
int i, num, ret = 0;
unsigned int dt_type;
struct extent_position epos = { NULL, 0, {0, 0} };
struct udf_inode_info *iinfo;

if (nf_pos >= size)
return 0;
goto out;

fname = kmalloc(UDF_NAME_LEN, GFP_NOFS);
if (!fname) {
ret = -ENOMEM;
goto out;
}

if (nf_pos == 0)
nf_pos = udf_ext0_offset(dir);

fibh.soffset = fibh.eoffset = nf_pos & (dir->i_sb->s_blocksize - 1);
iinfo = UDF_I(dir);
if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_IN_ICB) {
fibh.sbh = fibh.ebh = NULL;
} else if (inode_bmap(dir, nf_pos >> dir->i_sb->s_blocksize_bits,
&epos, &eloc, &elen, &offset) == (EXT_RECORDED_ALLOCATED >> 30)) {
if (iinfo->i_alloc_type != ICBTAG_FLAG_AD_IN_ICB) {
if (inode_bmap(dir, nf_pos >> dir->i_sb->s_blocksize_bits,
&epos, &eloc, &elen, &offset)
!= (EXT_RECORDED_ALLOCATED >> 30)) {
ret = -ENOENT;
goto out;
}
block = udf_get_lb_pblock(dir->i_sb, eloc, offset);
if ((++offset << dir->i_sb->s_blocksize_bits) < elen) {
if (iinfo->i_alloc_type == ICBTAG_FLAG_AD_SHORT)
Expand All @@ -83,8 +92,8 @@ static int do_udf_readdir(struct inode *dir, struct file *filp,
}

if (!(fibh.sbh = fibh.ebh = udf_tread(dir->i_sb, block))) {
brelse(epos.bh);
return -EIO;
ret = -EIO;
goto out;
}

if (!(offset & ((16 >> (dir->i_sb->s_blocksize_bits - 9)) - 1))) {
Expand All @@ -105,23 +114,15 @@ static int do_udf_readdir(struct inode *dir, struct file *filp,
brelse(bha[i]);
}
}
} else {
brelse(epos.bh);
return -ENOENT;
}

while (nf_pos < size) {
filp->f_pos = (nf_pos >> 2) + 1;

fi = udf_fileident_read(dir, &nf_pos, &fibh, &cfi, &epos, &eloc,
&elen, &offset);
if (!fi) {
if (fibh.sbh != fibh.ebh)
brelse(fibh.ebh);
brelse(fibh.sbh);
brelse(epos.bh);
return 0;
}
if (!fi)
goto out;

liu = le16_to_cpu(cfi.lengthOfImpUse);
lfi = cfi.lengthFileIdent;
Expand Down Expand Up @@ -167,53 +168,23 @@ static int do_udf_readdir(struct inode *dir, struct file *filp,
dt_type = DT_UNKNOWN;
}

if (flen) {
if (filldir(dirent, fname, flen, filp->f_pos, iblock, dt_type) < 0) {
if (fibh.sbh != fibh.ebh)
brelse(fibh.ebh);
brelse(fibh.sbh);
brelse(epos.bh);
return 0;
}
}
if (flen && filldir(dirent, fname, flen, filp->f_pos,
iblock, dt_type) < 0)
goto out;
} /* end while */

filp->f_pos = (nf_pos >> 2) + 1;

out:
if (fibh.sbh != fibh.ebh)
brelse(fibh.ebh);
brelse(fibh.sbh);
brelse(epos.bh);
kfree(fname);

return 0;
return ret;
}

/*
* udf_readdir
*
* PURPOSE
* Read a directory entry.
*
* DESCRIPTION
* Optional - sys_getdents() will return -ENOTDIR if this routine is not
* available.
*
* Refer to sys_getdents() in fs/readdir.c
* sys_getdents() -> .
*
* PRE-CONDITIONS
* filp Pointer to directory file.
* buf Pointer to directory entry buffer.
* filldir Pointer to filldir function.
*
* POST-CONDITIONS
* <return> >=0 on success.
*
* HISTORY
* July 1, 1997 - Andrew E. Mileski
* Written, tested, and released.
*/

static int udf_readdir(struct file *filp, void *dirent, filldir_t filldir)
{
struct inode *dir = filp->f_path.dentry->d_inode;
Expand Down
13 changes: 0 additions & 13 deletions fs/udf/ecma_167.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,6 @@ typedef struct {
uint8_t microseconds;
} __attribute__ ((packed)) timestamp;

typedef struct {
uint16_t typeAndTimezone;
int16_t year;
uint8_t month;
uint8_t day;
uint8_t hour;
uint8_t minute;
uint8_t second;
uint8_t centiseconds;
uint8_t hundredsOfMicroseconds;
uint8_t microseconds;
} __attribute__ ((packed)) kernel_timestamp;

/* Type and Time Zone (ECMA 167r3 1/7.3.1) */
#define TIMESTAMP_TYPE_MASK 0xF000
#define TIMESTAMP_TYPE_CUT 0x0000
Expand Down
Loading

0 comments on commit 62429f4

Please sign in to comment.