- small fixes in md_*() methods (added missed ENTRY).
int repoff);
int (*m_set_lock_data)(struct obd_export *exp, __u64 *l, void *data);
+ int (*m_delete_object)(struct obd_export *, struct ll_fid *);
/*
* NOTE: If adding ops, add another LPROCFS_OBD_OP_INIT() line
* to lprocfs_alloc_obd_stats() in obdclass/lprocfs_status.c.
RETURN(rc);
}
+/* this function notifies MDC, that inode described by @fid gets removed from
+ * memory.*/
+static inline int md_delete_object(struct obd_export *exp,
+ struct ll_fid *fid)
+{
+ int rc;
+ ENTRY;
+
+ /* as this method only notifies MDC that inode gets deleted, we can
+ * return zero if method is not implemented, this means, that OBD does
+ * not need such a notification. */
+ if (MDP(exp->exp_obd, delete_object) == NULL)
+ RETURN(0);
+
+ MD_COUNTER_INCREMENT(exp->exp_obd, delete_object);
+ rc = MDP(exp->exp_obd, delete_object)(exp, fid);
+ RETURN(rc);
+}
+
static inline int md_getattr(struct obd_export *exp, struct ll_fid *fid,
unsigned long valid, unsigned int ea_size,
struct ptlrpc_request **request)
{
int rc;
+ ENTRY;
EXP_CHECK_MD_OP(exp, getattr);
MD_COUNTER_INCREMENT(exp->exp_obd, getattr);
rc = MDP(exp->exp_obd, getattr)(exp, fid, valid, ea_size, request);
RETURN(rc);
}
-static inline struct obd_device * md_get_real_obd(struct obd_export *exp,
- char *name, int len)
+static inline struct obd_device *md_get_real_obd(struct obd_export *exp,
+ char *name, int len)
{
ENTRY;
if (MDP(exp->exp_obd, get_real_obd) == NULL)
int it_disposition(struct lookup_intent *it, int flag);
void it_set_disposition(struct lookup_intent *it, int flag);
void ll_read_inode2(struct inode *inode, void *opaque);
+void ll_delete_inode(struct inode *inode);
int ll_iocontrol(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg);
void ll_umount_begin(struct super_block *sb);
}
}
+void ll_delete_inode(struct inode *inode)
+{
+ int rc;
+ struct ll_fid fid;
+ struct ll_sb_info *sbi = ll_i2sbi(inode);
+ ENTRY;
+
+ ll_inode2fid(&fid, inode);
+
+ rc = md_delete_object(sbi->ll_mdc_exp, &fid);
+ if (rc) {
+ CERROR("md_delete_object() failed, error %d.\n",
+ rc);
+ }
+
+ EXIT;
+}
+
int ll_iocontrol(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
{
{
.read_inode2 = ll_read_inode2,
.clear_inode = ll_clear_inode,
-// .delete_inode = ll_delete_inode,
+ .delete_inode = ll_delete_inode,
.put_super = lustre_put_super,
.statfs = ll_statfs,
.umount_begin = ll_umount_begin,
struct ll_fid *fid,
struct mea *mea);
-int lmv_destroy_obj(struct obd_export *exp, struct ll_fid *fid);
+int lmv_delete_obj(struct obd_export *exp, struct ll_fid *fid);
int lmv_intent_lock(struct obd_export *, struct ll_uctxt *,
struct ll_fid *, const char *, int, void *, int,
RETURN(rc);
}
+int lmv_delete_object(struct obd_export *exp, struct ll_fid *fid)
+{
+ ENTRY;
+
+ if (!lmv_delete_obj(exp, fid)) {
+ CWARN("Object %lu/%lu/%lu is not found.\n",
+ (unsigned long)fid->mds, (unsigned long)fid->id,
+ (unsigned long)fid->generation);
+ }
+
+ RETURN(0);
+}
+
int lmv_unlink(struct obd_export *exp, struct mdc_op_data *data,
struct ptlrpc_request **request)
{
.m_unlink = lmv_unlink,
.m_get_real_obd = lmv_get_real_obd,
.m_valid_attrs = lmv_valid_attrs,
+ .m_delete_object = lmv_delete_object,
};
int __init lmv_init(void)
* this case it will be marked as "freeing" and will not be accessible anymore
* for subsequent callers of lmv_grab_obj(). */
int
-lmv_destroy_obj(struct obd_export *exp, struct ll_fid *fid)
+lmv_delete_obj(struct obd_export *exp, struct ll_fid *fid)
{
struct obd_device *obd = exp->exp_obd;
struct lmv_obj *obj;