Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 174670 | Differences between
and this patch

Collapse All | Expand All

(-)pvfs-2.6.3/src/kernel/linux-2.6/pvfs2-cache.c (-53 / +17 lines)
Lines 203-216 Link Here
203
    pvfs2_kmem_cache_t * cachep,
203
    pvfs2_kmem_cache_t * cachep,
204
    unsigned long flags)
204
    unsigned long flags)
205
{
205
{
206
    if (flags & SLAB_CTOR_CONSTRUCTOR)
206
    memset(req, 0, sizeof(MAX_ALIGNED_DEV_REQ_DOWNSIZE));
207
    {
208
        memset(req, 0, sizeof(MAX_ALIGNED_DEV_REQ_DOWNSIZE));
209
    }
210
    else
211
    {
212
        gossip_err("WARNING!! devreq_ctor called without ctor flag\n");
213
    }
214
}
207
}
215
208
216
int dev_req_cache_initialize(void)
209
int dev_req_cache_initialize(void)
Lines 269-313 Link Here
269
{
262
{
270
    pvfs2_inode_t *pvfs2_inode = (pvfs2_inode_t *)new_pvfs2_inode;
263
    pvfs2_inode_t *pvfs2_inode = (pvfs2_inode_t *)new_pvfs2_inode;
271
264
272
    if (flags & SLAB_CTOR_CONSTRUCTOR)
265
    memset(pvfs2_inode, 0, sizeof(pvfs2_inode_t));
273
    {
266
    ClearInitFlag(pvfs2_inode);
274
        memset(pvfs2_inode, 0, sizeof(pvfs2_inode_t));
275
        ClearInitFlag(pvfs2_inode);
276
267
277
        pvfs2_inode_initialize(pvfs2_inode);
268
    pvfs2_inode_initialize(pvfs2_inode);
278
269
279
#ifndef PVFS2_LINUX_KERNEL_2_4
270
#ifndef PVFS2_LINUX_KERNEL_2_4
280
        /*
271
    /*
281
           inode_init_once is from 2.6.x's inode.c; it's normally run
272
       inode_init_once is from 2.6.x's inode.c; it's normally run
282
           when an inode is allocated by the system's inode slab
273
       when an inode is allocated by the system's inode slab
283
           allocator.  we call it here since we're overloading the
274
       allocator.  we call it here since we're overloading the
284
           system's inode allocation with this routine, thus we have
275
       system's inode allocation with this routine, thus we have
285
           to init vfs inodes manually
276
       to init vfs inodes manually
286
        */
277
    */
287
        inode_init_once(&pvfs2_inode->vfs_inode);
278
    inode_init_once(&pvfs2_inode->vfs_inode);
288
        pvfs2_inode->vfs_inode.i_version = 1;
279
    pvfs2_inode->vfs_inode.i_version = 1;
289
#endif
280
#endif
290
        /* Initialize the reader/writer semaphore */
281
    /* Initialize the reader/writer semaphore */
291
        init_rwsem(&pvfs2_inode->xattr_sem);
282
    init_rwsem(&pvfs2_inode->xattr_sem);
292
    }
293
    else
294
    {
295
        gossip_err("WARNING!! inode_ctor called without ctor flag\n");
296
    }
297
}
298
299
static void pvfs2_inode_cache_dtor(
300
    void *old_pvfs2_inode,
301
    pvfs2_kmem_cache_t * cachep,
302
    unsigned long flags)
303
{
304
    pvfs2_inode_t *pvfs2_inode = (pvfs2_inode_t *)old_pvfs2_inode;
305
306
    if (pvfs2_inode && pvfs2_inode->link_target)
307
    {
308
        kfree(pvfs2_inode->link_target);
309
        pvfs2_inode->link_target = NULL;
310
    }
311
}
283
}
312
284
313
static inline void add_to_pinode_list(pvfs2_inode_t *pvfs2_inode)
285
static inline void add_to_pinode_list(pvfs2_inode_t *pvfs2_inode)
Lines 330-337 Link Here
330
{
302
{
331
    pvfs2_inode_cache = kmem_cache_create(
303
    pvfs2_inode_cache = kmem_cache_create(
332
        "pvfs2_inode_cache", sizeof(pvfs2_inode_t), 0,
304
        "pvfs2_inode_cache", sizeof(pvfs2_inode_t), 0,
333
        PVFS2_CACHE_CREATE_FLAGS, pvfs2_inode_cache_ctor,
305
        PVFS2_CACHE_CREATE_FLAGS, pvfs2_inode_cache_ctor, NULL);
334
        pvfs2_inode_cache_dtor);
335
306
336
    if (!pvfs2_inode_cache)
307
    if (!pvfs2_inode_cache)
337
    {
308
    {
Lines 403-416 Link Here
403
    pvfs2_kmem_cache_t * cachep,
374
    pvfs2_kmem_cache_t * cachep,
404
    unsigned long flags)
375
    unsigned long flags)
405
{
376
{
406
    if (flags & SLAB_CTOR_CONSTRUCTOR)
377
    memset(req, 0, sizeof(pvfs2_kiocb));
407
    {
408
        memset(req, 0, sizeof(pvfs2_kiocb));
409
    }
410
    else
411
    {
412
        gossip_err("WARNING!! kiocb_ctor called without ctor flag\n");
413
    }
414
}
378
}
415
379
416
380
(-)pvfs-2.6.3/src/kernel/linux-2.6/pvfs2-kernel.h (-6 / +27 lines)
Lines 47-52 Link Here
47
#include <linux/statfs.h>
47
#include <linux/statfs.h>
48
#include <linux/buffer_head.h>
48
#include <linux/buffer_head.h>
49
#include <linux/backing-dev.h>
49
#include <linux/backing-dev.h>
50
#include <linux/device.h>
50
#include <linux/mpage.h>
51
#include <linux/mpage.h>
51
#include <linux/namei.h>
52
#include <linux/namei.h>
52
#include <linux/errno.h>
53
#include <linux/errno.h>
Lines 363-369 Link Here
363
typedef struct
364
typedef struct
364
{
365
{
365
    PVFS_object_ref refn;
366
    PVFS_object_ref refn;
366
    char *link_target;
367
    char link_target[PVFS_NAME_MAX];
367
    /*
368
    /*
368
     * Reading/Writing Extended attributes need to acquire the appropriate
369
     * Reading/Writing Extended attributes need to acquire the appropriate
369
     * reader/writer semaphore on the pvfs2_inode_t structure.
370
     * reader/writer semaphore on the pvfs2_inode_t structure.
Lines 571-576 Link Here
571
572
572
#endif
573
#endif
573
574
575
typedef struct pvfs2_stats {
576
    unsigned long cache_hits;
577
    unsigned long cache_misses;
578
    unsigned long reads;
579
    unsigned long writes;
580
} pvfs2_stats;
581
582
extern pvfs2_stats g_pvfs2_stats;
583
574
/*
584
/*
575
  NOTE: See Documentation/filesystems/porting for information
585
  NOTE: See Documentation/filesystems/porting for information
576
  on implementing FOO_I and properly accessing fs private data
586
  on implementing FOO_I and properly accessing fs private data
Lines 821-828 Link Here
821
 * defined in devpvfs2-req.c
831
 * defined in devpvfs2-req.c
822
 ****************************/
832
 ****************************/
823
833
824
int     pvfs2_ioctl32_init(void);
834
int     pvfs2_dev_init(void);
825
void    pvfs2_ioctl32_cleanup(void);
835
void    pvfs2_dev_cleanup(void);
826
int     is_daemon_in_service(void);
836
int     is_daemon_in_service(void);
827
int     fs_mount_pending(PVFS_fs_id fsid);
837
int     fs_mount_pending(PVFS_fs_id fsid);
828
838
Lines 1250-1255 Link Here
1250
}
1260
}
1251
#endif
1261
#endif
1252
1262
1263
#ifndef HAVE_KZALLOC
1264
static void *kzalloc(size_t size, gfp_t mask)
1265
{
1266
    void *ptr;
1267
    ptr = kmalloc(size, mask);
1268
    if (ptr) {
1269
        memset(ptr, 0, size);
1270
    }
1271
    return ptr;
1272
}
1273
#endif
1274
1253
#endif /* PVFS2_LINUX_KERNEL_2_4 */
1275
#endif /* PVFS2_LINUX_KERNEL_2_4 */
1254
1276
1255
static inline unsigned int diff(struct timeval *end, struct timeval *begin)
1277
static inline unsigned int diff(struct timeval *end, struct timeval *begin)
Lines 1268-1278 Link Here
1268
	void * ptr;
1290
	void * ptr;
1269
1291
1270
	ptr = kmalloc(size, flags);
1292
	ptr = kmalloc(size, flags);
1271
	if(!ptr)
1293
	if (ptr)
1272
	{
1294
	{
1273
		return ptr;
1295
            memset(ptr, 0, size);
1274
	}
1296
	}
1275
	memset(ptr, 0, size);
1276
	return ptr;
1297
	return ptr;
1277
}
1298
}
1278
#endif
1299
#endif
(-)pvfs-2.6.3/src/kernel/linux-2.6/pvfs2-utils.c (-20 / +16 lines)
Lines 101-118 Link Here
101
static void pvfs2_set_inode_flags(struct inode *inode, 
101
static void pvfs2_set_inode_flags(struct inode *inode, 
102
        PVFS_sys_attr *attrs)
102
        PVFS_sys_attr *attrs)
