Commit f86efc2c authored by Steve French's avatar Steve French

Fix cifs xid transaction counts to be more consistent. Start using __set_page_dirty_no_buffers.

Signed-off-by: Steve French (sfrench@us.ibm.com)
parent 07c3a790
Version 1.20
------------
Make transaction counts more consistent. Merge /proc/fs/cifs/SimultaneousOps
info into /proc/fs/cifs/DebugData
Version 1.19
------------
Fix /proc/fs/cifs/Stats and DebugData display to handle larger
......
......@@ -93,5 +93,5 @@ extern int cifs_setxattr(struct dentry *, const char *, const void *,
size_t, int);
extern ssize_t cifs_getxattr(struct dentry *, const char *, void *, size_t);
extern ssize_t cifs_listxattr(struct dentry *, char *, size_t);
#define CIFS_VERSION "1.19"
#define CIFS_VERSION "1.20"
#endif /* _CIFSFS_H */
......@@ -63,10 +63,10 @@ extern u64 cifs_UnixTimeToNT(struct timespec);
extern int cifs_get_inode_info(struct inode **pinode,
const unsigned char *search_path,
FILE_ALL_INFO * pfile_info,
struct super_block *sb);
struct super_block *sb, int xid);
extern int cifs_get_inode_info_unix(struct inode **pinode,
const unsigned char *search_path,
struct super_block *sb);
struct super_block *sb,int xid);
extern int cifs_setup_session(unsigned int xid, struct cifsSesInfo *pSesInfo,
struct nls_table * nls_info);
......
......@@ -233,10 +233,10 @@ cifs_create(struct inode *inode, struct dentry *direntry, int mode,
/* BB server might mask mode so we have to query for Unix case*/
if (pTcon->ses->capabilities & CAP_UNIX)
rc = cifs_get_inode_info_unix(&newinode, full_path,
inode->i_sb);
inode->i_sb,xid);
else {
rc = cifs_get_inode_info(&newinode, full_path,
buf, inode->i_sb);
buf, inode->i_sb,xid);
if(newinode)
newinode->i_mode = mode;
}
......@@ -329,7 +329,7 @@ int cifs_mknod(struct inode *inode, struct dentry *direntry, int mode, dev_t dev
device_number, cifs_sb->local_nls);
if(!rc) {
rc = cifs_get_inode_info_unix(&newinode, full_path,
inode->i_sb);
inode->i_sb,xid);
direntry->d_op = &cifs_dentry_ops;
if(rc == 0)
d_instantiate(direntry, newinode);
......@@ -389,10 +389,10 @@ cifs_lookup(struct inode *parent_dir_inode, struct dentry *direntry, struct name
if (pTcon->ses->capabilities & CAP_UNIX)
rc = cifs_get_inode_info_unix(&newInode, full_path,
parent_dir_inode->i_sb);
parent_dir_inode->i_sb,xid);
else
rc = cifs_get_inode_info(&newInode, full_path, NULL,
parent_dir_inode->i_sb);
parent_dir_inode->i_sb,xid);
if ((rc == 0) && (newInode != NULL)) {
direntry->d_op = &cifs_dentry_ops;
......
......@@ -215,10 +215,10 @@ cifs_open(struct inode *inode, struct file *file)
}
if (pTcon->ses->capabilities & CAP_UNIX)
rc = cifs_get_inode_info_unix(&file->f_dentry->d_inode,
full_path, inode->i_sb);
full_path, inode->i_sb,xid);
else
rc = cifs_get_inode_info(&file->f_dentry->d_inode,
full_path, buf, inode->i_sb);
full_path, buf, inode->i_sb,xid);
if((oplock & 0xF) == OPLOCK_EXCLUSIVE) {
pCifsInode->clientCanCacheAll = TRUE;
......@@ -367,10 +367,10 @@ and we can never tell if the caller already has the rename_sem */
pCifsInode->clientCanCacheRead = FALSE;
if (pTcon->ses->capabilities & CAP_UNIX)
rc = cifs_get_inode_info_unix(&inode,
full_path, inode->i_sb);
full_path, inode->i_sb,xid);
else
rc = cifs_get_inode_info(&inode,
full_path, NULL, inode->i_sb);
full_path, NULL, inode->i_sb,xid);
} /* else we are writing out data to server already
and could deadlock if we tried to flush data, and
since we do not know if we have data that would
......@@ -1545,8 +1545,6 @@ construct_dentry(struct qstr *qstring, struct file *file,
*ptmp_inode = new_inode(file->f_dentry->d_sb);
tmp_dentry->d_op = &cifs_dentry_ops;
cFYI(0, (" instantiate dentry 0x%p with inode 0x%p ",
tmp_dentry, *ptmp_inode));
if(*ptmp_inode == NULL)
return;
d_instantiate(tmp_dentry, *ptmp_inode);
......@@ -2136,6 +2134,7 @@ struct address_space_operations cifs_addr_ops = {
.writepage = cifs_writepage,
.prepare_write = cifs_prepare_write,
.commit_write = cifs_commit_write,
.set_page_dirty = __set_page_dirty_nobuffers,
/* .sync_page = cifs_sync_page, */
/*.direct_IO = */
};
......@@ -35,9 +35,8 @@ extern int is_size_safe_to_change(struct cifsInodeInfo *);
int
cifs_get_inode_info_unix(struct inode **pinode,
const unsigned char *search_path,
struct super_block *sb)
struct super_block *sb,int xid)
{
int xid;
int rc = 0;
FILE_UNIX_BASIC_INFO findData;
struct cifsTconInfo *pTcon;
......@@ -45,8 +44,6 @@ cifs_get_inode_info_unix(struct inode **pinode,
struct cifs_sb_info *cifs_sb = CIFS_SB(sb);
char *tmp_path;
xid = GetXid();
pTcon = cifs_sb->tcon;
cFYI(1, (" Getting info on %s ", search_path));
/* we could have done a find first instead but this returns more info */
......@@ -62,7 +59,6 @@ cifs_get_inode_info_unix(struct inode **pinode,
strnlen(search_path, MAX_PATHCONF) + 1,
GFP_KERNEL);
if (tmp_path == NULL) {
FreeXid(xid);
return -ENOMEM;
}
/* have to skip first of the double backslash of UNC name */
......@@ -75,7 +71,6 @@ cifs_get_inode_info_unix(struct inode **pinode,
/* BB fix up inode etc. */
} else if (rc) {
FreeXid(xid);
return rc;
}
......@@ -86,8 +81,11 @@ cifs_get_inode_info_unix(struct inode **pinode,
if (*pinode == NULL) {
*pinode = new_inode(sb);
}
inode = *pinode;
if(*pinode == NULL) {
return -ENOMEM;
}
inode = *pinode;
cifsInfo = CIFS_I(inode);
cFYI(1, (" Old time %ld ", cifsInfo->time));
......@@ -172,15 +170,13 @@ cifs_get_inode_info_unix(struct inode **pinode,
inode->i_rdev);
}
}
FreeXid(xid);
return rc;
}
int
cifs_get_inode_info(struct inode **pinode, const unsigned char *search_path,
FILE_ALL_INFO * pfindData, struct super_block *sb)
FILE_ALL_INFO * pfindData, struct super_block *sb, int xid)
{
int xid;
int rc = 0;
struct cifsTconInfo *pTcon;
struct inode *inode;
......@@ -188,15 +184,12 @@ cifs_get_inode_info(struct inode **pinode, const unsigned char *search_path,
char *tmp_path;
char *buf = NULL;
xid = GetXid();
pTcon = cifs_sb->tcon;
cFYI(1,("Getting info on %s ", search_path));
if((pfindData == NULL) && (*pinode != NULL)) {
if(CIFS_I(*pinode)->clientCanCacheRead) {
cFYI(1,("No need to revalidate inode sizes on cached file "));
FreeXid(xid);
return rc;
}
}
......@@ -221,7 +214,6 @@ cifs_get_inode_info(struct inode **pinode, const unsigned char *search_path,
if (tmp_path == NULL) {
if(buf)
kfree(buf);
FreeXid(xid);
return -ENOMEM;
}
......@@ -235,7 +227,6 @@ cifs_get_inode_info(struct inode **pinode, const unsigned char *search_path,
} else if (rc) {
if(buf)
kfree(buf);
FreeXid(xid);
return rc;
}
} else {
......@@ -245,7 +236,8 @@ cifs_get_inode_info(struct inode **pinode, const unsigned char *search_path,
if (*pinode == NULL) {
*pinode = new_inode(sb);
}
if(*pinode == NULL)
return -ENOMEM;
inode = *pinode;
cifsInfo = CIFS_I(inode);
pfindData->Attributes = le32_to_cpu(pfindData->Attributes);
......@@ -332,22 +324,23 @@ cifs_get_inode_info(struct inode **pinode, const unsigned char *search_path,
}
if(buf)
kfree(buf);
FreeXid(xid);
return rc;
}
void
cifs_read_inode(struct inode *inode)
{ /* gets root inode */
int xid;
struct cifs_sb_info *cifs_sb;
cifs_sb = CIFS_SB(inode->i_sb);
xid = GetXid();
if (cifs_sb->tcon->ses->capabilities & CAP_UNIX)
cifs_get_inode_info_unix(&inode, "", inode->i_sb);
cifs_get_inode_info_unix(&inode, "", inode->i_sb,xid);
else
cifs_get_inode_info(&inode, "", NULL, inode->i_sb);
cifs_get_inode_info(&inode, "", NULL, inode->i_sb,xid);
/* can not call macro FreeXid here since in a void func */
_FreeXid(xid);
}
int
......@@ -473,10 +466,10 @@ cifs_mkdir(struct inode *inode, struct dentry *direntry, int mode)
inode->i_nlink++;
if (pTcon->ses->capabilities & CAP_UNIX)
rc = cifs_get_inode_info_unix(&newinode, full_path,
inode->i_sb);
inode->i_sb,xid);
else
rc = cifs_get_inode_info(&newinode, full_path,NULL,
inode->i_sb);
inode->i_sb,xid);
direntry->d_op = &cifs_dentry_ops;
d_instantiate(direntry, newinode);
......@@ -698,7 +691,7 @@ cifs_revalidate(struct dentry *direntry)
if (cifs_sb->tcon->ses->capabilities & CAP_UNIX) {
rc = cifs_get_inode_info_unix(&direntry->d_inode, full_path,
direntry->d_sb);
direntry->d_sb,xid);
if(rc) {
cFYI(1,("error on getting revalidate info %d",rc));
/* if(rc != -ENOENT)
......@@ -706,7 +699,7 @@ cifs_revalidate(struct dentry *direntry)
}
} else {
rc = cifs_get_inode_info(&direntry->d_inode, full_path, NULL,
direntry->d_sb);
direntry->d_sb,xid);
if(rc) {
cFYI(1,("error on getting revalidate info %d",rc));
/* if(rc != -ENOENT)
......
......@@ -188,10 +188,10 @@ cifs_symlink(struct inode *inode, struct dentry *direntry, const char *symname)
if (rc == 0) {
if (pTcon->ses->capabilities & CAP_UNIX)
rc = cifs_get_inode_info_unix(&newinode, full_path,
inode->i_sb);
inode->i_sb,xid);
else
rc = cifs_get_inode_info(&newinode, full_path, NULL,
inode->i_sb);
inode->i_sb,xid);
if (rc != 0) {
cFYI(1,
......
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