For the linux kernel its recommended to keep CONFIG_* wrapped code
in a header file instead of the source files to avoid making the
code more difficulty to read. Move CONFIG_SECURITY wrapped code
to llite_internal.h in this case.
Change-Id: I60eba17181d3b57fb64e99a441163f975dbab03c
Test-Parameters: trivial
Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-on: https://review.whamcloud.com/33410
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: John L. Hammond <jhammond@whamcloud.com>
size_t size,
__u64 valid);
size_t size,
__u64 valid);
+static inline bool obd_connect_has_secctx(struct obd_connect_data *data)
+{
+#if defined(HAVE_SECURITY_DENTRY_INIT_SECURITY) && defined(CONFIG_SECURITY)
+ return data->ocd_connect_flags & OBD_CONNECT_FLAGS2 &&
+ data->ocd_connect_flags2 & OBD_CONNECT2_FILE_SECCTX;
+#else
+ return false;
+#endif /* HAVE_SECURITY_DENTRY_INIT_SECURITY */
+}
+
+static inline void obd_connect_set_secctx(struct obd_connect_data *data)
+{
+#if defined(HAVE_SECURITY_DENTRY_INIT_SECURITY) && defined(CONFIG_SECURITY)
+ data->ocd_connect_flags2 |= OBD_CONNECT2_FILE_SECCTX;
+#endif /* HAVE_SECURITY_DENTRY_INIT_SECURITY */
+}
+
int ll_dentry_init_security(struct dentry *dentry, int mode, struct qstr *name,
const char **secctx_name, void **secctx,
__u32 *secctx_size);
int ll_dentry_init_security(struct dentry *dentry, int mode, struct qstr *name,
const char **secctx_name, void **secctx,
__u32 *secctx_size);
-static inline int obd_connect_has_secctx(struct obd_connect_data *data)
-{
- return data->ocd_connect_flags & OBD_CONNECT_FLAGS2 &&
- data->ocd_connect_flags2 & OBD_CONNECT2_FILE_SECCTX;
-}
-
static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
struct vfsmount *mnt)
{
static int client_common_fill_super(struct super_block *sb, char *md, char *dt,
struct vfsmount *mnt)
{
if (sbi->ll_flags & LL_SBI_ALWAYS_PING)
data->ocd_connect_flags &= ~OBD_CONNECT_PINGLESS;
if (sbi->ll_flags & LL_SBI_ALWAYS_PING)
data->ocd_connect_flags &= ~OBD_CONNECT_PINGLESS;
-#if defined(HAVE_SECURITY_DENTRY_INIT_SECURITY) && defined(CONFIG_SECURITY)
- data->ocd_connect_flags2 |= OBD_CONNECT2_FILE_SECCTX;
-#endif /* HAVE_SECURITY_DENTRY_INIT_SECURITY */
+ obd_connect_set_secctx(data);
data->ocd_brw_size = MD_MAX_BRW_SIZE;
data->ocd_brw_size = MD_MAX_BRW_SIZE;