* Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
* Use is subject to license terms.
*
- * Copyright (c) 2011, 2014, Intel Corporation.
+ * Copyright (c) 2011, 2015, Intel Corporation.
*/
/*
* This file is part of Lustre, http://www.lustre.org/
/* OI scrub should skip this inode. */
#define LDISKFS_STATE_LUSTRE_NOSCRUB 31
+#define LDISKFS_STATE_LUSTRE_DESTROY 30
/** Enable thandle usage statistics */
#define OSD_THANDLE_STATS (0)
struct osd_directory *oo_dir;
/** protects inode attributes. */
spinlock_t oo_guard;
+
+ __u32 oo_destroyed:1;
/**
* Following two members are used to indicate the presence of dot and
* dotdot in the given directory. This is required for interop mode
ooi_waiting:1; /* it::next is waiting. */
};
+struct osd_obj_orphan {
+ struct list_head oor_list;
+ struct lu_env *oor_env; /* to identify "own" records */
+ __u32 oor_ino;
+};
+
/*
* osd device.
*/
* exceeds the osd_device::od_full_scrub_threshold_rate,
* then trigger OI scrub to scan the whole device. */
__u64 od_full_scrub_threshold_rate;
+
+ /* a list of orphaned agent inodes, protected with od_osfs_lock */
+ struct list_head od_orphan_list;
};
enum osd_full_scrub_ratio {
unsigned short ot_credits;
unsigned short ot_id_cnt;
unsigned short ot_id_type;
+ int ot_remove_agents:1;
uid_t ot_id_array[OSD_MAX_UGID_CNT];
struct lquota_trans *ot_quota_trans;
#if OSD_THANDLE_STATS
#ifdef LDISKFS_HT_MISC
# define osd_journal_start_sb(sb, type, nblock) \
ldiskfs_journal_start_sb(sb, type, nblock)
-# define osd_ldiskfs_append(handle, inode, nblock, err) \
+# define osd_ldiskfs_append(handle, inode, nblock) \
ldiskfs_append(handle, inode, nblock)
# define osd_ldiskfs_find_entry(dir, name, de, inlined, lock) \
__ldiskfs_find_entry(dir, name, de, inlined, lock)
# define LDISKFS_HT_MISC 0
# define osd_journal_start_sb(sb, type, nblock) \
ldiskfs_journal_start_sb(sb, nblock)
-# define osd_ldiskfs_append(handle, inode, nblock, err) \
- ldiskfs_append(handle, inode, nblock, err)
+
+static inline struct buffer_head *osd_ldiskfs_append(handle_t *handle,
+ struct inode *inode,
+ ldiskfs_lblk_t *nblock)
+{
+ struct buffer_head *bh;
+ int err = 0;
+
+ bh = ldiskfs_append(handle, inode, nblock, &err);
+ if (bh == NULL)
+ bh = ERR_PTR(err);
+
+ return bh;
+}
+
# define osd_ldiskfs_find_entry(dir, name, de, inlined, lock) \
__ldiskfs_find_entry(dir, name, de, lock)
# define osd_journal_start(inode, type, nblocks) \
bag->ic_descr->id_ops->id_ipd_free(ipd);
}
+int osd_calc_bkmap_credits(struct super_block *sb, struct inode *inode,
+ const loff_t size, const loff_t pos,
+ const int blocks);
+
int osd_ldiskfs_read(struct inode *inode, void *buf, int size, loff_t *offs);
int osd_ldiskfs_write_record(struct inode *inode, void *buf, int bufsize,
int write_NUL, loff_t *offs, handle_t *handle);