/*
* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
+ *
+ * Copyright (c) 2011, 2012, Whamcloud, Inc.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
};
/**
+ * For lu_object_conf flags
+ */
+typedef enum {
+ /* Currently, only used for client-side object initialization. */
+ LOC_F_NEW = 0x1,
+} loc_flags_t;
+
+/**
* Object configuration, describing particulars of object being created. On
* server this is not used, as server objects are full identified by fid. On
* client configuration contains struct lustre_md.
*/
struct lu_object_conf {
+ /**
+ * Some hints for obj find and alloc.
+ */
+ loc_flags_t loc_flags;
};
/**
* A list of references to this object, for debugging.
*/
struct lu_ref ld_reference;
+ /**
+ * Link the device to the site.
+ **/
+ cfs_list_t ld_linkage;
};
struct lu_device_type_operations;
LA_NLINK = 1 << 10,
LA_RDEV = 1 << 11,
LA_BLKSIZE = 1 << 12,
+ LA_KILL_SUID = 1 << 13,
+ LA_KILL_SGID = 1 << 14,
};
/**
struct fld;
struct lu_site_bkt_data {
- /**
+ /**
+ * number of busy object on this bucket
+ */
+ long lsb_busy;
+ /**
* LRU list, updated on each access to object. Protected by
* bucket lock of lu_site::ls_obj_hash.
*
*/
cfs_list_t ls_linkage;
/**
+ * List for lu device for this site, protected
+ * by ls_ld_lock.
+ **/
+ cfs_list_t ls_ld_linkage;
+ cfs_spinlock_t ls_ld_lock;
+
+ /**
* lu_site stats
*/
struct lprocfs_stats *ls_stats;
struct lu_object *lu_object_locate(struct lu_object_header *h,
const struct lu_device_type *dtype);
-struct lu_cdebug_print_info {
- int lpi_subsys;
- int lpi_mask;
- const char *lpi_file;
- const char *lpi_fn;
- int lpi_line;
-};
-
/**
* Printer function emitting messages through libcfs_debug_msg().
*/
int lu_cdebug_printer(const struct lu_env *env,
void *cookie, const char *format, ...);
-#define DECLARE_LU_CDEBUG_PRINT_INFO(var, mask) \
- struct lu_cdebug_print_info var = { \
- .lpi_subsys = DEBUG_SUBSYSTEM, \
- .lpi_mask = (mask), \
- .lpi_file = __FILE__, \
- .lpi_fn = __FUNCTION__, \
- .lpi_line = __LINE__ \
- }
-
/**
* Print object description followed by a user-supplied message.
*/
-#define LU_OBJECT_DEBUG(mask, env, object, format, ...) \
-do { \
- static DECLARE_LU_CDEBUG_PRINT_INFO(__info, mask); \
- \
- if (cfs_cdebug_show(mask, DEBUG_SUBSYSTEM)) { \
- lu_object_print(env, &__info, lu_cdebug_printer, object); \
- CDEBUG(mask, format , ## __VA_ARGS__); \
- } \
+#define LU_OBJECT_DEBUG(mask, env, object, format, ...) \
+do { \
+ LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, mask, NULL); \
+ \
+ if (cfs_cdebug_show(mask, DEBUG_SUBSYSTEM)) { \
+ lu_object_print(env, &msgdata, lu_cdebug_printer, object);\
+ CDEBUG(mask, format , ## __VA_ARGS__); \
+ } \
} while (0)
/**
*/
#define LU_OBJECT_HEADER(mask, env, object, format, ...) \
do { \
- static DECLARE_LU_CDEBUG_PRINT_INFO(__info, mask); \
+ LIBCFS_DEBUG_MSG_DATA_DECL(msgdata, mask, NULL); \
\
if (cfs_cdebug_show(mask, DEBUG_SUBSYSTEM)) { \
- lu_object_header_print(env, &__info, lu_cdebug_printer, \
+ lu_object_header_print(env, &msgdata, lu_cdebug_printer,\
(object)->lo_header); \
- lu_cdebug_printer(env, &__info, "\n"); \
+ lu_cdebug_printer(env, &msgdata, "\n"); \
CDEBUG(mask, format , ## __VA_ARGS__); \
} \
} while (0)
/**
* \retval 1 iff object \a o exists on stable storage,
+ * \retval 0 iff object \a o not exists on stable storage.
* \retval -1 iff object \a o is on remote server.
*/
static inline int lu_object_exists(const struct lu_object *o)
void lu_context_key_revive_many (struct lu_context_key *k, ...);
void lu_context_key_quiesce_many (struct lu_context_key *k, ...);
+/*
+ * update/clear ctx/ses tags.
+ */
+void lu_context_tags_update(__u32 tags);
+void lu_context_tags_clear(__u32 tags);
+void lu_session_tags_update(__u32 tags);
+void lu_session_tags_clear(__u32 tags);
+
/**
* Environment.
*/
int lu_env_init (struct lu_env *env, __u32 tags);
void lu_env_fini (struct lu_env *env);
int lu_env_refill(struct lu_env *env);
+int lu_env_refill_by_tags(struct lu_env *env, __u32 ctags, __u32 stags);
/** @} lu_context */
struct lu_buf {
void *lb_buf;
ssize_t lb_len;
- int lb_vmalloc:1;
};
/** null buffer */