From d3e71cb08747743fce908122bab08b479eb403a5 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Mon, 27 Mar 2000 23:54:12 +0000 Subject: Merge with Linux 2.3.99-pre3. --- fs/udf/inode.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'fs/udf/inode.c') 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; } -- cgit v1.2.3