103
{
103
{
104
    if (attrs->flags & PVFS_IMMUTABLE_FL)
104
    if (attrs->flags & PVFS_IMMUTABLE_FL) {
105
        inode->i_flags |= S_IMMUTABLE;
105
        inode->i_flags |= S_IMMUTABLE;
106
    else 
106
    }
107
    else {
107
        inode->i_flags &= ~S_IMMUTABLE;
108
        inode->i_flags &= ~S_IMMUTABLE;
108
    if (attrs->flags & PVFS_APPEND_FL)
109
    }
110
    if (attrs->flags & PVFS_APPEND_FL) {
109
        inode->i_flags |= S_APPEND;
111
        inode->i_flags |= S_APPEND;
110
    else
112
    }
113
    else {
111
        inode->i_flags &= ~S_APPEND;
114
        inode->i_flags &= ~S_APPEND;
112
    if (attrs->flags & PVFS_NOATIME_FL)
115
    }
116
    if (attrs->flags & PVFS_NOATIME_FL) {
113
        inode->i_flags |= S_NOATIME;
117
        inode->i_flags |= S_NOATIME;
114
    else
118
    }
119
    else {
115
        inode->i_flags &= ~S_NOATIME;
120
        inode->i_flags &= ~S_NOATIME;
121
    }
116
    return;
122
    return;
117
}
123
}
118
124
Lines 288-304 Link Here
288
                /* copy link target to inode private data */
