diff options
author | Jan Kara <jack@suse.cz> | 2008-03-04 13:10:29 +0100 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2008-04-17 14:23:03 +0200 |
commit | 9bf2c6b834f4caad82b3e2d962c266153d39e411 (patch) | |
tree | 5386b3eb6dec103815b81e92d5977a59ef5c4ec9 /fs/udf | |
parent | 200a3592cda7bfc010d30c0b1eb8eff3791e9ba9 (diff) | |
download | linux-stable-9bf2c6b834f4caad82b3e2d962c266153d39e411.tar.gz linux-stable-9bf2c6b834f4caad82b3e2d962c266153d39e411.tar.bz2 linux-stable-9bf2c6b834f4caad82b3e2d962c266153d39e411.zip |
udf: Remove checking of existence of filename in udf_add_entry()
We don't have to check whether a directory entry already exists in a directory
when creating a new one since we've already checked that earlier by lookup and
we are holding directory i_mutex all the time.
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf')
-rw-r--r-- | fs/udf/namei.c | 38 |
1 files changed, 1 insertions, 37 deletions
diff --git a/fs/udf/namei.c b/fs/udf/namei.c index ac7f72779e93..e9f587201e17 100644 --- a/fs/udf/namei.c +++ b/fs/udf/namei.c @@ -303,11 +303,9 @@ static struct fileIdentDesc *udf_add_entry(struct inode *dir, { struct super_block *sb = dir->i_sb; struct fileIdentDesc *fi = NULL; - char name[UDF_NAME_LEN], fname[UDF_NAME_LEN]; + char name[UDF_NAME_LEN]; int namelen; loff_t f_pos; - int flen; - char *nameptr; loff_t size = udf_ext0_offset(dir) + dir->i_size; int nfidlen; uint8_t lfi; @@ -385,26 +383,6 @@ static struct fileIdentDesc *udf_add_entry(struct inode *dir, liu = le16_to_cpu(cfi->lengthOfImpUse); lfi = cfi->lengthFileIdent; - if (fibh->sbh == fibh->ebh) - nameptr = fi->fileIdent + liu; - else { - int poffset; /* Unpaded ending offset */ - - poffset = fibh->soffset + sizeof(struct fileIdentDesc) + - liu + lfi; - - if (poffset >= lfi) - nameptr = (char *)(fibh->ebh->b_data + - poffset - lfi); - else { - nameptr = fname; - memcpy(nameptr, fi->fileIdent + liu, - lfi - poffset); - memcpy(nameptr + lfi - poffset, - fibh->ebh->b_data, poffset); - } - } - if ((cfi->fileCharacteristics & FID_FILE_CHAR_DELETED) != 0) { if (((sizeof(struct fileIdentDesc) + liu + lfi + 3) & ~3) == nfidlen) { @@ -423,20 +401,6 @@ static struct fileIdentDesc *udf_add_entry(struct inode *dir, } } } - - if (!lfi || !dentry) - continue; - - flen = udf_get_filename(dir->i_sb, nameptr, fname, lfi); - if (flen && udf_match(flen, fname, dentry->d_name.len, - dentry->d_name.name)) { - if (fibh->sbh != fibh->ebh) - brelse(fibh->ebh); - brelse(fibh->sbh); - brelse(epos.bh); - *err = -EEXIST; - return NULL; - } } add: |