+
+static inline void ll_set_lock_data(struct obd_export *exp, struct inode *inode,
+ struct lookup_intent *it, __u64 *bits)
+{
+ if (!it->d.lustre.it_lock_set) {
+ CDEBUG(D_DLMTRACE, "setting l_data to inode %p (%lu/%u)\n",
+ inode, inode->i_ino, inode->i_generation);
+ md_set_lock_data(exp, &it->d.lustre.it_lock_handle,
+ inode, &it->d.lustre.it_lock_bits);
+ it->d.lustre.it_lock_set = 1;
+ }
+
+ if (bits != NULL)
+ *bits = it->d.lustre.it_lock_bits;
+}
+
+static inline void ll_dentry_rehash(struct dentry *dentry, int locked)
+{
+ if (!locked) {
+ cfs_spin_lock(&ll_lookup_lock);
+ spin_lock(&dcache_lock);
+ }
+ if (d_unhashed(dentry))
+ d_rehash_cond(dentry, 0);
+ if (!locked) {
+ spin_unlock(&dcache_lock);
+ cfs_spin_unlock(&ll_lookup_lock);
+ }
+}
+
+static inline void ll_dentry_reset_flags(struct dentry *dentry, __u64 bits)
+{
+ if (bits & MDS_INODELOCK_LOOKUP &&
+ dentry->d_flags & DCACHE_LUSTRE_INVALID) {
+ lock_dentry(dentry);
+ dentry->d_flags &= ~DCACHE_LUSTRE_INVALID;
+ unlock_dentry(dentry);
+ }
+}
+
+#if LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2,7,50,0)
+/* Compatibility for old (1.8) compiled userspace quota code */
+struct if_quotactl_18 {
+ __u32 qc_cmd;
+ __u32 qc_type;
+ __u32 qc_id;
+ __u32 qc_stat;
+ struct obd_dqinfo qc_dqinfo;
+ struct obd_dqblk qc_dqblk;
+ char obd_type[16];
+ struct obd_uuid obd_uuid;
+};
+#define LL_IOC_QUOTACTL_18 _IOWR('f', 162, struct if_quotactl_18 *)
+/* End compatibility for old (1.8) compiled userspace quota code */
+#else
+#warning "remove old LL_IOC_QUOTACTL_18 compatibility code"
+#endif /* LUSTRE_VERSION_CODE < OBD_OCD_VERSION(2,7,50,0) */
+