int niocount, struct niobuf_remote *nb);
int (* fs_commit)(struct inode *inode, void *handle,int force_sync);
int (* fs_setattr)(struct dentry *dentry, void *handle,
- struct iattr *iattr);
+ struct iattr *iattr, int do_trunc);
int (* fs_set_md)(struct inode *inode, void *handle, void *md,
int size);
int (* fs_get_md)(struct inode *inode, void *md, int size);
static inline void *fsfilt_start(struct obd_device *obd,
struct inode *inode, int op)
{
+ long now = jiffies;
void *handle = obd->obd_fsops->fs_start(inode, op);
- CDEBUG(D_HA, "starting handle %p\n", handle);
+ CDEBUG(D_HA, "started handle %p\n", handle);
+ if (time_after(jiffies, now + 15*HZ))
+ CERROR("long journal start time %lus\n", (jiffies - now) / HZ);
return handle;
}
struct fsfilt_objinfo *fso, int niocount,
struct niobuf_remote *nb)
{
+ long now = jiffies;
void *handle = obd->obd_fsops->fs_brw_start(objcount, fso, niocount,nb);
- CDEBUG(D_HA, "starting handle %p\n", handle);
+ CDEBUG(D_HA, "started handle %p\n", handle);
+ if (time_after(jiffies, now + 15*HZ))
+ CERROR("long journal start time %lus\n", (jiffies - now) / HZ);
return handle;
}
static inline int fsfilt_commit(struct obd_device *obd, struct inode *inode,
void *handle, int force_sync)
{
+ long now = jiffies;
+ int rc = obd->obd_fsops->fs_commit(inode, handle, force_sync);
CDEBUG(D_HA, "committing handle %p\n", handle);
- return obd->obd_fsops->fs_commit(inode, handle, force_sync);
+ if (time_after(jiffies, now + 15*HZ))
+ CERROR("long journal start time %lus\n", (jiffies - now) / HZ);
+ return rc;
}
static inline int fsfilt_setattr(struct obd_device *obd, struct dentry *dentry,
- void *handle, struct iattr *iattr)
+ void *handle, struct iattr *iattr,int do_trunc)
{
+ long now = jiffies;
int rc;
- /*
- * NOTE: we probably don't need to take i_sem here when changing
- * ATTR_SIZE because the MDS never needs to truncate a file.
- * The ext2/ext3 code never truncates a directory, and files
- * stored on the MDS are entirely sparse (no data blocks).
- * If we do need to get it, we can do it here.
- */
- lock_kernel();
- rc = obd->obd_fsops->fs_setattr(dentry, handle, iattr);
- unlock_kernel();
+ rc = obd->obd_fsops->fs_setattr(dentry, handle, iattr, do_trunc);
+ if (time_after(jiffies, now + 15*HZ))
+ CERROR("long setattr time %lus\n", (jiffies - now) / HZ);
return rc;
}
}
static int fsfilt_ext3_setattr(struct dentry *dentry, void *handle,
- struct iattr *iattr)
+ struct iattr *iattr, int do_trunc)
{
struct inode *inode = dentry->d_inode;
int rc;
* zero all the time (which doesn't invoke block truncate at unlink
* time), so we assert we never change the MDS file size from zero.
*/
- if (iattr->ia_valid & ATTR_SIZE) {
- CERROR("hmm, setting %*s file size to %lld\n",
- dentry->d_name.len, dentry->d_name.name, iattr->ia_size);
- LASSERT(iattr->ia_size == 0);
-#if 0
+ if (iattr->ia_valid & ATTR_SIZE && !do_trunc) {
/* ATTR_SIZE would invoke truncate: clear it */
iattr->ia_valid &= ~ATTR_SIZE;
inode->i_size = iattr->ia_size;
iattr->ia_valid |= ATTR_MODE;
iattr->ia_mode = inode->i_mode;
}
-#endif
}
if (inode->i_op->setattr)
rc = inode->i_op->setattr(dentry, iattr);
}
static int fsfilt_reiserfs_setattr(struct dentry *dentry, void *handle,
- struct iattr *iattr)
+ struct iattr *iattr, int do_trunc)
{
struct inode *inode = dentry->d_inode;
int rc;
* zero all the time (which doesn't invoke block truncate at unlink
* time), so we assert we never change the MDS file size from zero.
*/
- if (iattr->ia_valid & ATTR_SIZE) {
- CERROR("hmm, setting %*s file size to %llu\n",
- dentry->d_name.len, dentry->d_name.name, iattr->ia_size);
- LASSERT(iattr->ia_size == 0);
-#if 0
+ if (iattr->ia_valid & ATTR_SIZE && !do_trunc) {
/* ATTR_SIZE would invoke truncate: clear it */
iattr->ia_valid &= ~ATTR_SIZE;
inode->i_size = iattr->ia_size;
iattr->ia_valid |= ATTR_MODE;
iattr->ia_mode = inode->i_mode;
}
-#endif
}
if (inode->i_op->setattr)
rc = inode->i_op->setattr(dentry, iattr);