static int ll_intent_to_lock_mode(struct lookup_intent *it)
{
/* CREAT needs to be tested before open (both could be set) */
- if (it->it_op & (IT_CREAT | IT_SETATTR))
+ if (it->it_op & IT_CREAT)
return LCK_PW;
else if (it->it_op & (IT_READDIR | IT_GETATTR | IT_OPEN | IT_LOOKUP))
return LCK_PR;
obd_id ino = 0;
ENTRY;
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
+ if (it && it->it_op == 0)
+ *it = lookup_it;
+#endif
if (it == NULL)
it = &lookup_it;
if (it->it_disposition & IT_OPEN_CREATE)
ptlrpc_request_addref(request);
+ if (it->it_disposition & IT_OPEN_OPEN)
+ ptlrpc_request_addref(request);
if (it->it_disposition & IT_OPEN_NEG)
flag = LL_LOOKUP_NEGATIVE;
flag = LL_LOOKUP_NEGATIVE;
else
flag = LL_LOOKUP_POSITIVE;
- } else if (it->it_op & (IT_GETATTR | IT_SETATTR | IT_LOOKUP)) {
+ } else if (it->it_op & (IT_GETATTR | IT_LOOKUP)) {
/* For check ops, we want the lookup to succeed */
it->it_data = NULL;
if (it->it_status)
list_del_init(&dentry->d_lru);
list_del_init(&dentry->d_hash);
+ __d_rehash(dentry, 0); /* avoid taking dcache_lock inside */
spin_unlock(&dcache_lock);
- d_rehash(dentry);
atomic_inc(&dentry->d_count);
iput(inode);
dentry->d_flags &= ~DCACHE_LUSTRE_INVALID;
int rc;
ENTRY;
- if (it && it->it_op == IT_TRUNC)
- it->it_op = IT_SETATTR;
-
+ CDEBUG(D_VFSTRACE, "VFS Op\n");
rc = ll_intent_lock(parent, &dentry, it, lookup2_finish);
if (rc < 0) {
CDEBUG(D_INFO, "ll_intent_lock: %d\n", rc);
struct inode *inode;
struct ptlrpc_request *request = NULL;
struct mds_body *body;
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
+ time_t time = CURRENT_TIME.tv_sec;
+#else
time_t time = CURRENT_TIME;
+#endif
struct ll_sb_info *sbi = ll_i2sbi(dir);
struct ll_read_inode2_cookie lic = { .lic_lmm = NULL, };
ENTRY;
err = mdc_enqueue(&sbi->ll_mdc_conn, LDLM_PLAIN, &it, LCK_EX, dir,
NULL, &lockh, NULL, 0, &data, sizeof(data));
- mdc_put_rpc_lock(&mdc_rpc_lock, &it);
request = (struct ptlrpc_request *)it.it_data;
if (err < 0)
GOTO(out, err);
int rc = 0;
ENTRY;
+ CDEBUG(D_VFSTRACE, "VFS Op\n");
it = dentry->d_it;
rc = ll_it_open_error(IT_OPEN_CREATE, it);
int rdev)
{
struct ptlrpc_request *request = NULL;
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
+ time_t time = CURRENT_TIME.tv_sec;
+#else
time_t time = CURRENT_TIME;
+#endif
struct ll_sb_info *sbi = ll_i2sbi(dir);
int err = -EMLINK;
ENTRY;
+ CDEBUG(D_VFSTRACE, "VFS Op\n");
if (dir->i_nlink >= EXT2_LINK_MAX)
RETURN(err);
struct inode *inode;
int rc = 0;
+ CDEBUG(D_VFSTRACE, "VFS Op\n");
LL_GET_INTENT(dentry, it);
if ((mode & S_IFMT) == 0)
const char *tgt)
{
struct ptlrpc_request *request = NULL;
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
+ time_t time = CURRENT_TIME.tv_sec;
+#else
time_t time = CURRENT_TIME;
+#endif
struct ll_sb_info *sbi = ll_i2sbi(dir);
int err = -EMLINK;
ENTRY;
+ CDEBUG(D_VFSTRACE, "VFS Op\n");
if (dir->i_nlink >= EXT2_LINK_MAX)
RETURN(err);
int err = 0;
ENTRY;
+ CDEBUG(D_VFSTRACE, "VFS Op\n");
LL_GET_INTENT(dentry, it);
inode = ll_create_node(dir, dentry->d_name.name, dentry->d_name.len,
ENTRY;
+ CDEBUG(D_VFSTRACE, "VFS Op\n");
err = mdc_link(&sbi->ll_mdc_conn, src, dir, name, len, &request);
ptlrpc_req_finished(request);
struct inode *inode = old_dentry->d_inode;
int rc;
+ CDEBUG(D_VFSTRACE, "VFS Op\n");
LL_GET_INTENT(dentry, it);
if (it && it->it_disposition) {
if (it->it_status)
RETURN(it->it_status);
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
+ inode->i_ctime.tv_sec = CURRENT_TIME.tv_sec;
+#else
inode->i_ctime = CURRENT_TIME;
+#endif
ext2_inc_count(inode);
atomic_inc(&inode->i_count);
d_instantiate(dentry, inode);
if (rc)
RETURN(rc);
- inode->i_ctime = CURRENT_TIME;
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
+ inode->i_ctime.tv_sec = CURRENT_TIME.tv_sec;
+#else
+ inode->i_ctime = CURRENT_TIME;
+#endif
ext2_inc_count(inode);
atomic_inc(&inode->i_count);
static int ll_mkdir2(struct inode *dir, const char *name, int len, int mode)
{
struct ptlrpc_request *request = NULL;
+#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0))
+ time_t time = CURRENT_TIME.tv_sec;
+#else
time_t time = CURRENT_TIME;
+#endif
struct ll_sb_info *sbi = ll_i2sbi(dir);
int err = -EMLINK;
ENTRY;
+ CDEBUG(D_VFSTRACE, "VFS Op\n");
if (dir->i_nlink >= EXT2_LINK_MAX)
RETURN(err);
int err = -EMLINK;
ENTRY;
+ CDEBUG(D_VFSTRACE, "VFS Op\n");
LL_GET_INTENT(dentry, it);
if (dir->i_nlink >= EXT2_LINK_MAX)
int rc;
ENTRY;
+ CDEBUG(D_VFSTRACE, "VFS Op\n");
rc = ll_mdc_unlink(dir, NULL, S_IFDIR, name, len);
RETURN(rc);
}
int rc;
ENTRY;
+ CDEBUG(D_VFSTRACE, "VFS Op\n");
rc = ll_mdc_unlink(dir, NULL, S_IFREG, name, len);
RETURN(rc);
}
struct lookup_intent * it;
ENTRY;
+ CDEBUG(D_VFSTRACE, "VFS Op\n");
LL_GET_INTENT(dentry, it);
RETURN(ll_common_unlink(dir, dentry, it, S_IFREG));
struct lookup_intent *it;
int rc;
ENTRY;
-
+
+ CDEBUG(D_VFSTRACE, "VFS Op\n");
LL_GET_INTENT(dentry, it);
if ((!it || !it->it_disposition) && !ext2_empty_dir(inode))
struct ll_sb_info *sbi = ll_i2sbi(src);
int err;
ENTRY;
-
+
+ CDEBUG(D_VFSTRACE, "VFS Op\n");
err = mdc_rename(&sbi->ll_mdc_conn, src, tgt,
oldname, oldlen, newname, newlen, &request);
ptlrpc_req_finished(request);
struct page * old_page;
int err;
+ CDEBUG(D_VFSTRACE, "VFS Op\n");
LL_GET_INTENT(new_dentry, it);
if (it && it->it_disposition) {
rename: ll_rename,
rename2: ll_rename2,
setattr: ll_setattr,
+ setattr_raw: ll_setattr_raw,
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,0))
revalidate: ll_inode_revalidate,
+#endif
};