294
                /* copy link target to inode private data */
289
                if (pvfs2_inode && symname)
295
                if (pvfs2_inode && symname)
290
                {
296
                {
291
                    if (pvfs2_inode->link_target)
297
                    strncpy(pvfs2_inode->link_target, symname, PVFS_NAME_MAX);
292
                    {
293
                        kfree(pvfs2_inode->link_target);
294
                        pvfs2_inode->link_target = NULL;
295
                    }
296
                    pvfs2_inode->link_target = kmalloc(
297
                        (strlen(symname) + 1), PVFS2_GFP_FLAGS);
298
                    if (pvfs2_inode->link_target)
299
                    {
300
                        strcpy(pvfs2_inode->link_target, symname);
301
                    }
302
                    gossip_debug(GOSSIP_UTILS_DEBUG, "Copied attr link target %s\n",
298
                    gossip_debug(GOSSIP_UTILS_DEBUG, "Copied attr link target %s\n",
303
                                pvfs2_inode->link_target);
299
                                pvfs2_inode->link_target);
304
                }
300
                }
Lines 1791-1797 Link Here
1791
{
1787
{
1792
    void *buf;
1788
    void *buf;
1793
1789
1794
    buf = kmalloc(sizeof(pvfs2_opaque_handle_t), PVFS2_BUFMAP_GFP_FLAGS);
1790
    buf = kmalloc(sizeof(pvfs2_opaque_handle_t), 
1791
                  PVFS2_BUFMAP_GFP_FLAGS);
1795
    return buf;
1792
    return buf;
1796
}
1793
}
1797
1794
Lines 1956-1962 Link Here
1956
        pvfs2_inode->refn.handle = PVFS_HANDLE_NULL;
1953
        pvfs2_inode->refn.handle = PVFS_HANDLE_NULL;
1957
        pvfs2_inode->refn.fs_id = PVFS_FS_ID_NULL;
1954
        pvfs2_inode->refn.fs_id = PVFS_FS_ID_NULL;
1958
        pvfs2_inode->last_failed_block_index_read = 0;
1955
        pvfs2_inode->last_failed_block_index_read = 0;
1959
        pvfs2_inode->link_target = NULL;
1956
        memset(pvfs2_inode->link_target, 0, sizeof(pvfs2_inode->link_target));
1960
        pvfs2_inode->error_code = 0;
1957
        pvfs2_inode->error_code = 0;
1961
        SetInitFlag(pvfs2_inode);
1958
        SetInitFlag(pvfs2_inode);
1962
    }
1959
    }
Lines 1964-1970 Link Here
1964
1961
1965
/*
1962
/*
1966
  this is called from super:pvfs2_destroy_inode.
1963
  this is called from super:pvfs2_destroy_inode.
1967
  pvfs2_inode_cache_dtor frees the link_target if any
1968
*/
1964
*/
1969
void pvfs2_inode_finalize(pvfs2_inode_t *pvfs2_inode)
1965
void pvfs2_inode_finalize(pvfs2_inode_t *pvfs2_inode)
1970
{
1966
{

Return to bug 174670