/* -*- mode: c; c-basic-offset: 8; indent-tabs-mode: nil; -*-
* vim:expandtab:shiftwidth=8:tabstop=8:
- * mdd/mdd_internel.c
*
- * Copyright (C) 2006 Cluster File Systems, Inc.
- * Author: Wang Di <wangdi@clusterfs.com>
+ * GPL HEADER START
*
- * This file is part of the Lustre file system, http://www.lustre.org
- * Lustre is a trademark of Cluster File Systems, Inc.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
- * You may have signed or agreed to another license before downloading
- * this software. If so, you are bound by the terms and conditions
- * of that agreement, and the following does not apply to you. See the
- * LICENSE file included with this distribution for more information.
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 only,
+ * as published by the Free Software Foundation.
*
- * If you did not agree to a different license, then this copy of Lustre
- * is open source software; you can redistribute it and/or modify it
- * under the terms of version 2 of the GNU General Public License as
- * published by the Free Software Foundation.
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License version 2 for more details (a copy is included
+ * in the LICENSE file that accompanied this code).
*
- * In either case, Lustre is distributed in the hope that it will be
- * useful, but WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * license text for more details.
+ * You should have received a copy of the GNU General Public License
+ * version 2 along with this program; If not, see [sun.com URL with a
+ * copy of GPLv2].
+ *
+ * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
+ * CA 95054 USA or visit www.sun.com if you need additional information or
+ * have any questions.
+ *
+ * GPL HEADER END
+ */
+/*
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved
+ * Use is subject to license terms.
+ */
+/*
+ * This file is part of Lustre, http://www.lustre.org/
+ * Lustre is a trademark of Sun Microsystems, Inc.
+ *
+ * lustre/mdd/mdd_internal.h
+ *
+ * Author: Wang Di <wangdi@clusterfs.com>
*/
#ifndef _MDD_INTERNAL_H
#include <asm/semaphore.h>
#include <linux/lustre_acl.h>
+#include <lustre_eacl.h>
#include <obd.h>
#include <md_object.h>
#include <dt_object.h>
cfs_proc_dir_entry_t *mdd_proc_entry;
struct lprocfs_stats *mdd_stats;
struct mdd_txn_op_descr mdd_tod[MDD_TXN_LAST_OP];
+ unsigned long mdd_atime_diff;
};
enum mod_flags {
DEAD_OBJ = 1 << 0,
APPEND_OBJ = 1 << 1,
IMMUTE_OBJ = 1 << 2,
- ORPHAN_OBJ = 1 << 3
+ ORPHAN_OBJ = 1 << 3,
+ MNLINK_OBJ = 1 << 4
};
#define LUSTRE_APPEND_FL LDISKFS_APPEND_FL
struct mdd_object *parent, struct mdd_object *child,
struct lov_mds_md **lmm, int *lmm_size,
const struct md_op_spec *spec, struct lu_attr *la);
-void mdd_lov_objid_update(const struct lu_env *env, struct mdd_device *mdd);
+void mdd_lov_objid_update(struct mdd_device *mdd, struct lov_mds_md *lmm);
void mdd_lov_create_finish(const struct lu_env *env, struct mdd_device *mdd,
struct lov_mds_md *lmm, int lmm_size,
const struct md_op_spec *spec);
void *md, int *md_size, const char *name);
int mdd_la_get(const struct lu_env *env, struct mdd_object *obj,
struct lu_attr *la, struct lustre_capa *capa);
-int mdd_attr_set_internal(const struct lu_env *env, struct mdd_object *o,
- const struct lu_attr *attr, struct thandle *handle,
- const int needacl);
+int mdd_attr_set_internal(const struct lu_env *env,
+ struct mdd_object *obj,
+ struct lu_attr *attr,
+ struct thandle *handle,
+ int needacl);
+int mdd_attr_check_set_internal(const struct lu_env *env,
+ struct mdd_object *obj,
+ struct lu_attr *attr,
+ struct thandle *handle,
+ int needacl);
int mdd_object_kill(const struct lu_env *env, struct mdd_object *obj,
struct md_attr *ma);
int mdd_iattr_get(const struct lu_env *env, struct mdd_object *mdd_obj,
int mdd_object_create_internal(const struct lu_env *env, struct mdd_object *p,
struct mdd_object *c, struct md_attr *ma,
struct thandle *handle);
-int mdd_attr_set_internal_locked(const struct lu_env *env,
- struct mdd_object *o,
- const struct lu_attr *attr,
- struct thandle *handle, const int needacl);
+int mdd_attr_check_set_internal_locked(const struct lu_env *env,
+ struct mdd_object *obj,
+ struct lu_attr *attr,
+ struct thandle *handle,
+ int needacl);
int mdd_lmm_get_locked(const struct lu_env *env, struct mdd_object *mdd_obj,
struct md_attr *ma);
/* mdd_lock.c */
void mdd_pdo_read_unlock(const struct lu_env *env, struct mdd_object *obj,
struct dynlock_handle *dlh);
/* mdd_dir.c */
+void __mdd_ref_add(const struct lu_env *env, struct mdd_object *obj,
+ struct thandle *handle);
+void __mdd_ref_del(const struct lu_env *env, struct mdd_object *obj,
+ struct thandle *handle, int is_dot);
int mdd_may_create(const struct lu_env *env, struct mdd_object *pobj,
struct mdd_object *cobj, int check_perm, int check_nlink);
int mdd_may_unlink(const struct lu_env *env, struct mdd_object *pobj,
void orph_index_fini(const struct lu_env *env, struct mdd_device *mdd);
int mdd_txn_init_credits(const struct lu_env *env, struct mdd_device *mdd);
+/* mdd_lproc.c */
+void lprocfs_mdd_init_vars(struct lprocfs_static_vars *lvars);
int mdd_procfs_init(struct mdd_device *mdd, const char *name);
int mdd_procfs_fini(struct mdd_device *mdd);
void mdd_lprocfs_time_start(const struct lu_env *env);
struct mdd_object *mdd_object_find(const struct lu_env *env,
struct mdd_device *d,
const struct lu_fid *f);
+
/* mdd_permission.c */
#define mdd_cap_t(x) (x)
return 0;
}
-int mdd_in_group_p(struct md_ucred *uc, gid_t grp);
int mdd_acl_def_get(const struct lu_env *env, struct mdd_object *mdd_obj,
struct md_attr *ma);
int mdd_acl_chmod(const struct lu_env *env, struct mdd_object *o, __u32 mode,
return obj->mod_flags & APPEND_OBJ;
}
+static inline int mdd_is_mnlink(struct mdd_object *obj)
+{
+ return obj->mod_flags & MNLINK_OBJ;
+}
+
static inline int mdd_object_exists(struct mdd_object *obj)
{
return lu_object_exists(mdd2lu_obj(obj));
ci->mc_capa[offset] = capa;
}
+#define MAX_ATIME_DIFF 60
+
enum {
LPROC_MDD_NR
};
static inline struct obd_capa *mdo_capa_get(const struct lu_env *env,
struct mdd_object *obj,
struct lustre_capa *old,
- __u32 uid, __u64 opc)
+ __u64 opc)
{
struct dt_object *next = mdd_object_child(obj);
LASSERT(mdd_object_exists(obj));
- return next->do_ops->do_capa_get(env, next, old, uid, opc);
+ return next->do_ops->do_capa_get(env, next, old, opc);
}
#endif