|
@@ -1183,16 +1183,11 @@ ssize_t cifs_user_read(struct file *file, char __user *read_data,
|
|
char *smb_read_data;
|
|
char *smb_read_data;
|
|
char __user *current_offset;
|
|
char __user *current_offset;
|
|
struct smb_com_read_rsp *pSMBr;
|
|
struct smb_com_read_rsp *pSMBr;
|
|
- int use_old_read = FALSE;
|
|
|
|
|
|
|
|
xid = GetXid();
|
|
xid = GetXid();
|
|
cifs_sb = CIFS_SB(file->f_dentry->d_sb);
|
|
cifs_sb = CIFS_SB(file->f_dentry->d_sb);
|
|
pTcon = cifs_sb->tcon;
|
|
pTcon = cifs_sb->tcon;
|
|
|
|
|
|
- if(pTcon->ses)
|
|
|
|
- if((pTcon->ses->capabilities & CAP_LARGE_FILES) == 0)
|
|
|
|
- use_old_read = TRUE;
|
|
|
|
-
|
|
|
|
if (file->private_data == NULL) {
|
|
if (file->private_data == NULL) {
|
|
FreeXid(xid);
|
|
FreeXid(xid);
|
|
return -EBADF;
|
|
return -EBADF;
|
|
@@ -1217,22 +1212,10 @@ ssize_t cifs_user_read(struct file *file, char __user *read_data,
|
|
if (rc != 0)
|
|
if (rc != 0)
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- if(use_old_read)
|
|
|
|
- rc = SMBLegacyRead(xid, pTcon,
|
|
|
|
- open_file->netfid,
|
|
|
|
- current_read_size, *poffset,
|
|
|
|
- &bytes_read, &smb_read_data);
|
|
|
|
- else {
|
|
|
|
- rc = CIFSSMBRead(xid, pTcon,
|
|
|
|
|
|
+ rc = CIFSSMBRead(xid, pTcon,
|
|
open_file->netfid,
|
|
open_file->netfid,
|
|
current_read_size, *poffset,
|
|
current_read_size, *poffset,
|
|
&bytes_read, &smb_read_data);
|
|
&bytes_read, &smb_read_data);
|
|
- if(rc == -EINVAL) {
|
|
|
|
- use_old_read = TRUE;
|
|
|
|
- rc = -EAGAIN;
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
pSMBr = (struct smb_com_read_rsp *)smb_read_data;
|
|
pSMBr = (struct smb_com_read_rsp *)smb_read_data;
|
|
if (copy_to_user(current_offset,
|
|
if (copy_to_user(current_offset,
|
|
smb_read_data + 4 /* RFC1001 hdr */
|
|
smb_read_data + 4 /* RFC1001 hdr */
|
|
@@ -1276,7 +1259,6 @@ static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size,
|
|
int xid;
|
|
int xid;
|
|
char *current_offset;
|
|
char *current_offset;
|
|
struct cifsFileInfo *open_file;
|
|
struct cifsFileInfo *open_file;
|
|
- int use_old_read = FALSE;
|
|
|
|
|
|
|
|
xid = GetXid();
|
|
xid = GetXid();
|
|
cifs_sb = CIFS_SB(file->f_dentry->d_sb);
|
|
cifs_sb = CIFS_SB(file->f_dentry->d_sb);
|
|
@@ -1287,9 +1269,6 @@ static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size,
|
|
return -EBADF;
|
|
return -EBADF;
|
|
}
|
|
}
|
|
open_file = (struct cifsFileInfo *)file->private_data;
|
|
open_file = (struct cifsFileInfo *)file->private_data;
|
|
- if(pTcon->ses)
|
|
|
|
- if((pTcon->ses->capabilities & CAP_LARGE_FILES) == 0)
|
|
|
|
- use_old_read = TRUE;
|
|
|
|
|
|
|
|
if ((file->f_flags & O_ACCMODE) == O_WRONLY)
|
|
if ((file->f_flags & O_ACCMODE) == O_WRONLY)
|
|
cFYI(1, ("attempting read on write only file instance"));
|
|
cFYI(1, ("attempting read on write only file instance"));
|
|
@@ -1308,24 +1287,10 @@ static ssize_t cifs_read(struct file *file, char *read_data, size_t read_size,
|
|
if (rc != 0)
|
|
if (rc != 0)
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
- if(use_old_read)
|
|
|
|
- rc = SMBLegacyRead(xid, pTcon,
|
|
|
|
- open_file->netfid,
|
|
|
|
- current_read_size, *poffset,
|
|
|
|
- &bytes_read, ¤t_offset);
|
|
|
|
- else {
|
|
|
|
- rc = CIFSSMBRead(xid, pTcon,
|
|
|
|
|
|
+ rc = CIFSSMBRead(xid, pTcon,
|
|
open_file->netfid,
|
|
open_file->netfid,
|
|
current_read_size, *poffset,
|
|
current_read_size, *poffset,
|
|
&bytes_read, ¤t_offset);
|
|
&bytes_read, ¤t_offset);
|
|
- /* check if server disavows support for
|
|
|
|
- 64 bit offsets */
|
|
|
|
- if(rc == -EINVAL) {
|
|
|
|
- rc = -EAGAIN;
|
|
|
|
- use_old_read = TRUE;
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
}
|
|
}
|
|
if (rc || (bytes_read == 0)) {
|
|
if (rc || (bytes_read == 0)) {
|
|
if (total_read) {
|
|
if (total_read) {
|
|
@@ -1423,7 +1388,6 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
|
|
struct smb_com_read_rsp *pSMBr;
|
|
struct smb_com_read_rsp *pSMBr;
|
|
struct pagevec lru_pvec;
|
|
struct pagevec lru_pvec;
|
|
struct cifsFileInfo *open_file;
|
|
struct cifsFileInfo *open_file;
|
|
- int use_old_read = FALSE;
|
|
|
|
|
|
|
|
xid = GetXid();
|
|
xid = GetXid();
|
|
if (file->private_data == NULL) {
|
|
if (file->private_data == NULL) {
|
|
@@ -1433,9 +1397,7 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
|
|
open_file = (struct cifsFileInfo *)file->private_data;
|
|
open_file = (struct cifsFileInfo *)file->private_data;
|
|
cifs_sb = CIFS_SB(file->f_dentry->d_sb);
|
|
cifs_sb = CIFS_SB(file->f_dentry->d_sb);
|
|
pTcon = cifs_sb->tcon;
|
|
pTcon = cifs_sb->tcon;
|
|
- if(pTcon->ses)
|
|
|
|
- if((pTcon->ses->capabilities & CAP_LARGE_FILES) == 0)
|
|
|
|
- use_old_read = TRUE;
|
|
|
|
|
|
+
|
|
pagevec_init(&lru_pvec, 0);
|
|
pagevec_init(&lru_pvec, 0);
|
|
|
|
|
|
for (i = 0; i < num_pages; ) {
|
|
for (i = 0; i < num_pages; ) {
|
|
@@ -1481,22 +1443,10 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
|
|
|
|
- if(use_old_read)
|
|
|
|
- rc = SMBLegacyRead(xid, pTcon,
|
|
|
|
- open_file->netfid,
|
|
|
|
- read_size, offset,
|
|
|
|
- &bytes_read, &smb_read_data);
|
|
|
|
- else {
|
|
|
|
- rc = CIFSSMBRead(xid, pTcon,
|
|
|
|
|
|
+ rc = CIFSSMBRead(xid, pTcon,
|
|
open_file->netfid,
|
|
open_file->netfid,
|
|
read_size, offset,
|
|
read_size, offset,
|
|
&bytes_read, &smb_read_data);
|
|
&bytes_read, &smb_read_data);
|
|
- if(rc == -EINVAL) {
|
|
|
|
- use_old_read = TRUE;
|
|
|
|
- rc = -EAGAIN;
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
|
|
/* BB more RC checks ? */
|
|
/* BB more RC checks ? */
|
|
if (rc== -EAGAIN) {
|
|
if (rc== -EAGAIN) {
|