jfs_inode.c (a8b3e6f10f08f66ae1072efd087b30966a3654f6) | jfs_inode.c (fa3241d24cf1182b0ffb6e4d412c3bc2a2ab7bf6) |
---|---|
1/* 2 * Copyright (C) International Business Machines Corp., 2000-2004 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 * --- 11 unchanged lines hidden (view full) --- 20#include <linux/quotaops.h> 21#include "jfs_incore.h" 22#include "jfs_inode.h" 23#include "jfs_filsys.h" 24#include "jfs_imap.h" 25#include "jfs_dinode.h" 26#include "jfs_debug.h" 27 | 1/* 2 * Copyright (C) International Business Machines Corp., 2000-2004 3 * 4 * This program is free software; you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation; either version 2 of the License, or 7 * (at your option) any later version. 8 * --- 11 unchanged lines hidden (view full) --- 20#include <linux/quotaops.h> 21#include "jfs_incore.h" 22#include "jfs_inode.h" 23#include "jfs_filsys.h" 24#include "jfs_imap.h" 25#include "jfs_dinode.h" 26#include "jfs_debug.h" 27 |
28 29void jfs_set_inode_flags(struct inode *inode) 30{ 31 unsigned int flags = JFS_IP(inode)->mode2; 32 33 inode->i_flags &= ~(S_IMMUTABLE | S_APPEND | 34 S_NOATIME | S_DIRSYNC | S_SYNC); 35 36 if (flags & JFS_IMMUTABLE_FL) 37 inode->i_flags |= S_IMMUTABLE; 38 if (flags & JFS_APPEND_FL) 39 inode->i_flags |= S_APPEND; 40 if (flags & JFS_NOATIME_FL) 41 inode->i_flags |= S_NOATIME; 42 if (flags & JFS_DIRSYNC_FL) 43 inode->i_flags |= S_DIRSYNC; 44 if (flags & JFS_SYNC_FL) 45 inode->i_flags |= S_SYNC; 46} 47 |
|
28/* 29 * NAME: ialloc() 30 * 31 * FUNCTION: Allocate a new inode 32 * 33 */ 34struct inode *ialloc(struct inode *parent, umode_t mode) 35{ --- 33 unchanged lines hidden (view full) --- 69 DQUOT_DROP(inode); 70 inode->i_flags |= S_NOQUOTA; 71 inode->i_nlink = 0; 72 iput(inode); 73 return NULL; 74 } 75 76 inode->i_mode = mode; | 48/* 49 * NAME: ialloc() 50 * 51 * FUNCTION: Allocate a new inode 52 * 53 */ 54struct inode *ialloc(struct inode *parent, umode_t mode) 55{ --- 33 unchanged lines hidden (view full) --- 89 DQUOT_DROP(inode); 90 inode->i_flags |= S_NOQUOTA; 91 inode->i_nlink = 0; 92 iput(inode); 93 return NULL; 94 } 95 96 inode->i_mode = mode; |
77 if (S_ISDIR(mode)) 78 jfs_inode->mode2 = IDIRECTORY | mode; | 97 /* inherit flags from parent */ 98 jfs_inode->mode2 = JFS_IP(parent)->mode2 & JFS_FL_INHERIT; 99 100 if (S_ISDIR(mode)) { 101 jfs_inode->mode2 |= IDIRECTORY; 102 jfs_inode->mode2 &= ~JFS_DIRSYNC_FL; 103 } 104 else if (S_ISLNK(mode)) 105 jfs_inode->mode2 &= 106 ~(JFS_IMMUTABLE_FL|JFS_APPEND_FL); |
79 else | 107 else |
80 jfs_inode->mode2 = INLINEEA | ISPARSE | mode; | 108 jfs_inode->mode2 |= INLINEEA | ISPARSE; 109 jfs_inode->mode2 |= mode; 110 |
81 inode->i_blksize = sb->s_blocksize; 82 inode->i_blocks = 0; 83 inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; 84 jfs_inode->otime = inode->i_ctime.tv_sec; 85 inode->i_generation = JFS_SBI(sb)->gengen++; 86 87 jfs_inode->cflag = 0; 88 --- 4 unchanged lines hidden (view full) --- 93 jfs_inode->acltype = 0; 94 jfs_inode->btorder = 0; 95 jfs_inode->btindex = 0; 96 jfs_inode->bxflag = 0; 97 jfs_inode->blid = 0; 98 jfs_inode->atlhead = 0; 99 jfs_inode->atltail = 0; 100 jfs_inode->xtlid = 0; | 111 inode->i_blksize = sb->s_blocksize; 112 inode->i_blocks = 0; 113 inode->i_mtime = inode->i_atime = inode->i_ctime = CURRENT_TIME; 114 jfs_inode->otime = inode->i_ctime.tv_sec; 115 inode->i_generation = JFS_SBI(sb)->gengen++; 116 117 jfs_inode->cflag = 0; 118 --- 4 unchanged lines hidden (view full) --- 123 jfs_inode->acltype = 0; 124 jfs_inode->btorder = 0; 125 jfs_inode->btindex = 0; 126 jfs_inode->bxflag = 0; 127 jfs_inode->blid = 0; 128 jfs_inode->atlhead = 0; 129 jfs_inode->atltail = 0; 130 jfs_inode->xtlid = 0; |
131 jfs_set_inode_flags(inode); |
|
101 102 jfs_info("ialloc returns inode = 0x%p\n", inode); 103 104 return inode; 105} | 132 133 jfs_info("ialloc returns inode = 0x%p\n", inode); 134 135 return inode; 136} |