inode.c (db71922217a214e5c9268448e537b54fc1f301ea) | inode.c (4f819a7899b06afcd7623ab9d00fd81503ad3e24) |
---|---|
1/* 2 * linux/fs/isofs/inode.c 3 * 4 * (C) 1991 Linus Torvalds - minix filesystem 5 * 1992, 1993, 1994 Eric Youngdale Modified for ISO 9660 filesystem. 6 * 1994 Eberhard Mönkeberg - multi session handling. 7 * 1995 Mark Dobie - allow mounting of some weird VideoCDs and PhotoCDs. 8 * 1997 Gordon Chaffee - Joliet CDs 9 * 1998 Eric Lammerts - ISO 9660 Level 3 10 * 2004 Paul Serice - Inode Support pushed out from 4GB to 128GB 11 * 2004 Paul Serice - NFS Export Operations 12 */ 13 14#include <linux/init.h> 15#include <linux/module.h> 16 17#include <linux/slab.h> 18#include <linux/nls.h> 19#include <linux/ctype.h> | 1/* 2 * linux/fs/isofs/inode.c 3 * 4 * (C) 1991 Linus Torvalds - minix filesystem 5 * 1992, 1993, 1994 Eric Youngdale Modified for ISO 9660 filesystem. 6 * 1994 Eberhard Mönkeberg - multi session handling. 7 * 1995 Mark Dobie - allow mounting of some weird VideoCDs and PhotoCDs. 8 * 1997 Gordon Chaffee - Joliet CDs 9 * 1998 Eric Lammerts - ISO 9660 Level 3 10 * 2004 Paul Serice - Inode Support pushed out from 4GB to 128GB 11 * 2004 Paul Serice - NFS Export Operations 12 */ 13 14#include <linux/init.h> 15#include <linux/module.h> 16 17#include <linux/slab.h> 18#include <linux/nls.h> 19#include <linux/ctype.h> |
20#include <linux/smp_lock.h> | |
21#include <linux/statfs.h> 22#include <linux/cdrom.h> 23#include <linux/parser.h> 24 25#include "isofs.h" 26#include "zisofs.h" 27 28#define BEQUIET --- 10 unchanged lines hidden (view full) --- 39static int isofs_dentry_cmp_ms(struct dentry *dentry, struct qstr *a, struct qstr *b); 40#endif 41 42static void isofs_put_super(struct super_block *sb) 43{ 44 struct isofs_sb_info *sbi = ISOFS_SB(sb); 45 46#ifdef CONFIG_JOLIET | 20#include <linux/statfs.h> 21#include <linux/cdrom.h> 22#include <linux/parser.h> 23 24#include "isofs.h" 25#include "zisofs.h" 26 27#define BEQUIET --- 10 unchanged lines hidden (view full) --- 38static int isofs_dentry_cmp_ms(struct dentry *dentry, struct qstr *a, struct qstr *b); 39#endif 40 41static void isofs_put_super(struct super_block *sb) 42{ 43 struct isofs_sb_info *sbi = ISOFS_SB(sb); 44 45#ifdef CONFIG_JOLIET |
47 lock_kernel(); 48 | |
49 unload_nls(sbi->s_nls_iocharset); | 46 unload_nls(sbi->s_nls_iocharset); |
50 51 unlock_kernel(); | |
52#endif 53 54 kfree(sbi); 55 sb->s_fs_info = NULL; 56 return; 57} 58 59static int isofs_read_inode(struct inode *); --- 506 unchanged lines hidden (view full) --- 566 struct isofs_sb_info *sbi; 567 unsigned long first_data_zone; 568 int joliet_level = 0; 569 int iso_blknum, block; 570 int orig_zonesize; 571 int table, error = -EINVAL; 572 unsigned int vol_desc_start; 573 | 47#endif 48 49 kfree(sbi); 50 sb->s_fs_info = NULL; 51 return; 52} 53 54static int isofs_read_inode(struct inode *); --- 506 unchanged lines hidden (view full) --- 561 struct isofs_sb_info *sbi; 562 unsigned long first_data_zone; 563 int joliet_level = 0; 564 int iso_blknum, block; 565 int orig_zonesize; 566 int table, error = -EINVAL; 567 unsigned int vol_desc_start; 568 |
574 lock_kernel(); 575 | |
576 save_mount_options(s, data); 577 578 sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); | 569 save_mount_options(s, data); 570 571 sbi = kzalloc(sizeof(*sbi), GFP_KERNEL); |
579 if (!sbi) { 580 unlock_kernel(); | 572 if (!sbi) |
581 return -ENOMEM; | 573 return -ENOMEM; |
582 } | |
583 s->s_fs_info = sbi; 584 585 if (!parse_options((char *)data, &opt)) 586 goto out_freesbi; 587 588 /* 589 * First of all, get the hardware blocksize for this device. 590 * If we don't know what it is, or the hardware blocksize is --- 231 unchanged lines hidden (view full) --- 822 sbi->s_showassoc = opt.showassoc; 823 sbi->s_uid = opt.uid; 824 sbi->s_gid = opt.gid; 825 sbi->s_uid_set = opt.uid_set; 826 sbi->s_gid_set = opt.gid_set; 827 sbi->s_utf8 = opt.utf8; 828 sbi->s_nocompress = opt.nocompress; 829 sbi->s_overriderockperm = opt.overriderockperm; | 574 s->s_fs_info = sbi; 575 576 if (!parse_options((char *)data, &opt)) 577 goto out_freesbi; 578 579 /* 580 * First of all, get the hardware blocksize for this device. 581 * If we don't know what it is, or the hardware blocksize is --- 231 unchanged lines hidden (view full) --- 813 sbi->s_showassoc = opt.showassoc; 814 sbi->s_uid = opt.uid; 815 sbi->s_gid = opt.gid; 816 sbi->s_uid_set = opt.uid_set; 817 sbi->s_gid_set = opt.gid_set; 818 sbi->s_utf8 = opt.utf8; 819 sbi->s_nocompress = opt.nocompress; 820 sbi->s_overriderockperm = opt.overriderockperm; |
821 mutex_init(&sbi->s_mutex); |
|
830 /* 831 * It would be incredibly stupid to allow people to mark every file 832 * on the disk as suid, so we merely allow them to set the default 833 * permissions. 834 */ 835 if (opt.fmode != ISOFS_INVALID_MODE) 836 sbi->s_fmode = opt.fmode & 0777; 837 else --- 61 unchanged lines hidden (view full) --- 899 if (joliet_level) 900 table += 2; 901 if (opt.check == 'r') 902 table++; 903 s->s_root->d_op = &isofs_dentry_ops[table]; 904 905 kfree(opt.iocharset); 906 | 822 /* 823 * It would be incredibly stupid to allow people to mark every file 824 * on the disk as suid, so we merely allow them to set the default 825 * permissions. 826 */ 827 if (opt.fmode != ISOFS_INVALID_MODE) 828 sbi->s_fmode = opt.fmode & 0777; 829 else --- 61 unchanged lines hidden (view full) --- 891 if (joliet_level) 892 table += 2; 893 if (opt.check == 'r') 894 table++; 895 s->s_root->d_op = &isofs_dentry_ops[table]; 896 897 kfree(opt.iocharset); 898 |
907 unlock_kernel(); | |
908 return 0; 909 910 /* 911 * Display error messages and free resources. 912 */ 913out_iput: 914 iput(inode); 915 goto out_no_inode; --- 23 unchanged lines hidden (view full) --- 939 printk(KERN_WARNING "ISOFS: Unable to identify CD-ROM format.\n"); 940 941out_freebh: 942 brelse(bh); 943out_freesbi: 944 kfree(opt.iocharset); 945 kfree(sbi); 946 s->s_fs_info = NULL; | 899 return 0; 900 901 /* 902 * Display error messages and free resources. 903 */ 904out_iput: 905 iput(inode); 906 goto out_no_inode; --- 23 unchanged lines hidden (view full) --- 930 printk(KERN_WARNING "ISOFS: Unable to identify CD-ROM format.\n"); 931 932out_freebh: 933 brelse(bh); 934out_freesbi: 935 kfree(opt.iocharset); 936 kfree(sbi); 937 s->s_fs_info = NULL; |
947 unlock_kernel(); | |
948 return error; 949} 950 951static int isofs_statfs (struct dentry *dentry, struct kstatfs *buf) 952{ 953 struct super_block *sb = dentry->d_sb; 954 u64 id = huge_encode_dev(sb->s_bdev->bd_dev); 955 --- 22 unchanged lines hidden (view full) --- 978 unsigned long b_off; 979 unsigned offset, sect_size; 980 unsigned int firstext; 981 unsigned long nextblk, nextoff; 982 long iblock = (long)iblock_s; 983 int section, rv, error; 984 struct iso_inode_info *ei = ISOFS_I(inode); 985 | 938 return error; 939} 940 941static int isofs_statfs (struct dentry *dentry, struct kstatfs *buf) 942{ 943 struct super_block *sb = dentry->d_sb; 944 u64 id = huge_encode_dev(sb->s_bdev->bd_dev); 945 --- 22 unchanged lines hidden (view full) --- 968 unsigned long b_off; 969 unsigned offset, sect_size; 970 unsigned int firstext; 971 unsigned long nextblk, nextoff; 972 long iblock = (long)iblock_s; 973 int section, rv, error; 974 struct iso_inode_info *ei = ISOFS_I(inode); 975 |
986 lock_kernel(); 987 | |
988 error = -EIO; 989 rv = 0; 990 if (iblock < 0 || iblock != iblock_s) { 991 printk(KERN_DEBUG "%s: block number too large\n", __func__); 992 goto abort; 993 } 994 995 b_off = iblock; --- 59 unchanged lines hidden (view full) --- 1055 bh++; /* Next buffer head */ 1056 b_off++; /* Next buffer offset */ 1057 nblocks--; 1058 rv++; 1059 } 1060 1061 error = 0; 1062abort: | 976 error = -EIO; 977 rv = 0; 978 if (iblock < 0 || iblock != iblock_s) { 979 printk(KERN_DEBUG "%s: block number too large\n", __func__); 980 goto abort; 981 } 982 983 b_off = iblock; --- 59 unchanged lines hidden (view full) --- 1043 bh++; /* Next buffer head */ 1044 b_off++; /* Next buffer offset */ 1045 nblocks--; 1046 rv++; 1047 } 1048 1049 error = 0; 1050abort: |
1063 unlock_kernel(); | |
1064 return rv != 0 ? rv : error; 1065} 1066 1067/* 1068 * Used by the standard interfaces. 1069 */ 1070static int isofs_get_block(struct inode *inode, sector_t iblock, 1071 struct buffer_head *bh_result, int create) --- 465 unchanged lines hidden --- | 1051 return rv != 0 ? rv : error; 1052} 1053 1054/* 1055 * Used by the standard interfaces. 1056 */ 1057static int isofs_get_block(struct inode *inode, sector_t iblock, 1058 struct buffer_head *bh_result, int create) --- 465 unchanged lines hidden --- |