struct lustre_profile *class_get_profile(char * prof);
void class_del_profile(char *prof);
+#define class_export_rpc_get(exp) \
+({ \
+ atomic_inc(&(exp)->exp_rpc_count); \
+ CDEBUG(D_INFO, "RPC GETting export %p : new rpc_count %d\n", \
+ (exp), atomic_read(&(exp)->exp_rpc_count)); \
+ class_export_get(exp); \
+})
+
+#define class_export_rpc_put(exp) \
+({ \
+ atomic_dec(&(exp)->exp_rpc_count); \
+ CDEBUG(D_INFO, "RPC PUTting export %p : new rpc_count %d\n", \
+ (exp), atomic_read(&(exp)->exp_rpc_count)); \
+ class_export_put(exp); \
+})
+
#define class_export_get(exp) \
({ \
struct obd_export *exp_ = exp; \
RETURN(rc);
}
-static inline int obd_write_extents(struct obd_export *exp, struct obd_ioobj *obj,
- int niocount, struct niobuf_local *local, int rc)
+static inline int obd_do_cow(struct obd_export *exp, struct obd_ioobj *obj,
+ int objcount,struct niobuf_remote *rnb)
+{
+ int rc;
+ ENTRY;
+
+ /* there are cases when write_extents is not implemented. */
+ if (!OBP(exp->exp_obd, do_cow))
+ RETURN(0);
+
+ OBD_COUNTER_INCREMENT(exp->exp_obd, do_cow);
+
+ rc = OBP(exp->exp_obd, do_cow)(exp, obj, objcount, rnb);
+
+ RETURN(rc);
+}
+
+static inline int obd_write_extents(struct obd_export *exp,
+ struct obd_ioobj *obj,
+ int objcount, int niocount,
+ struct niobuf_local *local,
+ int rc)
{
ENTRY;
OBD_COUNTER_INCREMENT(exp->exp_obd, write_extents);
- rc = OBP(exp->exp_obd, write_extents)(exp, obj, niocount, local, rc);
+ rc = OBP(exp->exp_obd, write_extents)(exp, obj, objcount, niocount,
+ local, rc);
RETURN(rc);
}
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)