Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git] / fs / smbfs / file.c
index e97fc58..ed9a24d 100644 (file)
@@ -78,7 +78,8 @@ smb_readpage_sync(struct dentry *dentry, struct page *page)
                count -= result;
                offset += result;
                buffer += result;
-               dentry->d_inode->i_atime = CURRENT_TIME;
+               dentry->d_inode->i_atime =
+                       current_fs_time(dentry->d_inode->i_sb);
                if (result < rsize)
                        break;
        } while (count);
@@ -152,7 +153,7 @@ smb_writepage_sync(struct inode *inode, struct page *page,
                /*
                 * Update the inode now rather than waiting for a refresh.
                 */
-               inode->i_mtime = inode->i_atime = CURRENT_TIME;
+               inode->i_mtime = inode->i_atime = current_fs_time(inode->i_sb);
                SMB_I(inode)->flags |= SMB_F_LOCALWRITE;
                if (offset > inode->i_size)
                        inode->i_size = offset;
@@ -177,11 +178,9 @@ smb_writepage(struct page *page, struct writeback_control *wbc)
        unsigned offset = PAGE_CACHE_SIZE;
        int err;
 
-       if (!mapping)
-               BUG();
+       BUG_ON(!mapping);
        inode = mapping->host;
-       if (!inode)
-               BUG();
+       BUG_ON(!inode);
 
        end_index = inode->i_size >> PAGE_CACHE_SHIFT;
 
@@ -208,8 +207,8 @@ smb_updatepage(struct file *file, struct page *page, unsigned long offset,
 {
        struct dentry *dentry = file->f_dentry;
 
-       DEBUG1("(%s/%s %d@%ld)\n", DENTRY_PATH(dentry), 
-              count, (page->index << PAGE_CACHE_SHIFT)+offset);
+       DEBUG1("(%s/%s %d@%lld)\n", DENTRY_PATH(dentry), count,
+               ((unsigned long long)page->index << PAGE_CACHE_SHIFT) + offset);
 
        return smb_writepage_sync(dentry->d_inode, page, offset, count);
 }
@@ -362,7 +361,7 @@ smb_file_open(struct inode *inode, struct file * file)
        SMB_I(inode)->openers++;
 out:
        unlock_kernel();
-       return 0;
+       return result;
 }
 
 static int
@@ -373,8 +372,7 @@ smb_file_release(struct inode *inode, struct file * file)
                /* We must flush any dirty pages now as we won't be able to
                   write anything after close. mmap can trigger this.
                   "openers" should perhaps include mmap'ers ... */
-               filemap_fdatawrite(inode->i_mapping);
-               filemap_fdatawait(inode->i_mapping);
+               filemap_write_and_wait(inode->i_mapping);
                smb_close(inode);
        }
        unlock_kernel();
@@ -401,7 +399,7 @@ smb_file_permission(struct inode *inode, int mask, struct nameidata *nd)
        return error;
 }
 
-struct file_operations smb_file_operations =
+const struct file_operations smb_file_operations =
 {
        .llseek         = remote_llseek,
        .read           = smb_file_read,