# It will be applied automatically by the extN build process, or you
# can apply it to the source kernel tree and fix ext3 also. For chaos22
# (or other RH < 12.5 kernels) use the "chaos22" patch instead.
-#EXTN_FIXES = ../patches/patch-2.4.18-chaos22
-EXTN_FIXES = ext3-2.4.18-fixes.diff
+EXTN_FIXES = ../patches/patch-2.4.18-chaos22
+#EXTN_FIXES = ext3-2.4.18-fixes.diff
EXTNP = htree-ext3-2.4.18.diff linux-2.4.18ea-0.8.26.diff
EXTNP+= ext3-2.4.18-ino_sb_macro.diff extN-misc-fixup.diff
EXTNC = balloc.c bitmap.c dir.c file.c fsync.c ialloc.c inode.c ioctl.c
__u32 fd_flags;
};
+struct ll_dentry_data {
+ struct semaphore lld_it_sem;
+};
+
+#define ll_d2d(dentry) ((struct ll_dentry_data*) dentry->d_fsdata)
struct ll_read_inode2_cookie {
struct mds_body *lic_body;
/* dcache.c */
void ll_intent_release(struct dentry *de);
+int ll_set_dd(struct dentry *de);
/* dir.c */
extern struct file_operations ll_dir_operations;
extern struct address_space_operations ll_aops;
+void ll_release(struct dentry *de)
+{
+ ENTRY;
+
+ OBD_FREE(de->d_fsdata, sizeof(struct ll_dentry_data));
+ EXIT;
+}
+
void ll_intent_release(struct dentry *de)
{
struct lustre_handle *handle;
EXIT;
return;
}
+
+ LASSERT(ll_d2d(de) != NULL);
+
if (de->d_it->it_lock_mode) {
handle = (struct lustre_handle *)de->d_it->it_lock_handle;
if (de->d_it->it_op == IT_SETATTR) {
} else
ldlm_lock_decref(handle, de->d_it->it_lock_mode);
}
- de->d_it = NULL;
+ // de->d_it = NULL;
+ up(&ll_d2d(de)->lld_it_sem);
EXIT;
}
if (atomic_read(&de->d_count) > 0)
RETURN(1);
+ if (ll_d2d(de) == NULL) {
+ CERROR("allocating fsdata\n");
+ ll_set_dd(de);
+ }
+ down(&ll_d2d(de)->lld_it_sem);
+ // de->d_it = it;
+
+ RETURN(0);
+}
+
+int ll_set_dd(struct dentry *de)
+{
+ ENTRY;
+ LASSERT(de != NULL);
+
+ lock_kernel();
+
+ if (de->d_fsdata != NULL) {
+ CERROR("dentry %p already has d_fsdata set\n", de);
+ } else {
+ OBD_ALLOC(de->d_fsdata, sizeof(struct ll_dentry_data));
+ sema_init(&ll_d2d(de)->lld_it_sem, 1);
+ }
+
+ unlock_kernel();
+
RETURN(0);
}
struct dentry_operations ll_d_ops = {
- d_revalidate2: ll_revalidate2,
- d_intent_release: ll_intent_release
+ .d_revalidate2 = ll_revalidate2,
+ .d_intent_release = ll_intent_release,
+ .d_release = ll_release,
};