]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - fs/ext4/ext4.h
ext4: Properly update i_disksize.
[linux-2.6-omap-h63xx.git] / fs / ext4 / ext4.h
index e13b9deee866054a12337d49ad134be90e7fc142..3e47b99a763c0a16bc94f48fd13c0bcb12ea1b4c 100644 (file)
@@ -1218,6 +1218,17 @@ do {                                                             \
 #define EXT4_FREEBLOCKS_WATERMARK 0
 #endif
 
+static inline void ext4_update_i_disksize(struct inode *inode, loff_t newsize)
+{
+       /*
+        * XXX: replace with spinlock if seen contended -bzzz
+        */
+       down_write(&EXT4_I(inode)->i_data_sem);
+       if (newsize > EXT4_I(inode)->i_disksize)
+               EXT4_I(inode)->i_disksize = newsize;
+       up_write(&EXT4_I(inode)->i_data_sem);
+       return ;
+}
 
 /*
  * Inodes and files operations