--- zzzz-none-000/linux-3.10.107/fs/reiserfs/ioctl.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/fs/reiserfs/ioctl.c 2021-02-04 17:41:59.000000000 +0000 @@ -7,7 +7,7 @@ #include #include "reiserfs.h" #include -#include +#include #include #include @@ -15,7 +15,8 @@ * reiserfs_ioctl - handler for ioctl for inode * supported commands: * 1) REISERFS_IOC_UNPACK - try to unpack tail from direct item into indirect - * and prevent packing file (argument arg has to be non-zero) + * and prevent packing file (argument arg has t + * be non-zero) * 2) REISERFS_IOC_[GS]ETFLAGS, REISERFS_IOC_[GS]ETVERSION * 3) That's all for a while ... */ @@ -132,7 +133,10 @@ long reiserfs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { - /* These are just misnamed, they actually get/put from/to user an int */ + /* + * These are just misnamed, they actually + * get/put from/to user an int + */ switch (cmd) { case REISERFS_IOC32_UNPACK: cmd = REISERFS_IOC_UNPACK; @@ -160,14 +164,13 @@ int reiserfs_commit_write(struct file *f, struct page *page, unsigned from, unsigned to); /* -** reiserfs_unpack -** Function try to convert tail from direct item into indirect. -** It set up nopack attribute in the REISERFS_I(inode)->nopack -*/ + * reiserfs_unpack + * Function try to convert tail from direct item into indirect. + * It set up nopack attribute in the REISERFS_I(inode)->nopack + */ int reiserfs_unpack(struct inode *inode, struct file *filp) { int retval = 0; - int depth; int index; struct page *page; struct address_space *mapping; @@ -183,11 +186,11 @@ return 0; } - depth = reiserfs_write_lock_once(inode->i_sb); - /* we need to make sure nobody is changing the file size beneath us */ reiserfs_mutex_lock_safe(&inode->i_mutex, inode->i_sb); + reiserfs_write_lock(inode->i_sb); + write_from = inode->i_size & (blocksize - 1); /* if we are on a block boundary, we are already unpacked. */ if (write_from == 0) { @@ -195,9 +198,10 @@ goto out; } - /* we unpack by finding the page with the tail, and calling - ** __reiserfs_write_begin on that page. This will force a - ** reiserfs_get_block to unpack the tail for us. + /* + * we unpack by finding the page with the tail, and calling + * __reiserfs_write_begin on that page. This will force a + * reiserfs_get_block to unpack the tail for us. */ index = inode->i_size >> PAGE_CACHE_SHIFT; mapping = inode->i_mapping; @@ -215,12 +219,12 @@ retval = reiserfs_commit_write(NULL, page, write_from, write_from); REISERFS_I(inode)->i_flags |= i_nopack_mask; - out_unlock: +out_unlock: unlock_page(page); page_cache_release(page); - out: +out: mutex_unlock(&inode->i_mutex); - reiserfs_write_unlock_once(inode->i_sb, depth); + reiserfs_write_unlock(inode->i_sb); return retval; }