Whamcloud - gitweb
LU-9679 modules: Use LIST_HEAD for declaring list_heads
[fs/lustre-release.git] / lustre / mdc / mdc_request.c
index e08bf89..93b2e63 100644 (file)
@@ -38,6 +38,7 @@
 #include <linux/pagemap.h>
 #include <linux/user_namespace.h>
 #include <linux/utsname.h>
+#include <linux/delay.h>
 #ifdef HAVE_UIDGID_HEADER
 # include <linux/uidgid.h>
 #endif
@@ -348,7 +349,7 @@ static int mdc_xattr_common(struct obd_export *exp,const struct req_format *fmt,
        /* Flush local XATTR locks to get rid of a possible cancel RPC */
        if (opcode == MDS_REINT && fid_is_sane(fid) &&
            exp->exp_connect_data.ocd_ibits_known & MDS_INODELOCK_XATTR) {
-               struct list_head cancels = LIST_HEAD_INIT(cancels);
+               LIST_HEAD(cancels);
                int count;
 
                /* Without that packing would fail */
@@ -1035,14 +1036,11 @@ static int mdc_getpage(struct obd_export *exp, const struct lu_fid *fid,
        struct ptlrpc_request   *req;
        struct ptlrpc_bulk_desc *desc;
        int                      i;
-       wait_queue_head_t        waitq;
        int                      resends = 0;
-       struct l_wait_info       lwi;
        int                      rc;
        ENTRY;
 
        *request = NULL;
-       init_waitqueue_head(&waitq);
 
 restart_bulk:
        req = ptlrpc_request_alloc(class_exp2cliimp(exp), &RQF_MDS_READPAGE);
@@ -1087,9 +1085,7 @@ restart_bulk:
                               exp->exp_obd->obd_name, -EIO);
                        RETURN(-EIO);
                }
-               lwi = LWI_TIMEOUT_INTR(cfs_time_seconds(resends), NULL, NULL,
-                                      NULL);
-               l_wait_event(waitq, 0, &lwi);
+               ssleep(resends);
 
                goto restart_bulk;
        }
@@ -1134,16 +1130,17 @@ static struct page *mdc_page_locate(struct address_space *mapping, __u64 *hash,
         */
        unsigned long offset = hash_x_index(*hash, hash64);
        struct page *page;
+       unsigned long flags;
        int found;
 
-       xa_lock_irq(&mapping->i_pages);
+       xa_lock_irqsave(&mapping->i_pages, flags);
        found = radix_tree_gang_lookup(&mapping->page_tree,
                                       (void **)&page, offset, 1);
        if (found > 0 && !radix_tree_exceptional_entry(page)) {
                struct lu_dirpage *dp;
 
                get_page(page);
-               xa_unlock_irq(&mapping->i_pages);
+               xa_unlock_irqrestore(&mapping->i_pages, flags);
                /*
                 * In contrast to find_lock_page() we are sure that directory
                 * page cannot be truncated (while DLM lock is held) and,
@@ -1192,7 +1189,7 @@ static struct page *mdc_page_locate(struct address_space *mapping, __u64 *hash,
                        page = ERR_PTR(-EIO);
                }
        } else {
-               xa_unlock_irq(&mapping->i_pages);
+               xa_unlock_irqrestore(&mapping->i_pages, flags);
                page = NULL;
        }
        return page;
@@ -2076,7 +2073,7 @@ static int mdc_quotactl(struct obd_device *unused, struct obd_export *exp,
 static int mdc_ioc_swap_layouts(struct obd_export *exp,
                                struct md_op_data *op_data)
 {
-       struct list_head cancels = LIST_HEAD_INIT(cancels);
+       LIST_HEAD(cancels);
        struct ptlrpc_request   *req;
        int                      rc, count;
        struct mdc_swap_layouts *msl, *payload;