diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-03-27 23:54:12 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-03-27 23:54:12 +0000 |
commit | d3e71cb08747743fce908122bab08b479eb403a5 (patch) | |
tree | cbec6948fdbdee9af81cf3ecfb504070d2745d7b /fs/udf/inode.c | |
parent | fe7ff1706e323d0e5ed83972960a1ecc1ee538b3 (diff) |
Merge with Linux 2.3.99-pre3.
Diffstat (limited to 'fs/udf/inode.c')
-rw-r--r-- | fs/udf/inode.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/fs/udf/inode.c b/fs/udf/inode.c index 264086135..ed1507fa7 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c @@ -74,10 +74,13 @@ static int udf_get_block(struct inode *, long, struct buffer_head *, int); */ void udf_put_inode(struct inode * inode) { - lock_kernel(); - udf_discard_prealloc(inode); - write_inode_now(inode); - unlock_kernel(); + if (!(inode->i_sb->s_flags & MS_RDONLY)) + { + lock_kernel(); + udf_discard_prealloc(inode); + write_inode_now(inode); + unlock_kernel(); + } } /* @@ -130,7 +133,7 @@ static int udf_readpage(struct dentry *dentry, struct page *page) return block_read_full_page(page, udf_get_block); } -static int udf_prepare_write(struct page *page, unsigned from, unsigned to) +static int udf_prepare_write(struct file *file, struct page *page, unsigned from, unsigned to) { return block_prepare_write(page, from, to, udf_get_block); } @@ -1554,16 +1557,18 @@ int udf_add_aext(struct inode *inode, lb_addr *bloc, int *extoffset, case ICB_FLAG_AD_SHORT: { sad = (short_ad *)sptr; - sad->extLength = EXTENT_NEXT_EXTENT_ALLOCDECS << 30 | - inode->i_sb->s_blocksize; + sad->extLength = cpu_to_le32( + EXTENT_NEXT_EXTENT_ALLOCDECS << 30 | + inode->i_sb->s_blocksize); sad->extPosition = cpu_to_le32(bloc->logicalBlockNum); break; } case ICB_FLAG_AD_LONG: { lad = (long_ad *)sptr; - lad->extLength = EXTENT_NEXT_EXTENT_ALLOCDECS << 30 | - inode->i_sb->s_blocksize; + lad->extLength = cpu_to_le32( + EXTENT_NEXT_EXTENT_ALLOCDECS << 30 | + inode->i_sb->s_blocksize); lad->extLocation = cpu_to_lelb(*bloc); break; } |