X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=fs%2Fsmbfs%2Frequest.c;h=45f45933e86279126f1f349b2381563c102d0559;hb=48691ff86d91db1090551ec2a5ae0d80ef59105f;hp=723f7c6676614f6343ad6d3df7ca850c434eb282;hpb=b643b0fdbc59cf6bbb086974b29d2571e9e9f646;p=mv-sheeva.git diff --git a/fs/smbfs/request.c b/fs/smbfs/request.c index 723f7c66766..45f45933e86 100644 --- a/fs/smbfs/request.c +++ b/fs/smbfs/request.c @@ -6,10 +6,12 @@ * Please add a note about your changes to smbfs in the ChangeLog file. */ +#include #include #include #include #include +#include #include #include @@ -22,8 +24,6 @@ /* #define SMB_SLAB_DEBUG (SLAB_RED_ZONE | SLAB_POISON) */ #define SMB_SLAB_DEBUG 0 -#define ROUND_UP(x) (((x)+3) & ~3) - /* cache for request structures */ static struct kmem_cache *req_cachep; @@ -40,7 +40,7 @@ int smb_init_request_cache(void) req_cachep = kmem_cache_create("smb_request", sizeof(struct smb_request), 0, SMB_SLAB_DEBUG | SLAB_HWCACHE_ALIGN, - NULL, NULL); + NULL); if (req_cachep == NULL) return -ENOMEM; @@ -105,7 +105,7 @@ struct smb_request *smb_alloc_request(struct smb_sb_info *server, int bufsize) if (nfs_try_to_free_pages(server)) continue; - if (signalled() && (server->flags & NFS_MOUNT_INTR)) + if (fatal_signal_pending(current)) return ERR_PTR(-ERESTARTSYS); current->policy = SCHED_YIELD; schedule(); @@ -200,8 +200,8 @@ static int smb_setup_trans2request(struct smb_request *req) const int smb_parameters = 15; const int header = SMB_HEADER_LEN + 2 * smb_parameters + 2; - const int oparam = ROUND_UP(header + 3); - const int odata = ROUND_UP(oparam + req->rq_lparm); + const int oparam = ALIGN(header + 3, sizeof(u32)); + const int odata = ALIGN(oparam + req->rq_lparm, sizeof(u32)); const int bcc = (req->rq_data ? odata + req->rq_ldata : oparam + req->rq_lparm) - header;