Commit dc3d70e8 authored by Steve French's avatar Steve French Committed by Steve French

fix ppc64 build problem due to missing header

parent 6bc73d8e
......@@ -27,6 +27,7 @@
#include <linux/ipv6.h>
#include <linux/pagemap.h>
#include <linux/ctype.h>
#include <linux/utsname.h>
#include <asm/uaccess.h>
#include <asm/processor.h>
#include "cifspdu.h"
......
......@@ -561,6 +561,10 @@ cifs_write(struct file * file, const char *write_data,
}
open_file = (struct cifsFileInfo *) file->private_data;
if(file->f_dentry->d_inode == NULL) {
FreeXid(xid);
return -EBADF;
}
if (*poffset > file->f_dentry->d_inode->i_size)
long_op = 2; /* writes past end of file can take a long time */
......@@ -571,7 +575,16 @@ cifs_write(struct file * file, const char *write_data,
total_written += bytes_written) {
rc = -EAGAIN;
while(rc == -EAGAIN) {
if(file->private_data == NULL) {
/* file has been closed on us */
FreeXid(xid);
return total_written;
}
if ((open_file->invalidHandle) && (!open_file->closePend)) {
if((file->f_dentry == NULL) || (file->f_dentry->d_inode == NULL)) {
FreeXid(xid);
return total_written;
}
rc = cifs_reopen_file(file->f_dentry->d_inode,file);
if(rc != 0)
break;
......@@ -594,13 +607,19 @@ cifs_write(struct file * file, const char *write_data,
*poffset += bytes_written;
long_op = FALSE; /* subsequent writes fast - 15 seconds is plenty */
}
file->f_dentry->d_inode->i_ctime = file->f_dentry->d_inode->i_mtime =
CURRENT_TIME;
if (bytes_written > 0) {
if (*poffset > file->f_dentry->d_inode->i_size)
i_size_write(file->f_dentry->d_inode, *poffset);
/* since the write may have blocked check these pointers again */
if(file->f_dentry) {
if(file->f_dentry->d_inode) {
file->f_dentry->d_inode->i_ctime = file->f_dentry->d_inode->i_mtime =
CURRENT_TIME;
if (bytes_written > 0) {
if (*poffset > file->f_dentry->d_inode->i_size)
i_size_write(file->f_dentry->d_inode, *poffset);
}
mark_inode_dirty_sync(file->f_dentry->d_inode);
}
}
mark_inode_dirty_sync(file->f_dentry->d_inode);
FreeXid(xid);
return total_written;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment