44 * Initial release: Matias Bjorling <m@bjorling.me>
55 */
66
7+ #define pr_fmt (fmt ) "nvm: " fmt
8+
79#include <linux/list.h>
810#include <linux/types.h>
911#include <linux/sem.h>
@@ -74,7 +76,7 @@ static int nvm_reserve_luns(struct nvm_dev *dev, int lun_begin, int lun_end)
7476
7577 for (i = lun_begin ; i <= lun_end ; i ++ ) {
7678 if (test_and_set_bit (i , dev -> lun_map )) {
77- pr_err ("nvm: lun %d already allocated\n" , i );
79+ pr_err ("lun %d already allocated\n" , i );
7880 goto err ;
7981 }
8082 }
@@ -264,7 +266,7 @@ static int nvm_config_check_luns(struct nvm_geo *geo, int lun_begin,
264266 int lun_end )
265267{
266268 if (lun_begin > lun_end || lun_end >= geo -> all_luns ) {
267- pr_err ("nvm: lun out of bound (%u:%u > %u)\n" ,
269+ pr_err ("lun out of bound (%u:%u > %u)\n" ,
268270 lun_begin , lun_end , geo -> all_luns - 1 );
269271 return - EINVAL ;
270272 }
@@ -297,7 +299,7 @@ static int __nvm_config_extended(struct nvm_dev *dev,
297299 if (e -> op == 0xFFFF ) {
298300 e -> op = NVM_TARGET_DEFAULT_OP ;
299301 } else if (e -> op < NVM_TARGET_MIN_OP || e -> op > NVM_TARGET_MAX_OP ) {
300- pr_err ("nvm: invalid over provisioning value\n" );
302+ pr_err ("invalid over provisioning value\n" );
301303 return - EINVAL ;
302304 }
303305
@@ -334,23 +336,23 @@ static int nvm_create_tgt(struct nvm_dev *dev, struct nvm_ioctl_create *create)
334336 e = create -> conf .e ;
335337 break ;
336338 default :
337- pr_err ("nvm: config type not valid\n" );
339+ pr_err ("config type not valid\n" );
338340 return - EINVAL ;
339341 }
340342
341343 tt = nvm_find_target_type (create -> tgttype );
342344 if (!tt ) {
343- pr_err ("nvm: target type %s not found\n" , create -> tgttype );
345+ pr_err ("target type %s not found\n" , create -> tgttype );
344346 return - EINVAL ;
345347 }
346348
347349 if ((tt -> flags & NVM_TGT_F_HOST_L2P ) != (dev -> geo .dom & NVM_RSP_L2P )) {
348- pr_err ("nvm: device is incompatible with target L2P type.\n" );
350+ pr_err ("device is incompatible with target L2P type.\n" );
349351 return - EINVAL ;
350352 }
351353
352354 if (nvm_target_exists (create -> tgtname )) {
353- pr_err ("nvm: target name already exists (%s)\n" ,
355+ pr_err ("target name already exists (%s)\n" ,
354356 create -> tgtname );
355357 return - EINVAL ;
356358 }
@@ -367,7 +369,7 @@ static int nvm_create_tgt(struct nvm_dev *dev, struct nvm_ioctl_create *create)
367369
368370 tgt_dev = nvm_create_tgt_dev (dev , e .lun_begin , e .lun_end , e .op );
369371 if (!tgt_dev ) {
370- pr_err ("nvm: could not create target device\n" );
372+ pr_err ("could not create target device\n" );
371373 ret = - ENOMEM ;
372374 goto err_t ;
373375 }
@@ -686,7 +688,7 @@ static int nvm_set_rqd_ppalist(struct nvm_tgt_dev *tgt_dev, struct nvm_rq *rqd,
686688 rqd -> nr_ppas = nr_ppas ;
687689 rqd -> ppa_list = nvm_dev_dma_alloc (dev , GFP_KERNEL , & rqd -> dma_ppa_list );
688690 if (!rqd -> ppa_list ) {
689- pr_err ("nvm: failed to allocate dma memory\n" );
691+ pr_err ("failed to allocate dma memory\n" );
690692 return - ENOMEM ;
691693 }
692694
@@ -1073,7 +1075,7 @@ int nvm_set_chunk_meta(struct nvm_tgt_dev *tgt_dev, struct ppa_addr *ppas,
10731075 return 0 ;
10741076
10751077 if (nr_ppas > NVM_MAX_VLBA ) {
1076- pr_err ("nvm: unable to update all blocks atomically\n" );
1078+ pr_err ("unable to update all blocks atomically\n" );
10771079 return - EINVAL ;
10781080 }
10791081
@@ -1136,27 +1138,26 @@ static int nvm_init(struct nvm_dev *dev)
11361138 int ret = - EINVAL ;
11371139
11381140 if (dev -> ops -> identity (dev )) {
1139- pr_err ("nvm: device could not be identified\n" );
1141+ pr_err ("device could not be identified\n" );
11401142 goto err ;
11411143 }
11421144
1143- pr_debug ("nvm: ver:%u.%u nvm_vendor:%x\n" ,
1144- geo -> major_ver_id , geo -> minor_ver_id ,
1145- geo -> vmnt );
1145+ pr_debug ("ver:%u.%u nvm_vendor:%x\n" , geo -> major_ver_id ,
1146+ geo -> minor_ver_id , geo -> vmnt );
11461147
11471148 ret = nvm_core_init (dev );
11481149 if (ret ) {
1149- pr_err ("nvm: could not initialize core structures.\n" );
1150+ pr_err ("could not initialize core structures.\n" );
11501151 goto err ;
11511152 }
11521153
1153- pr_info ("nvm: registered %s [%u/%u/%u/%u/%u]\n" ,
1154+ pr_info ("registered %s [%u/%u/%u/%u/%u]\n" ,
11541155 dev -> name , dev -> geo .ws_min , dev -> geo .ws_opt ,
11551156 dev -> geo .num_chk , dev -> geo .all_luns ,
11561157 dev -> geo .num_ch );
11571158 return 0 ;
11581159err :
1159- pr_err ("nvm: failed to initialize nvm\n" );
1160+ pr_err ("failed to initialize nvm\n" );
11601161 return ret ;
11611162}
11621163
@@ -1194,7 +1195,7 @@ int nvm_register(struct nvm_dev *dev)
11941195 dev -> dma_pool = dev -> ops -> create_dma_pool (dev , "ppalist" ,
11951196 exp_pool_size );
11961197 if (!dev -> dma_pool ) {
1197- pr_err ("nvm: could not create dma pool\n" );
1198+ pr_err ("could not create dma pool\n" );
11981199 kref_put (& dev -> ref , nvm_free );
11991200 return - ENOMEM ;
12001201 }
@@ -1239,7 +1240,7 @@ static int __nvm_configure_create(struct nvm_ioctl_create *create)
12391240 up_write (& nvm_lock );
12401241
12411242 if (!dev ) {
1242- pr_err ("nvm: device not found\n" );
1243+ pr_err ("device not found\n" );
12431244 return - EINVAL ;
12441245 }
12451246
@@ -1313,7 +1314,7 @@ static long nvm_ioctl_get_devices(struct file *file, void __user *arg)
13131314 i ++ ;
13141315
13151316 if (i > 31 ) {
1316- pr_err ("nvm: max 31 devices can be reported.\n" );
1317+ pr_err ("max 31 devices can be reported.\n" );
13171318 break ;
13181319 }
13191320 }
@@ -1340,7 +1341,7 @@ static long nvm_ioctl_dev_create(struct file *file, void __user *arg)
13401341
13411342 if (create .conf .type == NVM_CONFIG_TYPE_EXTENDED &&
13421343 create .conf .e .rsv != 0 ) {
1343- pr_err ("nvm: reserved config field in use\n" );
1344+ pr_err ("reserved config field in use\n" );
13441345 return - EINVAL ;
13451346 }
13461347
@@ -1356,7 +1357,7 @@ static long nvm_ioctl_dev_create(struct file *file, void __user *arg)
13561357 flags &= ~NVM_TARGET_FACTORY ;
13571358
13581359 if (flags ) {
1359- pr_err ("nvm: flag not supported\n" );
1360+ pr_err ("flag not supported\n" );
13601361 return - EINVAL ;
13611362 }
13621363 }
@@ -1374,7 +1375,7 @@ static long nvm_ioctl_dev_remove(struct file *file, void __user *arg)
13741375 remove .tgtname [DISK_NAME_LEN - 1 ] = '\0' ;
13751376
13761377 if (remove .flags != 0 ) {
1377- pr_err ("nvm: no flags supported\n" );
1378+ pr_err ("no flags supported\n" );
13781379 return - EINVAL ;
13791380 }
13801381
@@ -1390,7 +1391,7 @@ static long nvm_ioctl_dev_init(struct file *file, void __user *arg)
13901391 return - EFAULT ;
13911392
13921393 if (init .flags != 0 ) {
1393- pr_err ("nvm: no flags supported\n" );
1394+ pr_err ("no flags supported\n" );
13941395 return - EINVAL ;
13951396 }
13961397
0 commit comments