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